Skip to content

Commit 41e49a1

Browse files
authored
Add GPIO CMSIS-Driver Validation tests (#13)
1 parent 9d3b808 commit 41e49a1

12 files changed

Lines changed: 969 additions & 1 deletion

ARM.CMSIS-Driver_Validation.pdsc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<releases>
1010
<release version="0.0.0">
1111
Active Development ...
12+
- Add GPIO Driver validation
1213
- Improve Ethernet driver validation
1314
- Update examples
1415
- Update documentation
@@ -17,7 +18,7 @@
1718

1819
<requirements>
1920
<packages>
20-
<package vendor="ARM" name="CMSIS" version="5.7.0-0"/>
21+
<package vendor="ARM" name="CMSIS" version="6.0.0-0"/>
2122
<package vendor="Keil" name="ARM_Compiler" version="1.6.2-0"/>
2223
</packages>
2324
</requirements>
@@ -57,6 +58,13 @@
5758
<require Cclass="Compiler" Cgroup="I/O" Csub="STDOUT"/>
5859
</condition>
5960

61+
<condition id="CMSIS Driver Validation GPIO">
62+
<description>CMSIS Driver GPIO</description>
63+
<require condition="CMSIS Core with RTOS and STDOUT"/>
64+
<require Cclass="CMSIS Driver" Cgroup="GPIO" Capiversion="1.0.0"/>
65+
<require Cclass="CMSIS Driver Validation" Cgroup="Framework"/>
66+
</condition>
67+
6068
<condition id="CMSIS Driver Validation SPI">
6169
<description>CMSIS Driver SPI</description>
6270
<require condition="CMSIS Core with RTOS and STDOUT"/>
@@ -138,6 +146,18 @@
138146
</files>
139147
</component>
140148

149+
<component Cclass="CMSIS Driver Validation" Cgroup="GPIO" Cversion="1.0.0" condition="CMSIS Driver Validation GPIO">
150+
<description>GPIO driver validation</description>
151+
<RTE_Components_h>
152+
#define RTE_CMSIS_DV_GPIO /* Driver Validation GPIO enabled */
153+
</RTE_Components_h>
154+
<files>
155+
<file category="doc" name="Documentation/html/group__dv__gpio.html" />
156+
<file category="header" name="Config/DV_GPIO_Config.h" attr="config" version = "1.0.0"/>
157+
<file category="source" name="Source/DV_GPIO.c"/>
158+
</files>
159+
</component>
160+
141161
<component Cclass="CMSIS Driver Validation" Cgroup="SPI" Cversion="2.1.2" condition="CMSIS Driver Validation SPI">
142162
<description>SPI driver validation</description>
143163
<RTE_Components_h>

Config/DV_GPIO_Config.h

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (c) 2023 Arm Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* -----------------------------------------------------------------------------
19+
*
20+
* $Revision: V1.0.0
21+
*
22+
* Project: CMSIS-Driver Validation
23+
* Title: General-Purpose Input/Output (GPIO) driver validation
24+
* configuration file
25+
*
26+
* -----------------------------------------------------------------------------
27+
*/
28+
29+
#ifndef DV_GPIO_CONFIG_H_
30+
#define DV_GPIO_CONFIG_H_
31+
32+
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
33+
34+
// <h> GPIO
35+
// <i> General-Purpose Input/Output (GPIO) driver validation configuration
36+
// <o0> Driver_GPIO# <0-255>
37+
// <i> Choose the Driver_GPIO# instance to test.
38+
// <i> For example to test Driver_GPIO0 select 0.
39+
// <h> Configuration
40+
// <i> Pins and Tests configuration.
41+
// <o1> Pin Under Test <0-255>
42+
// <i> Select pin to be tested.
43+
// <i> This pin should not have any external resistors or any external devices connected to it.
44+
// <o2> Auxiliary Pin
45+
// <i> Select Auxiliary Pin with serial low resistance resistor connected to Pin Under Test.
46+
// <i> Suggested resistance of this serial resistor is around 1 kOhm.
47+
// <i> This pin should not have any external resistors or any external devices connected to it.
48+
// </h>
49+
// <h> Tests
50+
// <i> Enable / disable tests.
51+
// <q3> GPIO_Setup
52+
// <i> Enable / disable Setup function tests.
53+
// <q4> GPIO_SetDirection
54+
// <i> Enable / disable SetDirection function tests.
55+
// <q5> GPIO_SetOutputMode
56+
// <i> Enable / disable SetOutputMode function tests.
57+
// <q6> GPIO_SetPullResistor
58+
// <i> Enable / disable SetPullResistor function tests.
59+
// <q7> GPIO_SetEventTrigger
60+
// <i> Enable / disable SetEventTrigger function tests.
61+
// <q8> GPIO_SetOutput
62+
// <i> Enable / disable SetOutput function tests.
63+
// <q9> GPIO_GetInput
64+
// <i> Enable / disable GetInput function tests.
65+
// </h>
66+
// </h>
67+
68+
#define DRV_GPIO 0
69+
#define GPIO_CFG_PIN_UNDER_TEST 0
70+
#define GPIO_CFG_PIN_AUX 0
71+
#define GPIO_TC_SETUP_EN 1
72+
#define GPIO_TC_SET_DIRECTION_EN 1
73+
#define GPIO_TC_SET_OUTPUT_MODE_EN 1
74+
#define GPIO_TC_SET_PULL_RESISTOR_EN 1
75+
#define GPIO_TC_SET_EVENT_TRIGGER_EN 1
76+
#define GPIO_TC_SET_OUTPUT_EN 1
77+
#define GPIO_TC_GET_INPUT_EN 1
78+
79+
#endif /* DV_GPIO_CONFIG_H_ */

DoxyGen/CMSIS_DV.dxy.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ INPUT = ./src/DriverValidation.txt \
877877
./src/DV_Framework.txt \
878878
./src/DV_CAN.txt \
879879
./src/DV_ETH.txt \
880+
./src/DV_GPIO.txt \
880881
./src/DV_I2C.txt \
881882
./src/DV_MCI.txt \
882883
./src/DV_SPI.txt \

DoxyGen/src/DV_GPIO.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
2+
/**
3+
\defgroup gpio_config Configuration
4+
\ingroup dv_gpio
5+
6+
The GPIO driver validation settings are available in the <b>DV_GPIO_Config.h</b> configuration file.
7+
8+
\image html dv_gpio_config_h.png "DV_GPIO_Config.h configuration file in Configuration Wizard view mode"
9+
10+
\section gpio_config_detail Configuration settings
11+
12+
<b>Driver_GPIO#</b> selects the driver instance that will be tested.<br>
13+
For example if we want to test <c>Driver_GPIO0</c> then this setting would be set to <c>0</c>.
14+
15+
<b>Configuration</b> section contains configuration of two pins:
16+
- <b>Pin Under Test</b> specifying the pin that will be tested.<br>
17+
- <b>Auxiliary Pin</b> specifies the auxiliary pin with serial low resistance resistor connected to Pin Under Test.
18+
Suggested resistance of this serial resistor is around 1 kOhm.<br>
19+
20+
<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>
21+
22+
<b>Tests</b> section contains selections of tests to be executed.
23+
For details on tests performed by each test function please refer to \ref gpio_tests "GPIO Tests".
24+
25+
*/

DoxyGen/src/DriverValidation.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The diagram below shows an overview of the CMSIS-Driver Validation configuration
2929
The CMSIS-Driver Validation provides validation for the following interfaces:
3030
- \ref dv_can "CAN" - Controller Area Network (CAN) interface driver.
3131
- \ref dv_eth "Ethernet" - Ethernet MAC and PHY peripheral interface driver.
32+
- \ref dv_gpio "GPIO" - General Purpose Input-Output interface driver.
3233
- \ref dv_i2c "I2C" - Inter-Integrated Circuit (I2C) multi-master serial single-ended bus interface driver.
3334
- \ref dv_mci "MCI" - Memory Card Interface driver for SD/MMC memory.
3435
- \ref dv_spi "SPI" - Serial Peripheral Interface (SPI) driver.
14.8 KB
Loading
10.1 KB
Loading
880 KB
Binary file not shown.

Include/cmsis_dv.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,12 @@ extern void WIFI_Concurrent_Socket (void);
278278
extern void WIFI_Downstream_Rate (void);
279279
extern void WIFI_Upstream_Rate (void);
280280

281+
extern void GPIO_Setup (void);
282+
extern void GPIO_SetDirection (void);
283+
extern void GPIO_SetOutputMode (void);
284+
extern void GPIO_SetPullResistor (void);
285+
extern void GPIO_SetEventTrigger (void);
286+
extern void GPIO_SetOutput (void);
287+
extern void GPIO_GetInput (void);
288+
281289
#endif /* __CMSIS_DV_H */

0 commit comments

Comments
 (0)