enum SPIClockPolarity cpol
clock polarity control
void sst25vfxxxx_read_id(struct SST25VFxxxx *sst)
Read the chip identifier.
#define SST25VFXXXX_HGIH_SPEAD_READ
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint16_t output_length
number of data words to write
uint8_t output_buf[16]
The output buffer for the SPI transaction.
The chip is busy with getting the chip ID.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
void(* SPICallback)(struct spi_transaction *trans)
SPI Callback function.
enum SPIBitOrder bitorder
MSB/LSB order.
#define SST25VFXXXX_BYTE_PROG
struct spi_periph * spi_p
The SPI peripheral for the connection.
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
struct spi_transaction spi_t
The SPI transaction used for the writing and reading of registers.
enum SPISlaveSelect select
slave selection behavior
enum SPIClockPhase cpha
clock phase control
SPI peripheral structure.
uint8_t transfer_idx
The transfer idx is used for counting input/output bytes.
Driver for the SST25Vxxxx flash chips.
The chip is busy reading bytes.
uint8_t * transfer_buf
The transfer buffer.
The chip is busy enabeling writing to blocks.
uint8_t status_idx
The counter of substatuses.
enum SST25VFxxxxStatus status
The status of the SST25VFxxxx flash chip.
SPICallback after_cb
NULL or function called after the transaction.
struct spi_periph * spi_p
The SPI peripheral for the connection.
The chip is busy writing bytes.
void sst25vfxxxx_init(struct SST25VFxxxx *sst, struct spi_periph *spi_p, const uint8_t slave_idx, SPICallback spi_cb)
Initializing the sst25vfxxxx chip.
The chip is idle and can be used.
The chip is busy erasing itself.
uint16_t input_length
number of data words to read
void sst25vfxxxx_write(struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length)
Write bytes.
uint32_t flash_addr
The flash address to write at.
slave is selected before transaction and unselected after
uint8_t input_buf[16]
The input buffer for the SPI transaction.
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
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.
uint8_t transfer_length
The transfer buffer length.
void sst25vfxxxx_chip_erase(struct SST25VFxxxx *sst)
Full chip erase.
#define SST25VFXXXX_AAI_PROG
void sst25vfxxxx_after_cb(struct SST25VFxxxx *sst)
Callback of the SPI after going one level higher for gathering the sst pointer.
void sst25vfxxxx_block_write_en(struct SST25VFxxxx *sst)
Enable block writing.
enum SPITransactionStatus status
#define SST25VFXXXX_ERASE_CHIP