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.
Dependents: mbed_blinky-bmd-200 bmd-200_accel_demo firstRig
Fork of mbed-src by
Synchronous I2C Hardware Abstraction Layer for slave
| 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 
- 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 
- 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 
- Returns:
- non-zero if a value is available
Generated on Tue Jul 12 2022 20:42:05 by
 1.7.2
 1.7.2 
    