58 eeprom->spi_trans.slave_idx = slave_idx;
59 eeprom->spi_trans.output_length = 0;
60 eeprom->spi_trans.input_length = 0;
78 eeprom->tx_buf[1] = (addr >> 8) & 0xff;
79 eeprom->tx_buf[2] = addr & 0xff;
82 eeprom->spi_trans.output_length = 3;
83 eeprom->spi_trans.input_length = length + 3;
97 eeprom->data_available =
true;
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.
#define E25_OUT_BUFFER_LEN
Output buffer length.
enum SPIStatus status
internal state of the peripheral
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.