20 lines
445 B
C
20 lines
445 B
C
#ifndef __I2C_BB_H__
|
|
#define __I2C_BB_H__
|
|
|
|
#include <gpio_ftdi/gpio.h>
|
|
|
|
struct i2c_bb {
|
|
struct gpio *sda;
|
|
struct gpio *scl;
|
|
};
|
|
|
|
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);
|
|
|
|
#endif
|