aboutsummaryrefslogtreecommitdiffstats
path: root/fw/tests/system/eeprom_systest.c
blob: 8285e5c612c7fbe65d2b31ebd6ad0ce4a30af4d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 (;;) {

	}
}