eeprom.c File Reference
Driver for the 24xx16 and 24xx256 I2C EEPROMS (implementation). More...
#include "eeprom.h"
#include <cfg/debug.h>
#include <appconfig.h>
#include <cfg/macros.h>
#include <cpu/attr.h>
#include <CPU_HEADER(twi)>
#include <drv/wdt.h>
#include <mware/byteorder.h>
#include <string.h>
Go to the source code of this file.
Defines | |
| #define | EEPROM_ID 0xA0 |
| EEPROM ID code. | |
| #define | EEPROM_ADDR(x) (EEPROM_ID | (((uint8_t)(x)) << 1)) |
| This macros form the correct slave address for EEPROMs. | |
Functions | |
| static bool | eeprom_writeRaw (e2addr_t addr, const void *buf, size_t count) |
Copy count bytes from buffer buf to eeprom at address addr. | |
| bool | eeprom_read (e2addr_t addr, void *buf, size_t count) |
Copy count bytes at address addr from eeprom to RAM to buffer buf. | |
| bool | eeprom_write_char (e2addr_t addr, char c) |
| Write a single character c at address addr. | |
| int | eeprom_read_char (e2addr_t addr) |
| Read a single character at address addr. | |
| void | eeprom_erase (e2addr_t addr, size_t count) |
| Erase specified part of eeprom, writing 0xFF. | |
| void | eeprom_init (void) |
| Initialize TWI module. | |
Detailed Description
Driver for the 24xx16 and 24xx256 I2C EEPROMS (implementation).
- Note:
- This implementation is AVR specific.
- Version:
- Id
- eeprom.c 930 2007-10-23 14:48:48Z batt
Definition in file eeprom.c.
Function Documentation
| void eeprom_erase | ( | e2addr_t | addr, | |
| size_t | count | |||
| ) |
| bool eeprom_read | ( | e2addr_t | addr, | |
| void * | buf, | |||
| size_t | count | |||
| ) |
| int eeprom_read_char | ( | e2addr_t | addr | ) |
