5
Created by Marek Michalkiewicz <marekm@linux.org.pl>
7
THIS SOFTWARE IS NOT COPYRIGHTED
9
This source code is offered for use in the public domain. You may
10
use, modify or distribute it freely.
12
This code is distributed in the hope that it will be useful, but
13
WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
14
DISCLAIMED. This includes but is not limited to warranties of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26
/* return 1 if EEPROM is ready for a new read/write operation, 0 if not */
27
#define eeprom_is_ready() bit_is_clear(EECR, EEWE)
33
/* read one byte from EEPROM address ADDR */
34
extern unsigned char eeprom_rb(unsigned int addr);
36
/* read one 16-bit word (little endian) from EEPROM address ADDR */
37
extern unsigned int eeprom_rw(unsigned int addr);
39
/* write a byte VAL to EEPROM address ADDR */
40
extern void eeprom_wb(unsigned int addr, unsigned char val);
42
/* read a block of SIZE bytes from EEPROM address ADDR to BUF */
43
extern void eeprom_read_block(void *buf, unsigned int addr, size_t n);
50
/* IAR C compatibility defines */
51
#define _EEPUT(addr, val) eeprom_wb(addr, val)
52
#define _EEGET(var, addr) (var) = eeprom_rb(addr)
54
#endif /* _EEPROM_H_ */