Skip to content

Commit 12abfea

Browse files
HaiLong Yanggmarull
authored andcommitted
scripts: add exclude-pincodes to af signal configs
This add 'exclude-pincodes' to af model signal-configs. For GD32L233, only the 'R' pincode have Segment LCD interface. 'exclude-pincodes' help to remove the invalid alternate function from other pincodes.
1 parent 2ebf5b0 commit 12abfea

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

pinconfigs/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ The AFIO model supports the following fields in the configuration file:
120120

121121
Available configuration fields are:
122122

123-
- `exclude-memories`: A lit of memories where the signal is not available. If
124-
not available, it is assumed that signal is available on all memories.
123+
- `exclude-pincodes` (optional): A list of pincodes where the signal is not
124+
available. If not defined, it is assumed that signal is available on all
125+
pin codes.
126+
127+
- `exclude-memories` (optional): A lit of memories where the signal is not
128+
available. If not available, it is assumed that signal is available on all
129+
memories.
125130

126131
- `pins` (required): Configuration for all pins.
127132

scripts/gd32pinctrl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,13 @@ def build_af_pin_cfgs(variant, signal_configs, pins):
240240
pin_cfgs["ANALOG"].append((port, pin_number, "ANALOG"))
241241

242242
for signal, mode in pin_cfg["afs"].items():
243-
# check if signal is excluded from current list of memories
244243
signal_config = signal_configs.get(signal)
244+
# check if signal is excluded from current pincode.
245+
if signal_config and pincode in signal_config.get(
246+
"exclude-pincodes", []
247+
):
248+
continue
249+
# check if signal is excluded from current list of memories
245250
if signal_config and set(memories).intersection(
246251
signal_config.get("exclude-memories", [])
247252
):

scripts/tests/gd32pinctrl/data/gd32f888x(0-1)xx-pinctrl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@
3737
GD32_PINMUX_AF('A', 2, AF8)
3838
#define PERIPH2_SIGA_PA3 \
3939
GD32_PINMUX_AF('A', 3, AF8)
40+
41+
/* PERIPH4_SIGA */
42+
#define PERIPH4_SIGA_PA2 \
43+
GD32_PINMUX_AF('A', 2, AF14)
44+
#define PERIPH4_SIGA_PA3 \
45+
GD32_PINMUX_AF('A', 3, AF15)

scripts/tests/gd32pinctrl/data/gd32f888xx.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ signal-configs:
1818
exclude-memories: [2, 3]
1919
PERIPH2_SIGB:
2020
exclude-memories: [2, 3]
21+
PERIPH3_SIGA:
22+
exclude-pincodes: [X]
23+
PERIPH4_SIGA:
24+
exclude-pincodes: [Y]
25+
exclude-memories: [2, 3]
2126

2227
pins:
2328
PA0:
@@ -34,8 +39,12 @@ pins:
3439
afs:
3540
PERIPH2_SIGA: 8
3641
PERIPH0_SIGA: 10
42+
PERIPH3_SIGA: 13
43+
PERIPH4_SIGA: 14
3744
PA3:
3845
pincodes: [X, Y]
3946
afs:
4047
PERIPH1_SIGB: 6
4148
PERIPH2_SIGA: 8
49+
PERIPH3_SIGA: 12
50+
PERIPH4_SIGA: 15

scripts/tests/gd32pinctrl/data/gd32f888y(0-1)xx-pinctrl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@
2525
GD32_PINMUX_AF('A', 2, AF8)
2626
#define PERIPH2_SIGA_PA3 \
2727
GD32_PINMUX_AF('A', 3, AF8)
28+
29+
/* PERIPH3_SIGA */
30+
#define PERIPH3_SIGA_PA2 \
31+
GD32_PINMUX_AF('A', 2, AF13)
32+
#define PERIPH3_SIGA_PA3 \
33+
GD32_PINMUX_AF('A', 3, AF12)

0 commit comments

Comments
 (0)