-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathee.h
127 lines (118 loc) · 5.54 KB
/
ee.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/***********************************************************************
MODULE: EEPROM
VERSION: 1.01
CONTAINS: Routines for accessing the EEPROM on the Philips
P89LPC936
COPYRIGHT: Embedded Systems Academy, Inc. - www.esacademy.com
LICENSE: May be freely used in commercial and non-commercial code
without royalties provided this copyright notice remains
in this file and unaltered
WARNING: IF THIS FILE IS REGENERATED BY CODE ARCHITECT ANY CHANGES
MADE WILL BE LOST. WHERE POSSIBLE USE ONLY CODE ARCHITECT
TO CHANGE THE CONTENTS OF THIS FILE
GENERATED: On "Apr 04 2011" at "16:32:43" by Code Architect 2.06
***********************************************************************/
#ifndef _EEPROMH_
#define _EEPROMH_
/***********************************************************************
DESC: Initializes the EEPROM. Enables EEPROM interrupt
RETURNS: Nothing
CAUTION: Set EA to 1 after calling to enable all interrupts
************************************************************************/
extern void eeprom_init
(
void
);
/***********************************************************************
DESC: Reads a location in the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
RETURNS: The 8-bit value read if interrupts are disabled, otherwise
0x00 will be returned.
CAUTION: eeprom_init must be called first
************************************************************************/
extern unsigned char eeprom_read
(
unsigned int address // 9-bit address to read (0x000 - 0x1FF)
);
/***********************************************************************
DESC: Writes to a location in the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
extern void eeprom_write
(
unsigned int address, // 9-bit address to write to (0x000 - 0x1FF)
unsigned char value // value to write
);
/***********************************************************************
DESC: Writes a value to every location in a 64-byte row in
the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
extern void eeprom_fillrow
(
unsigned int address, // 9-bit starting address of row
// (64-byte aligned)
unsigned char value // value to fill row with
);
/***********************************************************************
DESC: Writes a value to every location in the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
extern void eeprom_fill
(
unsigned char value // value to fill EEPROM with
);
/***********************************************************************
DESC: Erases a 64-byte row in the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
Equivalent to eeprom_fillrow(address, 0x00);
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
extern void eeprom_eraserow
(
unsigned int address // 9-bit starting address of row
// (64-byte aligned)
);
/***********************************************************************
DESC: Erases the EEPROM.
If either global interrupts or the EEPROM interrupt is disabled
then the function will return when the operation is complete.
If global interrupts and the EEPROM interrupt are enabled, the
function will return immediately and an interrupt will occur
when the operation is complete.
Equivalent to eeprom_fill(0x00);
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
extern void eeprom_erase
(
void
);
#endif // _EEPROMH_