diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-08-27 02:30:19 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-08-27 02:30:19 +0200 |
commit | f78eeaa085e6da05f4a79ea8c4cb5bd8bc77bbab (patch) | |
tree | 76b64ade789d6558fe78014ecac65784f482e8e6 /fw/fe310/eos/i2c/bq25895.c | |
parent | 8c529f3b9b4538e307c67a2170c6a1fdd2e32934 (diff) |
fixed bq25895 initial regs
Diffstat (limited to 'fw/fe310/eos/i2c/bq25895.c')
-rw-r--r-- | fw/fe310/eos/i2c/bq25895.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fw/fe310/eos/i2c/bq25895.c b/fw/fe310/eos/i2c/bq25895.c index ab56904..934b5e7 100644 --- a/fw/fe310/eos/i2c/bq25895.c +++ b/fw/fe310/eos/i2c/bq25895.c @@ -10,10 +10,13 @@ void eos_bq25895_init(void) { uint8_t data = 0; int i, ret = EOS_OK; - eos_i2c_start(400000); - eos_i2c_write8(BQ25895_ADDR, 0, 0x26); // input current: 2.0 A - eos_i2c_write8(BQ25895_ADDR, 2, 0x28); - eos_i2c_write8(BQ25895_ADDR, 7, 0x8d); + eos_i2c_start(100000); + ret = eos_i2c_write8(BQ25895_ADDR, 0x07, 0x8d); // disable watchdog + if (ret) printf("I2C ERROR 0x07\n"); + ret = eos_i2c_write8(BQ25895_ADDR, 0x00, 0x28); // 2.1A input current + if (ret) printf("I2C ERROR 0x00\n"); + ret = eos_i2c_write8(BQ25895_ADDR, 0x03, 0x1e); // sysmin 3.7, disable otg + if (ret) printf("I2C ERROR 0x03\n"); printf("BQ25895:\n"); for (i=0; i<0x15; i++) { |