diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-10-24 13:26:25 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-10-24 13:26:25 -0400 |
| commit | a0c6bbb21c5e7d9e0090e66c316cf88ef7f0726b (patch) | |
| tree | e161e66721a523b11fadf4313dad94a2962c555d /fw/tests/system/eeprom_systest.c | |
| parent | 32dafa1088e2f2428e9b67bf848faf2433216011 (diff) | |
| download | can-gauge-interface-a0c6bbb21c5e7d9e0090e66c316cf88ef7f0726b.zip | |
eeprom systest
Diffstat (limited to 'fw/tests/system/eeprom_systest.c')
| -rw-r--r-- | fw/tests/system/eeprom_systest.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fw/tests/system/eeprom_systest.c b/fw/tests/system/eeprom_systest.c new file mode 100644 index 0000000..8285e5c --- /dev/null +++ b/fw/tests/system/eeprom_systest.c @@ -0,0 +1,30 @@ +#include <xc.h> + +#include <stdint.h> + +#include "system.h" +#include "types.h" +#include "spi.h" +#include "eeprom.h" + +static const U16 addr = {0x00, 0x0A}; + +void +main(void) { + U8 val; + + sysInit(); + spiInit(); + eepromInit(); + + val = 0x8A; + (void)eepromWrite(addr, &val, 1u); // write 0b1000_1010 + (void)eepromRead(addr, &val, 1u); // read 0b1000_1010 + val = 0x8E; + (void)eepromWrite(addr, &val, 1u); // write 0b1000_1110 + (void)eepromRead(addr, &val, 1u); // read 0b1000_1110 + + for (;;) { + + } +} |