Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Functions | |
void | i2c_slave_mode (i2c_t *obj, int enable_slave) |
Configure I2C as slave or master. | |
int | i2c_slave_receive (i2c_t *obj) |
Check to see if the I2C slave has been addressed. | |
int | i2c_slave_read (i2c_t *obj, char *data, int length) |
Configure I2C as slave or master. | |
int | i2c_slave_write (i2c_t *obj, const char *data, int length) |
Configure I2C as slave or master. | |
void | i2c_slave_address (i2c_t *obj, int idx, uint32_t address, uint32_t mask) |
Configure I2C address. |
Function Documentation
void i2c_slave_address | ( | i2c_t * | obj, |
int | idx, | ||
uint32_t | address, | ||
uint32_t | mask | ||
) |
Configure I2C address.
- Parameters:
-
obj The I2C object idx Currently not used address The address to be set mask Currently not used
void i2c_slave_mode | ( | i2c_t * | obj, |
int | enable_slave | ||
) |
Configure I2C as slave or master.
- Parameters:
-
obj The I2C object enable_slave Enable 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:
-
obj The I2C object data The buffer for receiving length Number 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:
-
obj The 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:
-
obj The I2C object data The buffer for sending length Number of bytes to write
- Returns:
- non-zero if a value is available
Generated on Tue Jul 12 2022 20:37:47 by
