Hopefully fix I2C/Wire

Tested with (all at the same time):
- MPU9250
- HTU21
- TMP102
- BMP180
- AM2320
- SSD1306
This commit is contained in:
me-no-dev
2016-12-14 02:41:22 +02:00
parent e92634a92b
commit c19fc061b0
3 changed files with 71 additions and 25 deletions

View File

@ -35,6 +35,10 @@ typedef struct i2c_struct_t i2c_t;
i2c_t * i2cInit(uint8_t i2c_num, uint16_t slave_addr, bool addr_10bit_en);
//call this after you setup the bus and pins to send empty packet
//required because when pins are attached, they emit pulses that lock the bus
void i2cInitFix(i2c_t * i2c);
i2c_err_t i2cSetFrequency(i2c_t * i2c, uint32_t clk_speed);
uint32_t i2cGetFrequency(i2c_t * i2c);