enum SPIClockPolarity cpol
clock polarity control
enum SPIClockPhase cpha
clock phase control
enum SPISlaveSelect select
slave selection behavior
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.
void(* SPICallback)(struct spi_transaction *trans)
SPI Callback function.
@ SPICpolIdleLow
CPOL = 0.
@ SPISelectUnselect
slave is selected before transaction and unselected after
SPI peripheral structure.
void sst25vfxxxx_write(struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length)
Write bytes.
void sst25vfxxxx_block_write_en(struct SST25VFxxxx *sst)
Enable block writing.
void sst25vfxxxx_read_id(struct SST25VFxxxx *sst)
Read the chip identifier.
void sst25vfxxxx_read(struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length)
Read bytes Need 5 more extra bytes because of SPI overhead.
void sst25vfxxxx_init(struct SST25VFxxxx *sst, struct spi_periph *spi_p, const uint8_t slave_idx, SPICallback spi_cb)
Initializing the sst25vfxxxx chip.
void sst25vfxxxx_chip_erase(struct SST25VFxxxx *sst)
Full chip erase.
void sst25vfxxxx_after_cb(struct SST25VFxxxx *sst)
Callback of the SPI after going one level higher for gathering the sst pointer.
Driver for the SST25Vxxxx flash chips.
@ SST25VFXXXX_READ_ID
The chip is busy with getting the chip ID.
@ SST25VFXXXX_READ_BYTES
The chip is busy reading bytes.
@ SST25VFXXXX_WRITE_BYTES
The chip is busy writing bytes.
@ SST25VFXXXX_CHIP_ERASE
The chip is busy erasing itself.
@ SST25VFXXXX_IDLE
The chip is idle and can be used.
@ SST25VFXXXX_WRITE_EN
The chip is busy enabeling writing to blocks.
uint8_t transfer_idx
The transfer idx is used for counting input/output bytes.
#define SST25VFXXXX_AAI_PROG
uint32_t flash_addr
The flash address to write at.
uint8_t output_buf[16]
The output buffer for the SPI transaction.
#define SST25VFXXXX_HGIH_SPEAD_READ
struct spi_transaction spi_t
The SPI transaction used for the writing and reading of registers.
uint8_t transfer_length
The transfer buffer length.
uint8_t * transfer_buf
The transfer buffer.
uint8_t input_buf[16]
The input buffer for the SPI transaction.
#define SST25VFXXXX_ERASE_CHIP
uint8_t status_idx
The counter of substatuses.
enum SST25VFxxxxStatus status
The status of the SST25VFxxxx flash chip.
#define SST25VFXXXX_BYTE_PROG
struct spi_periph * spi_p
The SPI peripheral for the connection.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.