aboutsummaryrefslogtreecommitdiffstats
path: root/fw/eeprom.h
diff options
context:
space:
mode:
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);