From 040f4333678f46f3558e604014d460076244af6b Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 7 Dec 2019 17:13:23 +0100 Subject: added net_alloc; fixed cell modem driver --- code/esp32/components/eos/bq25895.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'code/esp32/components/eos/bq25895.c') 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); -- cgit v1.2.3