I2C interface: Add a parmeter to I2C slave callback

This commit is contained in:
Gregory Nutt 2015-03-03 14:48:52 -06:00
parent 7a05d4907f
commit ca35d73586

View File

@ -250,18 +250,21 @@ struct i2c_ops_s
{ {
uint32_t (*setfrequency)(FAR struct i2c_dev_s *dev, uint32_t frequency); uint32_t (*setfrequency)(FAR struct i2c_dev_s *dev, uint32_t frequency);
int (*setaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits); int (*setaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits);
int (*write)(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen); int (*write)(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
int buflen);
int (*read)(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen); int (*read)(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_WRITEREAD #ifdef CONFIG_I2C_WRITEREAD
int (*writeread)(FAR struct i2c_dev_s *inst, const uint8_t *wbuffer, int wbuflen, int (*writeread)(FAR struct i2c_dev_s *inst, const uint8_t *wbuffer,
uint8_t *rbuffer, int rbuflen); int wbuflen, uint8_t *rbuffer, int rbuflen);
#endif #endif
#ifdef CONFIG_I2C_TRANSFER #ifdef CONFIG_I2C_TRANSFER
int (*transfer)(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count); int (*transfer)(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs,
int count);
#endif #endif
#ifdef CONFIG_I2C_SLAVE #ifdef CONFIG_I2C_SLAVE
int (*setownaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits); int (*setownaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits);
int (*registercallback)(FAR struct i2c_dev_s *dev, int (*callback)(void) ); int (*registercallback)(FAR struct i2c_dev_s *dev,
int (*callback)(FAR void *arg), FAR void *arg);
#endif #endif
}; };