1
0

I2C driver cleanup (#21273)

* remove i2c_start and i2c_stop from i2c drivers

* remove static i2c_address variable from chibios i2c driver
This commit is contained in:
David Hoelscher
2024-01-17 07:05:38 -06:00
committed by GitHub
parent 2b0965944d
commit e9bd7d7ad3
49 changed files with 280 additions and 603 deletions

View File

@@ -14,7 +14,6 @@ void ds1307_set_time(uint8_t h, uint8_t m, uint8_t s) {
void ds1307_get_time(uint8_t *h, uint8_t *m, uint8_t *s) {
uint8_t data[3];
i2c_read_register(DS1307_ADDR, 0, data, 3, 100);
i2c_stop();
*s = (data[0] & 0b1111) + ((data[0] & 0b1110000) >> 4) * 10;
*m = (data[1] & 0b1111) + ((data[1] & 0b1110000) >> 4) * 10;
*h = (data[2] & 0b1111) + ((data[2] & 0b0110000) >> 4) * 10;