Skip to content

Commit a63f0b0

Browse files
committed
[utest][pin] add pin loopback utest
1 parent ba3dcd5 commit a63f0b0

5 files changed

Lines changed: 422 additions & 0 deletions

File tree

Kconfig.utestcases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ menu "RT-Thread Utestcases"
1616
rsource "components/drivers/core/utest/Kconfig"
1717
rsource "components/drivers/audio/utest/Kconfig"
1818
rsource "components/drivers/ipc/utest/Kconfig"
19+
rsource "components/drivers/pin/utest/Kconfig"
1920
rsource "components/drivers/serial/utest/Kconfig"
2021
rsource "components/drivers/smp_call/utest/Kconfig"
2122
endmenu

components/drivers/pin/SConscript

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from building import *
23

34
group = []
@@ -21,4 +22,9 @@ if GetDepend(['RT_PIN_PL061']):
2122

2223
group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)
2324

25+
list = os.listdir(cwd)
26+
for item in list:
27+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
28+
group = group + SConscript(os.path.join(item, 'SConscript'))
29+
2430
Return('group')
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
menu "Pin Test"
2+
depends on RT_USING_PIN
3+
4+
config RT_UTEST_PIN
5+
bool "Pin Loopback Test"
6+
default n
7+
8+
if RT_UTEST_PIN
9+
10+
config RT_UTEST_PIN_OUT_NAME
11+
string "Output Pin Name for Pin Test"
12+
default ""
13+
help
14+
Optional hardware pin name, such as PA.0 or P0.12. Leave empty to
15+
use RT_UTEST_PIN_OUT_NUM.
16+
17+
config RT_UTEST_PIN_IN_NAME
18+
string "Input Pin Name for Pin Test"
19+
default ""
20+
help
21+
Optional hardware pin name, such as PA.1 or P0.13. Leave empty to
22+
use RT_UTEST_PIN_IN_NUM.
23+
24+
config RT_UTEST_PIN_OUT_NUM
25+
int "Output Pin Number for Pin Test"
26+
default -1
27+
28+
config RT_UTEST_PIN_IN_NUM
29+
int "Input Pin Number for Pin Test"
30+
default -1
31+
32+
config RT_UTEST_PIN_SETTLE_MS
33+
int "Settle Delay in Milliseconds"
34+
range 0 1000
35+
default 2
36+
37+
config RT_UTEST_PIN_IRQ_TIMEOUT_MS
38+
int "IRQ Timeout in Milliseconds"
39+
range 1 60000
40+
default 500
41+
42+
config RT_UTEST_PIN_IRQ
43+
bool "Pin IRQ Loopback Test"
44+
default y
45+
46+
endif
47+
48+
endmenu
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Import('rtconfig')
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = [cwd]
7+
8+
if GetDepend(['RT_UTEST_PIN']):
9+
src += Glob('*.c')
10+
11+
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_PIN'], CPPPATH = CPPPATH)
12+
13+
Return('group')

0 commit comments

Comments
 (0)