Download Manual - Digi-Key

Transcript
Library Functions
EEPROM_READ_WORD, EEPROM_READ_BLOCK
Synopsis
#include <htc.h>
unsigned eeprom_read_word(unsigned address)
void
eeprom_read_block(unsigned address, unsigned block[], unsigned size)
Description
These functions allow read access to the on-chip EEPROM (when present) on a word per word basis
or by blocks memory of an arbitrary number of words. Each of these functions take a byte-address
(ignoring the least-significant bit) within the EEPROM space.
Example
#include <htc.h>
#define BLOCK_SIZE 10
void main(void)
{
unsigned int data;
unsigned int block[BLOCK_SIZE];
unsigned int address = 0x10;
data = eeprom_read_word(address);
eeprom_read_block(address, block, BLOCK_SIZE);
}
173