86 typedef struct SI2C_STATE {
101 uint8_t
writeBuffer( uint8_t addr_, uint8_t len_,
const uint8_t *
data);
102 uint8_t
read( uint8_t addr_, uint8_t reg, uint8_t len, uint8_t* buf);
103 uint8_t
transfer(uint8_t addr, uint8_t
send_len,
const uint8_t *
send, uint8_t len, uint8_t *buf);
145 #define SI2C_LOG_SIZE 199 146 static SI2C_State log[SI2C_LOG_SIZE];
147 static uint16_t log_ptr;
151 static uint64_t full_time;
152 static uint32_t int_count;
enum Soft_I2C::STATE State
uint8_t read(uint8_t addr_, uint8_t reg, uint8_t len, uint8_t *buf)
uint8_t transfer(uint8_t addr, uint8_t send_len, const uint8_t *send, uint8_t len, uint8_t *buf)
void init_hw(const gpio_dev *scl_dev, uint8_t scl_bit, const gpio_dev *sda_dev, uint8_t sda_bit, const timer_dev *tim)
const gpio_dev * _sda_dev
const gpio_dev * _scl_dev
void set_low_speed(bool s)
volatile GPIO_TypeDef * scl_port
volatile GPIO_TypeDef * sda_port
uint8_t writeBuffer(uint8_t addr_, uint8_t len_, const uint8_t *data)