summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/dev/egpio.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-09-12 15:53:12 +0200
committerUros Majstorovic <majstor@majstor.org>2024-09-12 15:53:12 +0200
commit9f08d9e1892f78efdf84ac067ee2ebd0bd077d69 (patch)
tree5f1fff605404755e52fbc5f9dec1b4d40b8cecab /fw/fe310/eos/dev/egpio.c
parent200c401da28af7dcc6f7a3413837ab9a01410a2c (diff)
ext gpio driver initial commit
Diffstat (limited to 'fw/fe310/eos/dev/egpio.c')
-rw-r--r--fw/fe310/eos/dev/egpio.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fw/fe310/eos/dev/egpio.c b/fw/fe310/eos/dev/egpio.c
new file mode 100644
index 0000000..e5a39bf
--- /dev/null
+++ b/fw/fe310/eos/dev/egpio.c
@@ -0,0 +1,21 @@
+#include <stdlib.h>
+#include <stdint.h>
+
+#include "eos.h"
+#include "soc/i2c.h"
+
+#include "fxl6408.h"
+#include "egpio.h"
+
+int eos_egpio_pin_get(uint8_t reg, uint8_t pin, uint8_t *val) {
+ uint8_t chip_id;
+
+ chip_id = (pin & EGPIO_PIN_MASK_CHIP_ID) >> 4;
+ pin &= EGPIO_PIN_MASK;
+}
+int eos_egpio_pin_set(uint8_t reg, uint8_t pin, uint8_t val) {
+ uint8_t chip_id;
+
+ chip_id = (pin & EGPIO_PIN_MASK_CHIP_ID) >> 4;
+ pin &= EGPIO_PIN_MASK;
+} \ No newline at end of file