-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/stm32_common: unify gpio driver #6714
Conversation
Nice PR ! |
All stm32 cpu (except f1) are impacted. Some boards (LED mainly) are impacted. This checklist should help testing. I already checked the board I tested, I don't have any of the others.
|
#endif /* ndef DOXYGEN */ | ||
|
||
/** | ||
* @brief Available ports on the STM32F2 family |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now is not only for the STM32F2 :-)
Maybe is not a good idea to define all ports to all mcus since some do not have them available. The code would compile anyway (i.e. F0/L0 don't have E, G, H, I. F3 doesn't have G, H, I. L1 doesn't have I)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. It needs to be in the cpu specific periph_cpu.h file, because L1 port are not "sorted" in memory (port H base address is between port E and port F).
Then I moved back to each periph_cpu.h and went through each stm32xxxx.h file to check which port were defined. It should be OK now.
Tested on stm32f4discovery, nucleo-l053. UPDATE: retested with the latest changes and OK. |
Tested on stm32f3discovery and nucleo-f303 : OK |
Tested the nucleo-l1 and nucleo32-f303 : ok |
@@ -287,8 +287,7 @@ typedef struct | |||
__IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ | |||
__IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ | |||
__IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ | |||
__IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ | |||
__IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ | |||
__IO uint32_t BSRR; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice ! I was bored having to change it all the times in the CMSIS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
This PR is very useful. Thanks a lot for this.
please squash. |
a9082a6
to
c302b76
Compare
Squashed |
Let's wait for CI's opinion. I also think that we can skip the remaining boards, their cpu family has already been tested. |
And go! |
When taking a look at #6705, I realized the stm32 gpio drivers could be unified.
This PR unify them, except for stm32f1, which has a slightly different gpio peripheral.
I had to update the vendor header for some families.
Boards are also updated.
Tested on nucleo32-f042, nucleo-f091, nucleo-f401, nucleo144-f207 and nucleo144-f413 with examples/default (saul test), tests/periph_gpio and tests/leds