diff options
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 (;;) { + + } +} |