Mistake on this page?
Report an issue in GitHub or email us
Functions
Synchronous I2C Hardware Abstraction Layer for slave

Functions

void i2c_slave_mode (i2c_t *obj, int enable_slave)
 Configure I2C as slave or master. More...
 
int i2c_slave_receive (i2c_t *obj)
 Check to see if the I2C slave has been addressed. More...
 
int i2c_slave_read (i2c_t *obj, char *data, int length)
 Configure I2C as slave or master. More...
 
int i2c_slave_write (i2c_t *obj, const char *data, int length)
 Configure I2C as slave or master. More...
 
void i2c_slave_address (i2c_t *obj, int idx, uint32_t address, uint32_t mask)
 Configure I2C address. More...
 

Detailed Description

Function Documentation

void i2c_slave_address ( i2c_t obj,
int  idx,
uint32_t  address,
uint32_t  mask 
)

Configure I2C address.

Parameters
objThe I2C object
idxCurrently not used
addressThe address to be set
maskCurrently not used
void i2c_slave_mode ( i2c_t obj,
int  enable_slave 
)

Configure I2C as slave or master.

Parameters
objThe I2C object
enable_slaveEnable i2c hardware so you can receive events with i2c_slave_receive
Returns
non-zero if a value is available
int i2c_slave_read ( i2c_t obj,
char *  data,
int  length 
)

Configure I2C as slave or master.

Parameters
objThe I2C object
dataThe buffer for receiving
lengthNumber of bytes to read
Returns
non-zero if a value is available
int i2c_slave_receive ( i2c_t obj)

Check to see if the I2C slave has been addressed.

Parameters
objThe I2C object
Returns
The status - 1 - read addresses, 2 - write to all slaves, 3 write addressed, 0 - the slave has not been addressed
int i2c_slave_write ( i2c_t obj,
const char *  data,
int  length 
)

Configure I2C as slave or master.

Parameters
objThe I2C object
dataThe buffer for sending
lengthNumber of bytes to write
Returns
non-zero if a value is available
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.