From d7e085b5868dc3386eaf96813feaa0f02ee3727f Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sat, 25 Oct 2025 11:54:42 -0400 Subject: read/write CAN ID in EEPROM --- fw/eeprom.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'fw/eeprom.h') 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 * #include * #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); -- cgit v1.2.3