48 eeprom->
spi_p = spi_p;
78 eeprom->
tx_buf[1] = (addr >> 8) & 0xff;
79 eeprom->
tx_buf[2] = addr & 0xff;
enum SPIClockPolarity cpol
clock polarity control
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint16_t output_length
number of data words to write
void eeprom25AA256_init(struct Eeprom25AA256 *eeprom, struct spi_periph *spi_p, uint8_t slave_idx)
Init function.
struct spi_transaction spi_trans
spi transaction
void eeprom25AA256_read(struct Eeprom25AA256 *eeprom, uint16_t addr, uint16_t length)
Read function.
Eeprom25AA256InstructionSet
Instruction set.
void eeprom25AA256_event(struct Eeprom25AA256 *eeprom)
Event function.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
enum SPIBitOrder bitorder
MSB/LSB order.
struct spi_periph * spi_p
spi peripheral
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
bool data_available
data read flag
enum SPISlaveSelect select
slave selection behavior
#define E25_OUT_BUFFER_LEN
Output buffer length.
enum SPIClockPhase cpha
clock phase control
Driver for the eeprom 225AA256 (and 25LC256) 256K SPI bus serial EEPROM from Microchip.
SPI peripheral structure.
#define E25_IN_BUFFER_LEN
Input buffer length.
SPICallback after_cb
NULL or function called after the transaction.
uint16_t input_length
number of data words to read
volatile uint8_t rx_buf[E25_IN_BUFFER_LEN]
receive buffer
slave is selected before transaction and unselected after
volatile uint8_t tx_buf[E25_OUT_BUFFER_LEN]
transmit buffer
enum SPIDataSizeSelect dss
data transfer word size
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
volatile uint8_t * input_buf
pointer to receive buffer for DMA
SPICallback before_cb
NULL or function called before the transaction.
enum SPITransactionStatus status