aboutsummaryrefslogtreecommitdiffstats
path: root/fw/eeprom.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-10-25 11:54:42 -0400
committerSam Anthony <sam@samanthony.xyz>2025-10-25 11:54:42 -0400
commitd7e085b5868dc3386eaf96813feaa0f02ee3727f (patch)
tree7dffd423bfa801e952ae6babe4510108bf558ad7 /fw/eeprom.h
parent5bcd2f2926f2cd0da3f77755d7109faad28751ff (diff)
downloadcan-gauge-interface-d7e085b5868dc3386eaf96813feaa0f02ee3727f.zip
read/write CAN ID in EEPROM
Diffstat (limited to 'fw/eeprom.h')
-rw-r--r--fw/eeprom.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/fw/eeprom.h b/fw/eeprom.h
index ab701d7..47f02e6 100644
--- a/fw/eeprom.h
+++ b/fw/eeprom.h
@@ -5,8 +5,10 @@
*
* Usage:
*
+ * #include <stdbool>
* #include <stdint.h>
* #include "types.h"
+ * #include "can.h"
* #include "eeprom.h"
*/
@@ -14,6 +16,10 @@
#define EEPROM_CS_TRIS TRISCbits.TRISC5
#define EEPROM_CS LATCbits.LATC5
+typedef U16 EepromAddr;
+
void eepromInit(void);
-Status eepromWrite(U16 addr, U8 data[], U8 size);
-Status eepromRead(U16 addr, U8 data[], U8 size);
+Status eepromWrite(EepromAddr addr, U8 data[], U8 size);
+Status eepromRead(EepromAddr addr, U8 data[], U8 size);
+Status eepromWriteCanId(EepromAddr addr, const CanId *id);
+Status eepromReadCanId(EepromAddr addr, CanId *id);