diff --git a/i2c/i2c.c b/i2c/i2c.c index 6a91d7f..9fa5c1b 100644 --- a/i2c/i2c.c +++ b/i2c/i2c.c @@ -22,7 +22,6 @@ inline void set_sda(i2c_bus_t *bus) { } inline void clear_sda(i2c_bus_t *bus) { - dio_set(&bus->sda, 0); dio_set_direction(&bus->sda, LINE_OUT); } @@ -35,7 +34,6 @@ inline void set_scl(i2c_bus_t *bus) { } inline void clear_scl(i2c_bus_t *bus) { - dio_set(&bus->scl, 0); dio_set_direction(&bus->scl, LINE_OUT); } @@ -43,18 +41,13 @@ inline uint8_t read_scl(i2c_bus_t *bus) { return dio_read(&bus->scl); } -void i2c_init_host(i2c_bus_t *bus) { +void i2c_init(i2c_bus_t *bus) { + dio_set(&bus->sda, 0); + dio_set(&bus->scl, 0); set_sda(bus); set_scl(bus); } -/* -void i2c_init_client(i2c_client_t *bus) { - set_sda(bus); - set_scl(bus); -} -*/ - void i2c_start_condition(i2c_bus_t *bus, i2c_error_e *error) { if (*error != i2c_ok) return; diff --git a/i2c/i2c.h b/i2c/i2c.h index 69548df..2e2f4fb 100644 --- a/i2c/i2c.h +++ b/i2c/i2c.h @@ -35,8 +35,7 @@ typedef struct { } i2c_client_t; */ -void i2c_init_host(i2c_bus_t *); -// void i2c_init_client(i2c_client_t *); +void i2c_init(i2c_bus_t *); // void i2c_host_write(i2c_host_t *, uint8_t, uint8_t, size_t, i2c_error_e);