Skip to content

Commit 0e91363

Browse files
committed
Increase Alternate Function "bitfield" size required by the F1
Signed-off-by: Frederic Pillon <[email protected]>
1 parent a94dd7c commit 0e91363

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cores/arduino/stm32/PinNamesTypes.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ extern "C" {
3838
* [3] Output Push-Pull / Open Drain (as in OTYPER reg)
3939
* [5:4] as in PUPDR reg: No Pull, Pull-up, Pull-Donc
4040
* [7:6] Reserved for speed config (as in OSPEEDR), but not used yet
41-
* [11:8] Alternate Num (as in AFRL/AFRG reg)
42-
* [16:12] Channel (Analog/Timer specific)
43-
* [17] Inverted (Analog/Timer specific)
44-
* [18] Analog ADC control - Only valid for specific families
45-
* [32:19] Reserved
41+
* [14:8] Alternate Num (as in AFRL/AFRG reg)
42+
* [19:15] Channel (Analog/Timer specific)
43+
* [20] Inverted (Analog/Timer specific)
44+
* [21] Analog ADC control - Only valid for specific families
45+
* [32:22] Reserved
4646
*/
4747

4848
#define STM_PIN_FUNCTION_MASK 0x07
@@ -61,20 +61,20 @@ extern "C" {
6161
#define STM_PIN_SPEED_SHIFT 6
6262
#define STM_PIN_SPEED_BITS (STM_PIN_SPEED_MASK << STM_PIN_SPEED_SHIFT)
6363

64-
#define STM_PIN_AFNUM_MASK 0x0F
64+
#define STM_PIN_AFNUM_MASK 0x7F
6565
#define STM_PIN_AFNUM_SHIFT 8
6666
#define STM_PIN_AFNUM_BITS (STM_PIN_AFNUM_MASK << STM_PIN_AFNUM_SHIFT)
6767

6868
#define STM_PIN_CHAN_MASK 0x1F
69-
#define STM_PIN_CHAN_SHIFT 12
69+
#define STM_PIN_CHAN_SHIFT 15
7070
#define STM_PIN_CHANNEL_BIT (STM_PIN_CHAN_MASK << STM_PIN_CHAN_SHIFT)
7171

7272
#define STM_PIN_INV_MASK 0x01
73-
#define STM_PIN_INV_SHIFT 17
73+
#define STM_PIN_INV_SHIFT 20
7474
#define STM_PIN_INV_BIT (STM_PIN_INV_MASK << STM_PIN_INV_SHIFT)
7575

7676
#define STM_PIN_AN_CTRL_MASK 0x01
77-
#define STM_PIN_AN_CTRL_SHIFT 18
77+
#define STM_PIN_AN_CTRL_SHIFT 21
7878
#define STM_PIN_ANALOG_CONTROL_BIT (STM_PIN_AN_CTRL_MASK << STM_PIN_AN_CTRL_SHIFT)
7979

8080
#define STM_PIN_FUNCTION(X) (((X) >> STM_PIN_FUNCTION_SHIFT) & STM_PIN_FUNCTION_MASK)

0 commit comments

Comments
 (0)