Skip to content

Commit 8f1cef0

Browse files
committed
Introduce all alternative pins per peripheral
- Alternate pins (PY_n_ALTx) - Dual pad pins (PY_n_C) - Remap pins (PY_n_ALTR) Signed-off-by: Frederic Pillon <[email protected]>
1 parent 2814522 commit 8f1cef0

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

cores/arduino/stm32/PinNames.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
extern "C" {
99
#endif
1010

11+
// Alternative possibilities which use other HW peripheral instances
12+
#define ALT0 0x100
13+
#define ALT1 0x200
14+
#define ALT2 0x300
15+
#define ALT3 0x400
16+
#define ALT4 0x500
17+
#define ALT5 0x600
18+
#define ALT6 0x700
19+
// Analog internal
20+
#define ALTA 0x1000
21+
// Dual pad pin
22+
#define ALTC 0x2000
23+
// Remap pin
24+
#define ALTR 0x3000
25+
// PinName mask
26+
#define PN_MASK 0xFF
27+
1128
typedef enum {
1229
// Not connected
1330
NC = (int)0xFFFFFFFF,
@@ -227,7 +244,7 @@ typedef enum {
227244
PZ_15 = (PortZ << 4) + 0x0F,
228245
#endif
229246
// Specific pin name
230-
PADC_BASE = 0x100,
247+
PADC_BASE = ALTA,
231248
#if defined(ADC_CHANNEL_TEMPSENSOR) || defined(ADC_CHANNEL_TEMPSENSOR_ADC1)
232249
PADC_TEMP,
233250
#endif

keywords.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,17 @@ PADC_TEMP LITERAL1
726726
PADC_VREF LITERAL1
727727
PADC_VBAT LITERAL1
728728

729+
ALT0 LITERAL1
730+
ALT1 LITERAL1
731+
ALT2 LITERAL1
732+
ALT3 LITERAL1
733+
ALT4 LITERAL1
734+
ALT5 LITERAL1
735+
ALT6 LITERAL1
736+
ALTA LITERAL1
737+
ALTC LITERAL1
738+
ALTR LITERAL1
739+
729740
# Port Name
730741
PortName KEYWORD3
731742
FirstPort

0 commit comments

Comments
 (0)