diff options
Diffstat (limited to 'fw')
-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++) { |