I2C Device Drivers
include/nuttx/i2c/i2c.h. All structures and APIs needed to work with I2C drivers are provided in this header file.
struct i2c_ops_s. Each I2C device driver must implement an instance of
struct i2c_ops_s. That structure defines a call table with the following methods:
Binding I2C Drivers. I2C drivers are not normally directly accessed by user code, but are usually bound to another, higher level device driver. In general, the binding sequence is:
Get an instance of
struct i2c_master_sfrom the hardware-specific I2C device driver, and
Provide that instance to the initialization method of the higher level device driver.