-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The driver APIs have been clearly divided into master and slave, with all calls now separated into i2c_master_* and i2c_slave_*. This provides a higher-level interface for the i2c driver. To support async operations in master mode, callbacks can be set in transmit, transmit_receive, and receive to signal when the operation is complete. An event callback can also be registered with register_event_callbacks to receive events such as I2C_EVENT_ALIVE, I2C_EVENT_DONE, and I2C_EVENT_NACK. To initiate a receive job call slave_receive while in slave mode and to wait for any receive data a callback can be registered with register_event_callbacks.
Changes to current i2c impl
- Add
AsyncI2cSlaveDriver - Add
I2cBusDriver: allows addingI2cDevice - Add
I2cDevice: exposesread,write,read_write - Add
AsyncI2cBusDriver: allows addingAsyncI2cDevice(adds a guard that only one device can use the bus at once), cannot depend onI2cBusDriverbecause config of bus requires config of cmd queue depth for async operations - Add
AsyncI2cDevice: exposesasync read,async write,async read_write - add cfg guards for current esp calls
major == 4 || version == 5.1 - add cfg guards to new calls
major != 4 && version != 5.1
Challenges
- new i2c API does not expose transactional operations
### Tasks
- [ ] https://github.com/esp-rs/esp-idf-sys/pull/290
Konstantin-Dudersky, leonardodanelutti and a-pechenyi
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo