Fix to i2c code
This commit is contained in:
parent
02728f1668
commit
afb04f8378
@ -128,11 +128,8 @@ void common_hal_is31fl3741_set_current(is31fl3741_IS31FL3741_obj_t *self, uint8_
|
|||||||
uint8_t common_hal_is31fl3741_get_current(is31fl3741_IS31FL3741_obj_t *self) {
|
uint8_t common_hal_is31fl3741_get_current(is31fl3741_IS31FL3741_obj_t *self) {
|
||||||
common_hal_is31fl3741_set_page(self, 4);
|
common_hal_is31fl3741_set_page(self, 4);
|
||||||
uint8_t gcur = 0x01; // global current command
|
uint8_t gcur = 0x01; // global current command
|
||||||
common_hal_busio_i2c_write(self->i2c, self->device_address, &gcur, 1, true);
|
common_hal_busio_i2c_write_read(self->i2c, self->device_address, &gcur, 1, &gcur, 1);
|
||||||
|
return gcur;
|
||||||
uint8_t data = 0;
|
|
||||||
common_hal_busio_i2c_read(self->i2c, self->device_address, &data, 1);
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void common_hal_is31fl3741_set_led(is31fl3741_IS31FL3741_obj_t *self, uint16_t led, uint8_t level, uint8_t page) {
|
void common_hal_is31fl3741_set_led(is31fl3741_IS31FL3741_obj_t *self, uint16_t led, uint8_t level, uint8_t page) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user