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