i2c_slave.h 293 B

12345678910111213141516
  1. #ifndef I2C_SLAVE_H_
  2. #define I2C_SLAVE_H_
  3. #include "util.h"
  4. struct i2c_slave_ops {
  5. uint8_t (*transmit)(bool start);
  6. bool (*receive)(bool start, uint8_t byte);
  7. };
  8. void i2cs_add_slave(uint8_t addr, const struct i2c_slave_ops __flash *ops);
  9. void i2cs_init(void);
  10. #endif /* I2C_SLAVE_H_ */