Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
eeprom25AA256.h File Reference

Driver for the eeprom 225AA256 (and 25LC256) 256K SPI bus serial EEPROM from Microchip. More...

#include "std.h"
#include "mcu_periph/spi.h"
+ Include dependency graph for eeprom25AA256.h:
+ This graph shows which files directly or indirectly include this file:

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. More...
 
#define E25_OUT_BUFFER_LEN   3
 Output buffer length. More...
 

Functions

void eeprom25AA256_init (struct Eeprom25AA256 *eeprom, struct spi_periph *spi_p, uint8_t slave_idx)
 Init function. More...
 
void eeprom25AA256_read (struct Eeprom25AA256 *eeprom, uint16_t addr, uint16_t length)
 Read function. More...
 
void eeprom25AA256_event (struct Eeprom25AA256 *eeprom)
 Event function. More...
 

Detailed Description

Driver for the eeprom 225AA256 (and 25LC256) 256K SPI bus serial EEPROM from Microchip.

Currently, only reading is implemented

Definition in file eeprom25AA256.h.


Data Structure Documentation

◆ Eeprom25AA256

struct Eeprom25AA256

25AA256 eeprom structure

Definition at line 57 of file eeprom25AA256.h.

+ Collaboration diagram for Eeprom25AA256:
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

Macro Definition Documentation

◆ E25_IN_BUFFER_LEN

#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.

◆ E25_OUT_BUFFER_LEN

#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.

Function Documentation

◆ eeprom25AA256_event()

void eeprom25AA256_event ( struct Eeprom25AA256 eeprom)

Event function.

Parameters
[in]eeprompointer to 25AA256 eeprom struture

Definition at line 89 of file eeprom25AA256.c.

References Eeprom25AA256::data_available, Eeprom25AA256::spi_trans, SPITransDone, SPITransFailed, SPITransSuccess, and spi_transaction::status.

Referenced by meteo_stick_event().

+ Here is the caller graph for this function:

◆ eeprom25AA256_init()

◆ eeprom25AA256_read()

void eeprom25AA256_read ( struct Eeprom25AA256 eeprom,
uint16_t  addr,
uint16_t  length 
)

Read function.

Parameters
[in]eeprompointer to 25AA256 eeprom struture
[in]addr16-bit start read address
[in]lengthnumber of bytes to read

Definition at line 72 of file eeprom25AA256.c.

References E25_IN_BUFFER_LEN, E25_OUT_BUFFER_LEN, EEPROM_READ, spi_transaction::input_length, spi_transaction::output_length, Eeprom25AA256::spi_p, spi_submit(), Eeprom25AA256::spi_trans, SPITransDone, spi_transaction::status, and Eeprom25AA256::tx_buf.

Referenced by meteo_stick_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: