aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eeprom.h
blob: 4e4dfe224d7b38766b4993ad564066a76572b498 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Microchip 25LC160C 2KiB EEPROM
 * 
 * Usage:
 *
 * #include <xc.h>
 * #include <stdint.h>
 * #include "types.h"
 * #include "spi.h"
 * #include "eeprom.h"
 */

// Pin mapping
#define EEPROM_CS_TRIS TRISAbits.TRISA5
#define EEPROM_CS LATAbits.LATA5

void eepromInit(void);
void eepromWriteEnable(void);
void eepromWriteDisable(void);
void eepromWrite(U16 addr, U8 data[], U8 size);
void eepromRead(U16 addr, U8 data[], U8 size);