summaryrefslogtreecommitdiff
path: root/code/esp32/components/eos/bq25895.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2019-12-07 17:13:23 +0100
committerUros Majstorovic <majstor@majstor.org>2019-12-07 17:13:23 +0100
commit040f4333678f46f3558e604014d460076244af6b (patch)
tree084b8a41eef67a9bf45a5c21124fc393061f88fb /code/esp32/components/eos/bq25895.c
parent8cdc7528c800a3f10bca3e875e76f6d9661ab88f (diff)
added net_alloc; fixed cell modem driver
Diffstat (limited to 'code/esp32/components/eos/bq25895.c')
-rw-r--r--code/esp32/components/eos/bq25895.c24
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);