Infineon Logo AIROC BTSDK v4.2 - 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...

Macros

#define SPI_MSB_FIRST   WICED_SPI_MSB_FIRST
 Type Definitions for consistency.
 
#define SPI_SS_ACTIVE_LOW   WICED_SPI_SS_ACTIVE_LOW
 
#define SPI_MODE_0   WICED_SPI_MODE_0
 

Typedefs

typedef enum WICED_SPI_MODE WICED_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 WICED_SPI_SS_POLARITY WICED_SPI_SS_POLARITY
 Slave select polarity (output from master)
 
typedef enum WICED_SPI_ENDIAN WICED_SPI_ENDIAN
 SPI Endian: Direction of bit data flow (MSB or LSB first).
 
typedef enum WICED_SPI_SS_MODE WICED_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 }
 SPI Interfaces. More...
 
enum  { SPI_MASTER = 1, SPI_SLAVE = 2 }
 SPI Device Role. More...
 
enum  WICED_SPI_MODE { WICED_SPI_MODE_0, WICED_SPI_MODE_1, WICED_SPI_MODE_2, WICED_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  WICED_SPI_SS_POLARITY { WICED_SPI_SS_ACTIVE_LOW, WICED_SPI_SS_ACTIVE_HIGH }
 Slave select polarity (output from master) More...
 
enum  WICED_SPI_ENDIAN { WICED_SPI_MSB_FIRST, WICED_SPI_LSB_FIRST }
 SPI Endian: Direction of bit data flow (MSB or LSB first). More...
 
enum  WICED_SPI_SS_MODE { WICED_SPI_SS_NORMAL, WICED_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  { WICED_INPUT_PIN_PULL_UP = 0x0400, WICED_INPUT_PIN_PULL_DOWN = 0x0200, WICED_INPUT_PIN_FLOATING = 0x0 }
 
enum  WICED_SPIFFY_STATUS { WICED_SPIFFY_SUCCESS, WICED_SPIFFY_FAIL, WICED_SPIFFY_SLAVE_NOT_ENOUGH_RX_FIFO_BYTES }
 

Functions

void wiced_hal_pspi_init (spi_interface_t spi, uint32_t clkSpeed, WICED_SPI_ENDIAN endian, WICED_SPI_SS_POLARITY polarity, WICED_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...
 
WICED_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...
 
void wiced_hal_pspi_clear_rx_fifo (spi_interface_t spi)
 clear the rx fifo. More...
 

Detailed Description

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