summaryrefslogtreecommitdiff
path: root/code/esp32/components/eos/bq25895.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2019-08-30 13:44:45 +0200
committerUros Majstorovic <majstor@majstor.org>2019-08-30 13:44:45 +0200
commitd4885f39f5012f082e0ebbbf7c3aae385187facf (patch)
tree0bd8862f922b70565098d3cae90db2b00b1f6975 /code/esp32/components/eos/bq25895.c
parent37a18889be8efa08c9e054014ca7058768b51a61 (diff)
stub drivers added
Diffstat (limited to 'code/esp32/components/eos/bq25895.c')
-rw-r--r--code/esp32/components/eos/bq25895.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/code/esp32/components/eos/bq25895.c b/code/esp32/components/eos/bq25895.c
new file mode 100644
index 0000000..24d8686
--- /dev/null
+++ b/code/esp32/components/eos/bq25895.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <esp_log.h>
+
+#include "eos.h"
+#include "i2c.h"
+
+static const char *TAG = "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, 0, 0x3E);
+ data = eos_i2c_read8(BQ25895_ADDR, 0);
+ ESP_LOGI(TAG, "BUFFER: %02x", data);
+} \ No newline at end of file