blob: 47f02e6c882b3e6acb5dfbd95f038299d2cf89e5 (
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
|
/* Microchip 25LC160C 2KiB EEPROM
*
* Device: PIC16F1459
* Compiler: XC8 v3.00
*
* Usage:
*
* #include <stdbool>
* #include <stdint.h>
* #include "types.h"
* #include "can.h"
* #include "eeprom.h"
*/
// Pin mapping
#define EEPROM_CS_TRIS TRISCbits.TRISC5
#define EEPROM_CS LATCbits.LATC5
typedef U16 EepromAddr;
void eepromInit(void);
Status eepromWrite(EepromAddr addr, U8 data[], U8 size);
Status eepromRead(EepromAddr addr, U8 data[], U8 size);
Status eepromWriteCanId(EepromAddr addr, const CanId *id);
Status eepromReadCanId(EepromAddr addr, CanId *id);
|