Developer World
Spresense SDK Library v3.2.0-ebc0364
HostIF (Host Interface) driver

Classes

struct  hostif_buff_s
 Common buffer configuration. More...
 
struct  hostif_i2cconf_s
 I2C buffer configuration. More...
 
struct  hostif_spiconf_s
 SPI buffer configuration. More...
 

Macros

#define MAX_BUFFER_NUM   32
 Host interface maximum number of buffers.
 
#define HOSTIF_BUFF_ATTR_ADDR_OFFSET(n)   (((n) & 0x3) << 4)
 Host interface buffer attributes. More...
 
#define HOSTIF_BUFF_ATTR_FIXLEN   (0 << 2)
 
#define HOSTIF_BUFF_ATTR_VARLEN   (1 << 2)
 
#define HOSTIF_BUFF_ATTR_WRITE   (0 << 1)
 
#define HOSTIF_BUFF_ATTR_READ   (1 << 1)
 
#define EXTERN   extern "C"
 

Functions

int hostif_i2cinitialize (struct hostif_i2cconf_s *config)
 
int hostif_spiinitialize (struct hostif_spiconf_s *config)
 
int hostif_uninitialize (void)
 

Detailed Description

Macro Definition Documentation

◆ HOSTIF_BUFF_ATTR_ADDR_OFFSET

#define HOSTIF_BUFF_ATTR_ADDR_OFFSET (   n)    (((n) & 0x3) << 4)

Host interface buffer attributes.

2 to the power of n

◆ HOSTIF_BUFF_ATTR_FIXLEN

#define HOSTIF_BUFF_ATTR_FIXLEN   (0 << 2)

fixed length

◆ HOSTIF_BUFF_ATTR_VARLEN

#define HOSTIF_BUFF_ATTR_VARLEN   (1 << 2)

variable length

◆ HOSTIF_BUFF_ATTR_WRITE

#define HOSTIF_BUFF_ATTR_WRITE   (0 << 1)

from target to host

◆ HOSTIF_BUFF_ATTR_READ

#define HOSTIF_BUFF_ATTR_READ   (1 << 1)

from host to target

Function Documentation

◆ hostif_i2cinitialize()

int hostif_i2cinitialize ( struct hostif_i2cconf_s config)

Initialize the host interface for I2C slave

Parameters
[in]config- pointer to I2C buffer configuration
Returns
Return 0 on success. Otherwise, return a negated errno.

◆ hostif_spiinitialize()

int hostif_spiinitialize ( struct hostif_spiconf_s config)

Initialize the host interface for SPI slave

Parameters
[in]config- pointer to SPI buffer configuration
Returns
Return 0 on success. Otherwise, return a negated errno.

◆ hostif_uninitialize()

int hostif_uninitialize ( void  )

Uninitialize the host interface

Returns
Return 0 on success. Otherwise, return a negated errno.