NHS31xx SW API
ssp: SSP Driver Example

Example application that demonstrates SSP master and slave functionality to send and receive data in both polling and interrupt modes using the SSP Driver.

Introduction
This SSP application serves as an example application to demonstrate how to make use of the SSP Driver. This application demonstrates the configuration of the SSP as Master and slave for sending and receiving data in both polling and interrupt modes. It also demonstrates the loopback mode.
The different functionalities demonstrated by the application are available as separate build configurations, namely:
  1. Debug - Debug build for Master rx/tx in loopback mode
  2. Debug_Master_Interrupt - Debug build for Master rx/tx in interrupt mode
  3. Debug_Slave_Interrupt - Debug build for Slave rx/tx in interrupt mode
  4. Debug_Master_Polling - Debug build for Master rx/tx in polling mode
  5. Debug_Slave_Polling - Debug build for Slave rx/tx in polling mode
How to setup
User can use two NHS demo boards for the example application. The SSP pins - PIO0_2, PIO0_6, PIO0_8 and PIO0_9 - of the two boards are to be connected back to back.
To evaluate this example, user can flash one of the boards with the master build and the other board with the slave build. Only one board and build is required for loopback mode.
User Interaction
Start the slave first and then the master. An external SSP monitor can be used to monitor the data transfer. In addition the RED LED on the board will be ON in case an error is encountered during the operation.
Use Case Description
The SSP application transfers 256 bytes (which are the numbers 0 to 255) from one end to the other. Receive buffer on each side is initialized with 0xAA before the transfer starts, which will then get overwritten by the actual received data.
Loopback Mode
Demonstrates the loopback mode. For this mode, POLLING_MODE has to be set to 0, SSP_MODE_TEST to 1 and LOOPBACK_TEST to 1
Master send/receive in Interrupt Mode
Demonstrates the sending and receiving of data as Master in Interrupt mode. For this mode, POLLING_MODE has to be set to 0, SSP_MODE_TEST to 1 and LOOPBACK_TEST to 0
Master send/receive in Polling Mode
Demonstrates the sending and receiving of data as Master in Polling mode. For this mode, POLLING_MODE has to be set to 1, SSP_MODE_TEST to 1 and LOOPBACK_TEST to 0
Slave send/receive in Interrupt Mode
Demonstrates the sending and receiving of data as Slave in Interrupt mode. For this mode, POLLING_MODE has to be set to 0, SSP_MODE_TEST to 0 and LOOPBACK_TEST to 0
Slave send/receive in Polling Mode
Demonstrates the sending and receiving of data as Slave in Polling mode. For this mode, POLLING_MODE has to be set to 1, SSP_MODE_TEST to 0 and LOOPBACK_TEST to 0