i2c_bb/inc/i2c.h
2019-07-29 15:50:09 +02:00

18 lines
427 B
C

#ifndef __I2C_BB_H__
#define __I2C_BB_H__
#include <libgpio_sys/gpio.h>
struct i2c_bb {
struct gpio_sys *sda;
struct gpio_sys *scl;
};
int i2c_open(const struct i2c_bb *i2c);
int i2c_close(const struct i2c_bb *i2c);
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);
#endif