2019-07-18 14:26:03 +00:00
|
|
|
#ifndef __I2C_BB_H__
|
|
|
|
#define __I2C_BB_H__
|
|
|
|
|
2019-07-25 11:33:01 +00:00
|
|
|
#include <libgpio_sys/gpio_sys.h>
|
2019-07-18 14:26:03 +00:00
|
|
|
|
|
|
|
struct i2c_bb {
|
2019-07-25 11:33:01 +00:00
|
|
|
struct gpio_sys *sda;
|
|
|
|
struct gpio_sys *scl;
|
2019-07-18 14:26:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int i2c_open(const struct i2c_bb *i2c);
|
|
|
|
int i2c_close(const struct i2c_bb *i2c);
|
|
|
|
|
2019-07-23 13:26:50 +00:00
|
|
|
int i2c_read(const struct i2c_bb *i2c, uint8_t slave_addr, char *buffer, unsigned int len);
|
|
|
|
int i2c_write(const struct i2c_bb *i2c, uint8_t slave_addr, const char *buffer, unsigned int len);
|
2019-07-18 14:26:03 +00:00
|
|
|
|
|
|
|
#endif
|