![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the eeprom 225AA256 (and 25LC256) 256K SPI bus serial EEPROM from Microchip. More...
Go to the source code of this file.
Data Structures | |
struct | Eeprom25AA256 |
25AA256 eeprom structure More... | |
Macros | |
#define | E25_IN_BUFFER_LEN (1024 + 3) |
Input buffer length. | |
#define | E25_OUT_BUFFER_LEN 3 |
Output buffer length. | |
Functions | |
void | eeprom25AA256_init (struct Eeprom25AA256 *eeprom, struct spi_periph *spi_p, uint8_t slave_idx) |
Init function. | |
void | eeprom25AA256_read (struct Eeprom25AA256 *eeprom, uint16_t addr, uint16_t length) |
Read function. | |
void | eeprom25AA256_event (struct Eeprom25AA256 *eeprom) |
Event function. | |
Driver for the eeprom 225AA256 (and 25LC256) 256K SPI bus serial EEPROM from Microchip.
Currently, only reading is implemented
Definition in file eeprom25AA256.h.
struct Eeprom25AA256 |
25AA256 eeprom structure
Definition at line 57 of file eeprom25AA256.h.
Data Fields | ||
---|---|---|
bool | data_available | data read flag |
volatile uint8_t | rx_buf[E25_IN_BUFFER_LEN] | receive buffer |
struct spi_periph * | spi_p | spi peripheral |
struct spi_transaction | spi_trans | spi transaction |
volatile uint8_t | tx_buf[E25_OUT_BUFFER_LEN] | transmit buffer |
#define E25_IN_BUFFER_LEN (1024 + 3) |
Input buffer length.
By default read 1024 bytes after the 3 empty bytes corresponding to the read command
Definition at line 43 of file eeprom25AA256.h.
#define E25_OUT_BUFFER_LEN 3 |
Output buffer length.
For read only operation, we need 1 byte for read command and 2 bytes for 16-bit address
Definition at line 52 of file eeprom25AA256.h.
|
extern |
Event function.
[in] | eeprom | pointer to 25AA256 eeprom struture |
Definition at line 89 of file eeprom25AA256.c.
References foo, SPITransDone, SPITransFailed, and SPITransSuccess.
Referenced by meteo_stick_event().
|
extern |
Init function.
[in] | eeprom | pointer to 25AA256 eeprom struture |
[in] | spi_p | pointer to spi device |
[in] | slave_idx | SPI slive index |
Definition at line 45 of file eeprom25AA256.c.
References foo, SPICphaEdge1, SPICpolIdleLow, SPIDiv128, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, and spi_periph::status.
Referenced by meteo_stick_init().
|
extern |
Read function.
[in] | eeprom | pointer to 25AA256 eeprom struture |
[in] | addr | 16-bit start read address |
[in] | length | number of bytes to read |
Definition at line 72 of file eeprom25AA256.c.
References E25_IN_BUFFER_LEN, E25_OUT_BUFFER_LEN, EEPROM_READ, foo, spi_submit(), and SPITransDone.
Referenced by meteo_stick_periodic().