The SPI driver validation settings are available in the DV_SPI_Config.h configuration file.
DV_SPI_Config.h configuration file in Configuration Wizard view mode
Some settings depend on the test environment and need to be changed for proper operation of the SPI driver validation.
Configuration settings
Driver_SPI# selects the driver instance that will be tested.
For example if we want to test Driver_SPI2
then this setting would be set to 2
.
Configuration section contains configuration of: Test Mode, SPI Server and Tests settings:
- Test Mode can be set to Loopback or SPI Server.
Loopback mode should be used for initial validation.
Loopback mode requires that MOSI and MISO pins are connected together thus driver validation can test basic functionality in the Master mode.
For full compliance of the SPI driver with the CMSIS-Driver SPI specification the SPI Server Test Mode has to be used.
- SPI Server settings are relevant if Test Mode: SPI Server is selected. These settings specify communication settings at which Driver Validation communicates with the SPI Server.
These settings must be same as configured on the SPI Server.
Settings available for the SPI Server are:
- Slave Select setting specifies the way that Slave Select line will be handled by the driver under test.
SPI Server requires that commands are exchanged with Slave Select line used, so driver being tested must support Slave Select line handling.
Software Controlled selection means that driver will use software controlled driving of the Slave Select line by calling driver Control
function with ARM_SPI_CONTROL_SS
control code to activate Slave Select Line before the transfer and deactivate it after the transfer.
Hardware Controlled selection means that driver will use hardware controlled driving of the Slave Select line.
- Clock / Frame Format setting specifies the clock or frame format used for command exchange with the SPI Server.
Both the SPI Server and the driver being tested must use the same clock / frame format setting.
- Data Bits setting specifies the number of data bits per item used for command exchange with the SPI Server.
Both the SPI Server and the driver being tested must use the same data bits setting.
- Bit Order setting specifies the bit order used for command exchange with the SPI Server.
Both the SPI Server and the driver being tested must use the same bit order setting.
- Bus Speed setting specifies the nominal bus speed used to exchange commands with the SPI Server.
This setting should be set to a speed guaranteeing reliable command exchange with the SPI Server.
- Tests settings specifies tests configuration:
- Default settings specifies the default settings used in the data exchange tests.
Usually, one feature is tested by executing the data exchange while all other parameters are used as default.
For details on which parameters are used as default in each test function please refer to Data Exchange functions documentation.
- Bus Speed settings specifies minimum and maximum bus speeds at which data transfer will be executed.
These settings are used by the SPI_Bus_Speed_Min and SPI_Bus_Speed_Max test functions.
- Number of Items settings specifies a few different number of items to be tested.
These settings are used by the SPI_Number_Of_Items test function which tests that odd and unusual number of items are transferred correctly according to the CMSIS-Driver specification.
Tests section contains selections of tests to be executed:
- Driver Management allows enabling or disabling of the whole driver management group of test functions.
Each test function in this group can be enabled or disabled individually, for details on tests performed by each test function please refer to Driver Management documentation.
- Data Exchange allows enabling or disabling of the whole data exchange group of test functions.
Each test function in this group can be enabled or disabled individually, for details on tests performed by each test function please refer to Data Exchange documentation.
- Error Event allows enabling or disabling of the whole error event group of test functions.
Each test function in this group can be enabled or disabled individually, for details on tests performed by each test function please refer to Error Event documentation.