static int i2c_do_write(i2c_t *obj, int value) { // write the data obj->i2c->D = value; // init and wait the end of the transfer return i2c_wait_end_tx_transfer(obj); }
static int i2c_do_write(i2c_t *obj, int value) { uint32_t i2c_addrs[] = I2C_BASE_ADDRS; I2C_HAL_WriteByte(i2c_addrs[obj->instance], value); // init and wait the end of the transfer return i2c_wait_end_tx_transfer(obj); }
static int i2c_do_write(i2c_t *obj, int value) { i2c_hal_write(obj->instance, value); // init and wait the end of the transfer return i2c_wait_end_tx_transfer(obj); }