This driver requires the STM32 device specific HAL and STM32CubeMX (CubeMX) initialization code generator. The driver instance is mapped to hardware as shown in the table below:
CMSIS Driver Instance | STM32 Hardware Resource |
---|---|
Driver_GPIO0 | PORTA .. PORTZ |
Pin Id | STM32 Hardware Resource |
---|---|
0 .. 15 | PORTA 0..15 |
16 .. 31 | PORTB 0..15 |
32 .. 47 | PORTC 0..15 |
48 .. 63 | PORTD 0..15 |
64 .. 79 | PORTE 0..15 |
80 .. 95 | PORTF 0..15 |
96 .. 111 | PORTG 0..15 |
112 .. 127 | PORTH 0..15 |
128 .. 143 | PORTI 0..15 |
144 .. 159 | PORTJ 0..15 |
160 .. 175 | PORTK 0..15 |
176 .. 191 | PORTM 0..15 |
192 .. 207 | PORTN 0..15 |
208 .. 223 | PORTO 0..15 |
224 .. 239 | PORTP 0..15 |
240 .. 255 | PORTZ 0..15 |
This driver has the following deviations from the CMSIS-Driver specification:
Conceptual deviations:
main.c
.Important
Pins requiring edge detection must be configured as such in CubeMX.
This driver requires the following configuration in CubeMX:
Notes
- configuration information in the file MX_Device.h file is based on CubeMX configuration.
- due to hardware limitations only one pin at the same port position can be configured with edge detection functionality (for example, for pins PC5 and PG5 only one can be selected for edge detection at one point in time).
Pin | Functionality |
---|---|
PG5 | GPIO_EXTI5 |
Under Categories: System Core select GPIO:
PG5 Configuration:
Pin Name | Signal on Pin | GPIO output.. | GPIO mode | GPIO Pull-up/Pull.. | User Label |
---|---|---|---|---|---|
PG5 | n/a | n/a | External Interrupt Mode with Rising edge.. | No pull-up and no.. | . |
Under Categories: System Core select NVIC:
Configuration:
NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
---|---|---|---|
EXTI line[9:5] interrupts | checked | 0 | 0 |
Enabled interrupt table | Select for.. | Generate Enable in.. | Generate IRQ h.. | Call HAL handler |
---|---|---|---|---|
EXTI line[9:5] interrupts | unchecked | checked | checked | checked |