aboutsummaryrefslogtreecommitdiffstats
path: root/fw/eeprom.h
blob: 16d9d721c46ba9343447e57db88d44673b52d0d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Microchip 25LC160C 2KiB EEPROM
 *
 * Device: PIC16F1459
 * Compiler: XC8 v3.00
 * 
 * Usage:
 *
 * #include <stdint.h>
 * #include "types.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);