i2c_bb: implement read/write

This commit is contained in:
Thomas Klaehn
2019-07-23 14:53:51 +02:00
parent 9249041ee5
commit 335d2cb69f
3 changed files with 51 additions and 9 deletions

View File

@@ -11,9 +11,7 @@ struct i2c_bb {
int i2c_open(const struct i2c_bb *i2c);
int i2c_close(const struct i2c_bb *i2c);
void start_condition(const struct i2c_bb *i2c);
void stop_condition(const struct i2c_bb *i2c);
bool write_byte(const struct i2c_bb *i2c, unsigned char byte);
unsigned char read_byte(const struct i2c_bb *i2c, bool ack);
int i2_read(const struct i2c_bb *i2c, uint8_t slave_addr, char *buffer, unsigned int len);
int i2_write(const struct i2c_bb *i2c, uint8_t slave_addr, const char *buffer, unsigned int len);
#endif