CC33XX API Documentation  2.30.00.15
Files | Functions
spi_adapt

This porting file provides the adaptation layer for the host SPI interface. More...

Files

file  spi_adapt.c
 spi_adapt porting file
 

Functions

uint32_t bytesToWord32s (uint32_t bytesLen)
 
int SPI_ReadSync (uint8_t *data, uint32_t length)
 Read SPI data as master. More...
 
int SPI_WriteSync (uint8_t *data, uint32_t length)
 Write SPI data as master. More...
 
void spiInit ()
 Initialize and open the SPI module. More...
 

Detailed Description

This porting file provides the adaptation layer for the host SPI interface.

Function Documentation

§ SPI_ReadSync()

int SPI_ReadSync ( uint8_t *  data,
uint32_t  length 
)

Read SPI data as master.

Parameters
data- buffer for output data
length- length in bytes to read
Returns
0: success, -1: failed
Note
Warning

§ SPI_WriteSync()

int SPI_WriteSync ( uint8_t *  data,
uint32_t  length 
)

Write SPI data as master.

Parameters
data- input buffer
length- length in bytes to read
Returns
0: success, -1: failed
Note
Warning

§ spiInit()

void spiInit ( )

Initialize and open the SPI module.

Parameters
data- input buffer
length- length in bytes to read
Returns
0: success, -1: failed
Note
  1. If initializing all the MCU drivers at the beginning of the application, this function can stay empty. This function is called in Wlan_Start and will stay initialized even if Wlan_Stop is called.
  2. The SPI interface must have the following parameters:
    • master
    • 4 pin mode SPI
    • chip select active low
    • polarity 0 phase 0
    • max frequency 40000000Hz
    • data block 32bits
Warning