CC254x SPI Driver User Guide
This page will describe how to use the SPI ports on the CC254x to interface with an external MCU as a network processor. It will also describe how to update the existing SPI drivers to include support for all 4 of the SPI ports on the CC254x SoC(Currently only 2 SPI ports are implemented in V1.4.)
The SPI protocol consists of 4 lines – SCLK, DATA, MOSI and MISO. In this system consisting of SPI Master and SPI Slave, there is a requirement for handshake between the master and the slave. Hence, an SRDY pin is used. This is a GPIO input to the master. So, effectively the SPI uses 5 pins to communicate between SPI Master and Slave.
How to apply the patch
Download and unzip the patch to the V1.4 stack directory. File:CC254x SPI driver patch v1.4.zip If prompted, select yes to merge and copy and replace the files to the V1.4 stack directory.
Steps to test the patch
1.Open HostTestRelease project
2.Choose one of the SPI slave configurations in preprocessor definitions
3.Make sure SPI ports are interfaced correspondingly (see tables)
4.Test with another SPI Master
There are different configurations to use each of the 4 SPI ports as a slave on the CC254x. This is done by simply changing the HAL_UART_SPI preprocessor definitions.
- HAL_UART_SPI == 1
- HAL_UART_SPI == 2
- HAL_UART_SPI == 3
- HAL_UART_SPI == 4