Modules | |
Version History | |
EEPROM - Code example | |
Functions | |
U8 | EEreadStatus () |
Read the eeprom status. | |
void | EEwriteStatus (U8 stat) |
Write the staus register. | |
void | EEwriteEnable (bool ena) |
Set the write enable latch (enable write operations). | |
U8 | EEread (U32 *add) |
Read a byte at the specified address. | |
U16 | EEreadWord (U32 *add) |
Read a word at the specified address. | |
U32 | EEreadLong (U32 *add) |
Read a double word at the specified address. | |
double | EEreadDouble (U32 *add) |
Read a double at the specified address. | |
void | EEreadString (U32 *add, char *text, U32 maxChars) |
Read a string starting at the specified address. | |
void | EEwrite (U32 *add, U8 data) |
Write a byte at the specified address. | |
void | EEwriteWord (U32 *add, U16 data) |
Write a word at the specified address. | |
void | EEwriteLong (U32 *add, U32 data) |
Write a double word at the specified address. | |
void | EEwriteDouble (U32 *add, double data) |
Write a double at the specified address. | |
void | EEwriteString (U32 *add, const char *text, U32 maxChars) |
Write a string at the specified address. | |
S8 | EEreadCheck (U32 *add, S8 lowValue, S8 highValue, S8 defaultValue) |
Read a byte and check it. | |
S16 | EEreadWordCheck (U32 *add, S16 lowValue, S16 highValue, S16 defaultValue) |
Read a word and check it. | |
S32 | EEreadLongCheck (U32 *add, S32 lowValue, S32 highValue, S32 defaultValue) |
Read a double word and check it. | |
F64 | EEreadDoubleCheck (U32 *add, F64 lowValue, F64 highValue, F64 defaultValue) |
Read a double and check it. |
|
|
|
Reads a byte verifying that its value belongs to a defined range. If this condition is not respected a default value is applied.
|
|
|
|
Reads a double verifying that its value belongs to a defined range. If this condition is not respected a default value is applied.
|
|
|
|
Reads a double word verifying that its value belongs to a defined range. If this condition is not respected a default value is applied.
|
|
* The Read Status Register instruction (RDSR) provides access to the STATUS register. * The STATUS register may be read at any time, even during a write cycle. * STATUS REGISTER\n * 7 6 5 4 3 2 1 0 * W/R - - - W/R W/R R R * WPEN X X X BP1 BP0 WEL WIP * The Write-In-Process (WIP) bit indicates whether the 25LC1024 is busy with a write operation. * When set to a ‘1’, a write is in progress, when set to a ‘0’, no write is in progress. * This bit is read-only. * The Write Enable Latch (WEL) bit indicates the status of the write enable latch and is read-only. * When set to a ‘1’, the latch allows writes to the array, when set to a ‘0’, the latch prohibits writes to the array. * The state of this bit can always be updated via the WREN or WRDI commands regardless of the state of write protection on the STATUS register. * The Block Protection (BP0 and BP1) bits indicate which blocks are currently write-protected. * These bits are set by the user issuing the WRSR instruction. * These bits are nonvolatile and are shown in above table. *
|
|
|
|
|
|
Reads a word verifying that its value belongs to a defined range. If this condition is not respected a default value is applied.
|
|
|
|
|
|
|
|
|
|
* The Write Status Register instruction (WRSR) allows the user to write to the nonvolatile bits in the STATUS register. * The user is able to select one of four levels of protection for the array by writing to the appropriate bits in the STATUS register. * The array is divided up into four segments. * The user has the ability to write-protect none, one, two, or all four of the segments of the array. * The partitioning is controlled as shown in below table: * BP1 BP0 Array Addresses Array Addresses * Write-Protected Unprotected * 0 0 none All (Sectors 0, 1, 2 & 3) * (00000h-1FFFFh) * 0 1 Upper 1/4 (Sector 3) Lower 3/4 (Sectors 0, 1 & 2) * (18000h-1FFFFh) (00000h-17FFFh) * 1 0 Upper 1/2 (Sectors 2&3) Lower 1/2 (Sectors 0 & 1) * (10000h-1FFFFh) (00000h-0FFFFh) * 1 1 All (Sectors 0,1,2&3) none * (00000h-1FFFFh) * The Write-Protect Enable (WPEN) bit is a nonvolatile bit that is available as an enable bit for the WP pin. * The Write-Protect (WP) pin and the Write-Protect Enable (WPEN) bit in the STATUS register control the programmable hardware write-protect feature. * Hardware write protection is enabled when WP pin is low and the WPEN bit is high. * Hardware write protection is disabled when either the WP pin is high or the WPEN bit is low. * When the chip is hardware write-protected, only writes to nonvolatile bits in the STATUS register are disabled. *
|
|
|
|
|