diff options
Diffstat (limited to 'code/esp32/components/eos/bq25895.c')
-rw-r--r-- | code/esp32/components/eos/bq25895.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/code/esp32/components/eos/bq25895.c b/code/esp32/components/eos/bq25895.c index fc32fbd..03116ca 100644 --- a/code/esp32/components/eos/bq25895.c +++ b/code/esp32/components/eos/bq25895.c @@ -4,30 +4,16 @@ #include "eos.h" #include "i2c.h" -static const char *TAG = "BQ25895"; +static const char *TAG = "EOS BQ25895"; #define BQ25895_ADDR 0x6A -/** - * @brief test function to show buffer - */ -static void disp_buf(uint8_t *buf, int len) -{ - int i; - for (i = 0; i < len; i++) { - printf("%02x ", buf[i]); - if ((i + 1) % 16 == 0) { - printf("\n"); - } - } - printf("\n"); -} - void eos_bq25895_set_ilim(void) { uint8_t data = 0; - // eos_i2c_write8(BQ25895_ADDR, 2, 0xfd); - eos_i2c_write8(BQ25895_ADDR, 2, 0xec); - eos_i2c_write8(BQ25895_ADDR, 0, 0x26); + eos_i2c_write8(BQ25895_ADDR, 0, 0x1c); + eos_i2c_write8(BQ25895_ADDR, 2, 0x28); + eos_i2c_write8(BQ25895_ADDR, 7, 0x8d); + data = eos_i2c_read8(BQ25895_ADDR, 0x00); ESP_LOGI(TAG, "REG00: %02x", data); data = eos_i2c_read8(BQ25895_ADDR, 0x01); |