diff options
author | Uros Majstorovic <majstor@majstor.org> | 2025-02-13 18:38:59 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2025-02-13 18:38:59 +0100 |
commit | 2d238f621b57a10dd262be124e0771ba1826347a (patch) | |
tree | 7f5e04e560e63af8b1b046f5f532aae24d060258 /fw/fe310/eos/dev/drv/bq25895.c | |
parent | b74fe91ca04484567b10bb7f3136d39d5e2363d8 (diff) |
moved other drivers to drv/
Diffstat (limited to 'fw/fe310/eos/dev/drv/bq25895.c')
-rw-r--r-- | fw/fe310/eos/dev/drv/bq25895.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fw/fe310/eos/dev/drv/bq25895.c b/fw/fe310/eos/dev/drv/bq25895.c new file mode 100644 index 0000000..6007598 --- /dev/null +++ b/fw/fe310/eos/dev/drv/bq25895.c @@ -0,0 +1,21 @@ +#include <stdlib.h> + +#include "eos.h" +#include "soc/i2c.h" + +#include "bq25895.h" + +int bq25895_reg_read(uint8_t reg, uint8_t *data) { + return eos_i2c_read8(BQ25895_ADDR, reg, data, 1); +} + +int bq25895_reg_write(uint8_t reg, uint8_t data) { + return eos_i2c_write8(BQ25895_ADDR, reg, &data, 1); +} + +int bq25895_read_fault(uint8_t *fault) { + int rv; + + rv = bq25895_reg_read(0x0c, fault); + return rv; +} |