aboutsummaryrefslogtreecommitdiffstats
path: root/fw/eeprom.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-08-16 14:59:36 -0230
committerSam Anthony <sam@samanthony.xyz>2025-08-16 14:59:36 -0230
commitee61ef56f775e44fd0b857a960102148910e6dce (patch)
tree9063a6a74af17d9a0ef45392dc28eaf770a22d69 /fw/eeprom.h
parent478a91bd82e27d8d6b2e597fd659e484ca6b205a (diff)
downloadcan-gauge-interface-ee61ef56f775e44fd0b857a960102148910e6dce.zip
usbcom: modified libusb example
Diffstat (limited to 'fw/eeprom.h')
-rw-r--r--fw/eeprom.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/fw/eeprom.h b/fw/eeprom.h
new file mode 100644
index 0000000..07438a0
--- /dev/null
+++ b/fw/eeprom.h
@@ -0,0 +1,23 @@
+/* Microchip 25LC160C 2KiB EEPROM
+ *
+ * Device: PIC16F1459
+ * Compiler: XC8 v3.00
+ *
+ * Usage:
+ *
+ * #include <xc.h>
+ * #include <stdint.h>
+ * #include "types.h"
+ * #include "spi.h"
+ * #include "eeprom.h"
+ */
+
+// Pin mapping
+#define EEPROM_CS_TRIS TRISAbits.TRISA5
+#define EEPROM_CS LATAbits.LATA5
+
+void eepromInit(void);
+void eepromWriteEnable(void);
+void eepromWriteDisable(void);
+void eepromWrite(U16 addr, U8 data[], U8 size);
+void eepromRead(U16 addr, U8 data[], U8 size);