Infineon Logo AIROC BTSDK v4.7 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wiced_hal_pspi.h File Reference

List of parameters and defined functions needed to access the Peripheral SPI driver. More...

Typedefs

typedef enum SPI_MODE SPI_MODE
 Clock polarity and phase If CPOL=0, base value of the clock is zero If CPOL=1, base value of the clock is one If CPHA=0, sample on leading (first) clock edge If CPHA=1, sample on trailing (second) clock edge.
 
typedef enum SPI_SS_POLARITY SPI_SS_POLARITY
 Slave select polarity (output from master)
 
typedef enum SPI_ENDIAN SPI_ENDIAN
 SPI Endian: Direction of bit data flow (MSB or LSB first).
 
typedef enum SPI_SS_MODE SPI_SS_MODE
 For all the available GPIO config combinations (spiGpioCfg) for master and slave modes, please reference the Kit Guide or HW User Manual for your device, since the values vary by hardware platform. More...
 

Enumerations

enum  spi_interface_t { SPI1 = 0, SPI2 }
 Type Definitions. More...
 
enum  { SPI_MASTER = 1, SPI_SLAVE = 2 }
 SPI Device Role. More...
 
enum  SPI_MODE { SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3 }
 Clock polarity and phase If CPOL=0, base value of the clock is zero If CPOL=1, base value of the clock is one If CPHA=0, sample on leading (first) clock edge If CPHA=1, sample on trailing (second) clock edge. More...
 
enum  SPI_SS_POLARITY { SPI_SS_ACTIVE_LOW, SPI_SS_ACTIVE_HIGH }
 Slave select polarity (output from master) More...
 
enum  SPI_ENDIAN { SPI_MSB_FIRST, SPI_LSB_FIRST }
 SPI Endian: Direction of bit data flow (MSB or LSB first). More...
 
enum  SPI_SS_MODE { SPI_SS_NORMAL, SPI_SS_INACTIVE_BTW_BYTES }
 For all the available GPIO config combinations (spiGpioCfg) for master and slave modes, please reference the Kit Guide or HW User Manual for your device, since the values vary by hardware platform. More...
 
enum  { INPUT_PIN_PULL_UP = 0x0400, INPUT_PIN_PULL_DOWN = 0x0200, INPUT_PIN_FLOATING = 0x0 }
 
enum  SPIFFY_STATUS { SPIFFY_SUCCESS, SPIFFY_FAIL, SPIFFY_SLAVE_NOT_ENOUGH_RX_FIFO_BYTES }
 

Functions

void wiced_hal_pspi_init (spi_interface_t spi, uint32_t clkSpeed, SPI_ENDIAN endian, SPI_SS_POLARITY polarity, SPI_MODE mode)
 Initialize the SPI driver with the given parameters. More...
 
void wiced_hal_pspi_tx_data (spi_interface_t spi, uint32_t txLen, const uint8_t *txBuf)
 Send/transmit data over SPI as the master. More...
 
void wiced_hal_pspi_rx_data (spi_interface_t spi, uint32_t rxLen, uint8_t *rxBuf)
 Receive data over SPI as the master. More...
 
void wiced_hal_pspi_reset (spi_interface_t spi)
 Reset and bring the SPI driver to a known good state with default configuration. More...
 
void wiced_hal_pspi_exchange_data (spi_interface_t spi, uint32_t len, const uint8_t *txBuf, uint8_t *rxBuf)
 Transmit one buffer of data while simultaneously receiving data (as the master). More...
 
void wiced_hal_pspi_slave_enable_tx (spi_interface_t spi)
 Enable the tx fifo so any data in it will be transmitted when the SPI master clocks it out. More...
 
void wiced_hal_pspi_slave_disable_tx (spi_interface_t spi)
 Disable the tx fifo. More...
 
void wiced_hal_pspi_slave_enable_rx (spi_interface_t spi)
 Enable the rx fifo for incoming data when the SPI master clocks it in. More...
 
void wiced_hal_pspi_slave_disable_rx (spi_interface_t spi)
 Disable the rx fifo. More...
 
void wiced_hal_pspi_slave_tx_data (spi_interface_t spi, uint32_t txLen, const uint8_t *txBuf)
 Send/transmit data over SPI as a slave. More...
 
SPIFFY_STATUS wiced_hal_pspi_slave_rx_data (spi_interface_t spi, uint32_t rxLen, uint8_t *rxBuf)
 Receive data over SPI as a slave. More...
 
uint32_t wiced_hal_pspi_slave_get_tx_fifo_count (spi_interface_t spi)
 Get the number of bytes in the slave tx fifo. More...
 
uint32_t wiced_hal_pspi_slave_get_rx_fifo_count (spi_interface_t spi)
 Get the number of bytes in the slave rx fifo. More...
 

Detailed Description

List of parameters and defined functions needed to access the Peripheral SPI driver.