Skip to content

Commit

Permalink
Add GPIO CMSIS-Driver Validation tests (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigaMahne authored Mar 6, 2024
1 parent 9d3b808 commit 41e49a1
Show file tree
Hide file tree
Showing 12 changed files with 969 additions and 1 deletion.
22 changes: 21 additions & 1 deletion ARM.CMSIS-Driver_Validation.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<releases>
<release version="0.0.0">
Active Development ...
- Add GPIO Driver validation
- Improve Ethernet driver validation
- Update examples
- Update documentation
Expand All @@ -17,7 +18,7 @@

<requirements>
<packages>
<package vendor="ARM" name="CMSIS" version="5.7.0-0"/>
<package vendor="ARM" name="CMSIS" version="6.0.0-0"/>
<package vendor="Keil" name="ARM_Compiler" version="1.6.2-0"/>
</packages>
</requirements>
Expand Down Expand Up @@ -57,6 +58,13 @@
<require Cclass="Compiler" Cgroup="I/O" Csub="STDOUT"/>
</condition>

<condition id="CMSIS Driver Validation GPIO">
<description>CMSIS Driver GPIO</description>
<require condition="CMSIS Core with RTOS and STDOUT"/>
<require Cclass="CMSIS Driver" Cgroup="GPIO" Capiversion="1.0.0"/>
<require Cclass="CMSIS Driver Validation" Cgroup="Framework"/>
</condition>

<condition id="CMSIS Driver Validation SPI">
<description>CMSIS Driver SPI</description>
<require condition="CMSIS Core with RTOS and STDOUT"/>
Expand Down Expand Up @@ -138,6 +146,18 @@
</files>
</component>

<component Cclass="CMSIS Driver Validation" Cgroup="GPIO" Cversion="1.0.0" condition="CMSIS Driver Validation GPIO">
<description>GPIO driver validation</description>
<RTE_Components_h>
#define RTE_CMSIS_DV_GPIO /* Driver Validation GPIO enabled */
</RTE_Components_h>
<files>
<file category="doc" name="Documentation/html/group__dv__gpio.html" />
<file category="header" name="Config/DV_GPIO_Config.h" attr="config" version = "1.0.0"/>
<file category="source" name="Source/DV_GPIO.c"/>
</files>
</component>

<component Cclass="CMSIS Driver Validation" Cgroup="SPI" Cversion="2.1.2" condition="CMSIS Driver Validation SPI">
<description>SPI driver validation</description>
<RTE_Components_h>
Expand Down
79 changes: 79 additions & 0 deletions Config/DV_GPIO_Config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright (c) 2023 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.0.0
*
* Project: CMSIS-Driver Validation
* Title: General-Purpose Input/Output (GPIO) driver validation
* configuration file
*
* -----------------------------------------------------------------------------
*/

#ifndef DV_GPIO_CONFIG_H_
#define DV_GPIO_CONFIG_H_

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

// <h> GPIO
// <i> General-Purpose Input/Output (GPIO) driver validation configuration
// <o0> Driver_GPIO# <0-255>
// <i> Choose the Driver_GPIO# instance to test.
// <i> For example to test Driver_GPIO0 select 0.
// <h> Configuration
// <i> Pins and Tests configuration.
// <o1> Pin Under Test <0-255>
// <i> Select pin to be tested.
// <i> This pin should not have any external resistors or any external devices connected to it.
// <o2> Auxiliary Pin
// <i> Select Auxiliary Pin with serial low resistance resistor connected to Pin Under Test.
// <i> Suggested resistance of this serial resistor is around 1 kOhm.
// <i> This pin should not have any external resistors or any external devices connected to it.
// </h>
// <h> Tests
// <i> Enable / disable tests.
// <q3> GPIO_Setup
// <i> Enable / disable Setup function tests.
// <q4> GPIO_SetDirection
// <i> Enable / disable SetDirection function tests.
// <q5> GPIO_SetOutputMode
// <i> Enable / disable SetOutputMode function tests.
// <q6> GPIO_SetPullResistor
// <i> Enable / disable SetPullResistor function tests.
// <q7> GPIO_SetEventTrigger
// <i> Enable / disable SetEventTrigger function tests.
// <q8> GPIO_SetOutput
// <i> Enable / disable SetOutput function tests.
// <q9> GPIO_GetInput
// <i> Enable / disable GetInput function tests.
// </h>
// </h>

#define DRV_GPIO 0
#define GPIO_CFG_PIN_UNDER_TEST 0
#define GPIO_CFG_PIN_AUX 0
#define GPIO_TC_SETUP_EN 1
#define GPIO_TC_SET_DIRECTION_EN 1
#define GPIO_TC_SET_OUTPUT_MODE_EN 1
#define GPIO_TC_SET_PULL_RESISTOR_EN 1
#define GPIO_TC_SET_EVENT_TRIGGER_EN 1
#define GPIO_TC_SET_OUTPUT_EN 1
#define GPIO_TC_GET_INPUT_EN 1

#endif /* DV_GPIO_CONFIG_H_ */
1 change: 1 addition & 0 deletions DoxyGen/CMSIS_DV.dxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ INPUT = ./src/DriverValidation.txt \
./src/DV_Framework.txt \
./src/DV_CAN.txt \
./src/DV_ETH.txt \
./src/DV_GPIO.txt \
./src/DV_I2C.txt \
./src/DV_MCI.txt \
./src/DV_SPI.txt \
Expand Down
25 changes: 25 additions & 0 deletions DoxyGen/src/DV_GPIO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\defgroup gpio_config Configuration
\ingroup dv_gpio

The GPIO driver validation settings are available in the <b>DV_GPIO_Config.h</b> configuration file.

\image html dv_gpio_config_h.png "DV_GPIO_Config.h configuration file in Configuration Wizard view mode"

\section gpio_config_detail Configuration settings

<b>Driver_GPIO#</b> selects the driver instance that will be tested.<br>
For example if we want to test <c>Driver_GPIO0</c> then this setting would be set to <c>0</c>.

<b>Configuration</b> section contains configuration of two pins:
- <b>Pin Under Test</b> specifying the pin that will be tested.<br>
- <b>Auxiliary Pin</b> specifies the auxiliary pin with serial low resistance resistor connected to Pin Under Test.
Suggested resistance of this serial resistor is around 1 kOhm.<br>

<b>Pins</b> should not have any external resistors or any external devices connected to it except the low resistance resistor used for testing.<br>

<b>Tests</b> section contains selections of tests to be executed.
For details on tests performed by each test function please refer to \ref gpio_tests "GPIO Tests".

*/
1 change: 1 addition & 0 deletions DoxyGen/src/DriverValidation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The diagram below shows an overview of the CMSIS-Driver Validation configuration
The CMSIS-Driver Validation provides validation for the following interfaces:
- \ref dv_can "CAN" - Controller Area Network (CAN) interface driver.
- \ref dv_eth "Ethernet" - Ethernet MAC and PHY peripheral interface driver.
- \ref dv_gpio "GPIO" - General Purpose Input-Output interface driver.
- \ref dv_i2c "I2C" - Inter-Integrated Circuit (I2C) multi-master serial single-ended bus interface driver.
- \ref dv_mci "MCI" - Memory Card Interface driver for SD/MMC memory.
- \ref dv_spi "SPI" - Serial Peripheral Interface (SPI) driver.
Expand Down
Binary file added DoxyGen/src/images/dv_gpio_config_h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DoxyGen/src/images/gpio_loopback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DoxyGen/src/images/src/GPIO_pin_connection.pptx
Binary file not shown.
8 changes: 8 additions & 0 deletions Include/cmsis_dv.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,12 @@ extern void WIFI_Concurrent_Socket (void);
extern void WIFI_Downstream_Rate (void);
extern void WIFI_Upstream_Rate (void);

extern void GPIO_Setup (void);
extern void GPIO_SetDirection (void);
extern void GPIO_SetOutputMode (void);
extern void GPIO_SetPullResistor (void);
extern void GPIO_SetEventTrigger (void);
extern void GPIO_SetOutput (void);
extern void GPIO_GetInput (void);

#endif /* __CMSIS_DV_H */
Loading

0 comments on commit 41e49a1

Please sign in to comment.