/* * Copyright (c) 2015-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ----------------------------------------------------------------------------- * * $Revision: V1.1.0 * * Project: CMSIS-Driver Validation * Title: Serial Peripheral Interface Bus (SPI) driver validation * configuration file * * ----------------------------------------------------------------------------- */ #ifndef DV_SPI_CONFIG_H_ #define DV_SPI_CONFIG_H_ //-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- // SPI // Serial Peripheral Interface Bus (SPI) driver validation configuration // Driver_SPI# <0-255> // Choose the Driver_SPI# instance to test. // For example to test Driver_SPI0 select 0. // Configuration // Test Mode, SPI Server and Tests configuration. // Test Mode // Select test mode: Loopback or SPI Server. // For Loopback test mode connect the MISO and MOSI lines directly. // Loopback test mode is used for basic driver functionality testing before using SPI Server test mode. // For SPI Server test mode connect: MISO, MOSI, SCK, SS and GND lines to the same lines on the SPI Server. // SPI Server test mode is used for extensive driver functionality testing. // <0=> Loopback // <1=> SPI Server // SPI Server // SPI Server configuration. // Specifies the communication settings at which Driver Validation communicates with the SPI Server. // Fixed settings: // Mode: Master // Clock / Frame Format: Clock Polarity 0, Clock Phase 0 // Data Bits: 8 // Bit Order: MSB to LSB // Slave Select // Select mode of driving Slave Select line. // <1=> Software Controlled // <2=> Hardware Controlled // Bus Speed <10000-1000000000> // Select bus speed setting (in bps) used by the SPI Server. // // Tests // Tests configuration // Default settings // Default settings used for tests. // Slave Select // Select default mode of driving Slave Select line in tests. // This setting is used for all tests except the Data Exchange: Mode tests. // <0=> Not used // <1=> Software Controlled // <2=> Hardware Controlled // Clock / Frame Format // Select default clock / frame format setting for tests. // This setting is used for all tests except the Data Exchange: Clock / Frame Format tests. // <0=> Clock Polarity 0, Clock Phase 0 // <1=> Clock Polarity 0, Clock Phase 1 // <2=> Clock Polarity 1, Clock Phase 0 // <3=> Clock Polarity 1, Clock Phase 1 // <4=> Texas Instruments Frame Format // <5=> National Semiconductor Microwire Frame Format // Data Bits <1-32> // Select default data bits setting for tests. // This setting is used for all tests except the Data Exchange: Data Bits tests. // Bit Order <0=> MSB to LSB <1=> LSB to MSB // Select default bit order setting for tests. // This setting is used for all tests except the Data Exchange: Bit Order tests. // Bus Speed <10000-1000000000> // Select default bus speed setting for tests. // This setting is used for all tests except the Data Exchange: Bus Speed tests. // Number of Items <1-1024> // Select default number of data items for tests. // This setting is used for all tests except the Data Exchange: Other: SPI_Number_Of_Items tests. // // Bus Speed // Bus speed tests configuration. // Minimum Bus Speed <10000-1000000000> // Select minimum bus speed setting (in bps). // This setting is used only in SPI_Bus_Speed_Min test function. // Maximum Bus Speed <10000-1000000000> // Select maximum bus speed setting (in bps). // This setting is used only in SPI_Bus_Speed_Max test function. // // Number of Items // Number of items test configuration. // This setting is used only in SPI_Number_Of_Items test function. // (Value 0 means setting is not used) // Number of Items 1 <0-1024> // Number of Items 2 <0-1024> // Number of Items 3 <0-1024> // Number of Items 4 <0-1024> // Number of Items 5 <0-1024> // // // // Tests // Enable / disable tests. // Driver Management // Enable / disable driver management tests (functions: GetVersion, GetCapabilities, Initialize, Uninitialize, PowerControl). // SPI_GetVersion // Enable / disable GetVersion function tests. // SPI_GetCapabilities // Enable / disable GetCapabilities function tests. // SPI_Initialize_Uninitialize // Enable / disable Initialize and Uninitialize functions tests. // SPI_PowerControl // Enable / disable PowerControl function tests. // // Data Exchange // Enable / disable data exchange tests (functions: Send, Receive, Transfer, GetDataCount, Control, GetStatus, SignalEvent). // Mode // Enable / disable SPI mode and Slave Select mode tests. // (for Loopback test mode only Master mode with Slave Select not used test is supported!) // SPI_Mode_Master_SS_Unused // Enable / disable data exchange in Master mode with Slave Select not used test. // SPI_Mode_Master_SS_Sw_Ctrl // Enable / disable data exchange in Master mode with Slave Select Software Controlled test. // SPI_Mode_Master_SS_Hw_Ctrl_Out // Enable / disable data exchange in Master mode with Slave Select Hardware Controlled Output test. // SPI_Mode_Master_SS_Hw_Mon_In // Enable / disable data exchange in Master mode with Slave Select Hardware Monitored Input test. // SPI_Mode_Slave_SS_Hw_Mon // Enable / disable data exchange in Slave mode with Slave Select Hardware Monitored test. // SPI_Mode_Slave_SS_Sw_Ctrl // Enable / disable data exchange in Slave mode with Slave Select Software Controlled test. // // Clock / Frame Format // Enable / disable clock / frame format tests. // (all of these tests are supported only in SPI Server test mode!) // SPI_Format_Clock_Pol0_Pha0 // Enable / disable data exchange with clock format: Polarity 0 / Phase 0 test. // SPI_Format_Clock_Pol0_Pha1 // Enable / disable data exchange with clock format: Polarity 0 / Phase 1 test. // SPI_Format_Clock_Pol1_Pha0 // Enable / disable data exchange with clock format: Polarity 1 / Phase 0 test. // SPI_Format_Clock_Pol1_Pha1 // Enable / disable data exchange with clock format: Polarity 1 / Phase 1 test. // SPI_Format_Frame_TI // Enable / disable data exchange with Texas Instruments frame format test. // SPI_Format_Frame_Microwire // Enable / disable data exchange with National Semiconductor Microwire frame format test. // // Data Bits // Enable / disable data bits tests. // (for Loopback test mode only: 8, 16, 24, and 32 data bit tests are supported!) // SPI_Data_Bits_1 // Enable / disable data exchange with 1 bit per frame test. // SPI_Data_Bits_2 // Enable / disable data exchange with 2 bits per frame test. // SPI_Data_Bits_3 // Enable / disable data exchange with 3 bits per frame test. // SPI_Data_Bits_4 // Enable / disable data exchange with 4 bits per frame test. // SPI_Data_Bits_5 // Enable / disable data exchange with 5 bits per frame test. // SPI_Data_Bits_6 // Enable / disable data exchange with 6 bits per frame test. // SPI_Data_Bits_7 // Enable / disable data exchange with 7 bits per frame test. // SPI_Data_Bits_8 // Enable / disable data exchange with 8 bits per frame test. // SPI_Data_Bits_9 // Enable / disable data exchange with 9 bits per frame test. // SPI_Data_Bits_10 // Enable / disable data exchange with 10 bits per frame test. // SPI_Data_Bits_11 // Enable / disable data exchange with 11 bits per frame test. // SPI_Data_Bits_12 // Enable / disable data exchange with 12 bits per frame test. // SPI_Data_Bits_13 // Enable / disable data exchange with 13 bits per frame test. // SPI_Data_Bits_14 // Enable / disable data exchange with 14 bits per frame test. // SPI_Data_Bits_15 // Enable / disable data exchange with 15 bits per frame test. // SPI_Data_Bits_16 // Enable / disable data exchange with 16 bits per frame test. // SPI_Data_Bits_17 // Enable / disable data exchange with 17 bits per frame test. // SPI_Data_Bits_18 // Enable / disable data exchange with 18 bits per frame test. // SPI_Data_Bits_19 // Enable / disable data exchange with 19 bits per frame test. // SPI_Data_Bits_20 // Enable / disable data exchange with 20 bits per frame test. // SPI_Data_Bits_21 // Enable / disable data exchange with 21 bits per frame test. // SPI_Data_Bits_22 // Enable / disable data exchange with 22 bits per frame test. // SPI_Data_Bits_23 // Enable / disable data exchange with 23 bits per frame test. // SPI_Data_Bits_24 // Enable / disable data exchange with 24 bits per frame test. // SPI_Data_Bits_25 // Enable / disable data exchange with 25 bits per frame test. // SPI_Data_Bits_26 // Enable / disable data exchange with 26 bits per frame test. // SPI_Data_Bits_27 // Enable / disable data exchange with 27 bits per frame test. // SPI_Data_Bits_28 // Enable / disable data exchange with 28 bits per frame test. // SPI_Data_Bits_29 // Enable / disable data exchange with 29 bits per frame test. // SPI_Data_Bits_30 // Enable / disable data exchange with 30 bits per frame test. // SPI_Data_Bits_31 // Enable / disable data exchange with 31 bits per frame test. // SPI_Data_Bits_32 // Enable / disable data exchange with 32 bits per frame test. // // Bit Order // Enable / disable bit order tests. // (all of these tests are supported only in SPI Server test mode!) // SPI_Bit_Order_MSB_LSB // Enable / disable data exchange with bit order from MSB to LSB test. // SPI_Bit_Order_LSB_MSB // Enable / disable data exchange with bit order from LSB to MSB test. // // Bus Speed // Enable / disable bus speeds tests. // SPI_Bus_Speed_Min // Enable / disable data exchange at minimum supported bus speed test. // SPI_Bus_Speed_Max // Enable / disable data exchange at maximum supported bus speed test. // // Other // Enable / disable other tests. // SPI_Number_Of_Items // Enable / disable data exchange with different number of data items test. // SPI_GetDataCount // Enable / disable GetDataCount count changing during data exchange test. // SPI_Abort // Enable / disable data exchange Abort test. // // // Event // Enable / disable event signaling tests (function: SignalEvent). // (all of these tests are supported only in SPI Server test mode!) // SPI_DataLost // Enable / disable ARM_SPI_EVENT_DATA_LOST event generation test. // SPI_ModeFault // Enable / disable ARM_SPI_EVENT_MODE_FAULT event generation test. // // // #define DRV_SPI 0 #define SPI_CFG_TEST_MODE 1 #define SPI_CFG_SRV_SS_MODE 1 #define SPI_CFG_SRV_BUS_SPEED 1000000 #define SPI_CFG_SRV_CMD_TOUT 100 #define SPI_CFG_DEF_SS_MODE 1 #define SPI_CFG_DEF_FORMAT 0 #define SPI_CFG_DEF_DATA_BITS 8 #define SPI_CFG_DEF_BIT_ORDER 0 #define SPI_CFG_DEF_BUS_SPEED 1000000 #define SPI_CFG_DEF_NUM 512 #define SPI_CFG_MIN_BUS_SPEED 1000000 #define SPI_CFG_MAX_BUS_SPEED 10000000 #define SPI_CFG_NUM1 1 #define SPI_CFG_NUM2 31 #define SPI_CFG_NUM3 65 #define SPI_CFG_NUM4 1023 #define SPI_CFG_NUM5 1024 #define SPI_CFG_XFER_TIMEOUT 100 #define SPI_TG_DRIVER_MANAGEMENT_EN 1 #define SPI_TC_GET_VERSION_EN 1 #define SPI_TC_GET_CAPABILITIES_EN 1 #define SPI_TC_INIT_UNINIT_EN 1 #define SPI_TC_POWER_CONTROL_EN 1 #define SPI_TG_DATA_EXCHANGE_EN 1 #define SPI_TG_MODE_EN 1 #define SPI_TC_MASTER_UNUSED_EN 1 #define SPI_TC_MASTER_SW_EN 1 #define SPI_TC_MASTER_HW_OUT_EN 1 #define SPI_TC_MASTER_HW_IN_EN 1 #define SPI_TC_SLAVE_HW_EN 1 #define SPI_TC_SLAVE_SW_EN 1 #define SPI_TG_FORMAT_EN 1 #define SPI_TC_FORMAT_POL0_PHA0_EN 1 #define SPI_TC_FORMAT_POL0_PHA1_EN 1 #define SPI_TC_FORMAT_POL1_PHA0_EN 1 #define SPI_TC_FORMAT_POL1_PHA1_EN 1 #define SPI_TC_FORMAT_TI_EN 1 #define SPI_TC_FORMAT_MICROWIRE_EN 0 #define SPI_TG_DATA_BIT_EN 1 #define SPI_TC_DATA_BIT_EN_MASK 0x00008080 #define SPI_TG_BIT_ORDER_EN 1 #define SPI_TC_BIT_ORDER_MSB_LSB_EN 1 #define SPI_TC_BIT_ORDER_LSB_MSB_EN 1 #define SPI_TG_BUS_SPEED_EN 1 #define SPI_TC_BUS_SPEED_MIN_EN 1 #define SPI_TC_BUS_SPEED_MAX_EN 1 #define SPI_TG_OTHER_EN 1 #define SPI_TC_NUMBER_OF_ITEMS_EN 1 #define SPI_TC_GET_DATA_COUNT_EN 1 #define SPI_TC_ABORT_EN 1 #define SPI_TG_EVENT_EN 1 #define SPI_TC_DATA_LOST_EN 1 #define SPI_TC_MODE_FAULT_EN 1 #endif /* DV_SPI_CONFIG_H_ */