Hi everybody,
passing from Roger Clark to STM32 cores I've noticed there is no structure analogue to PIN_MAP present in the last one.
My problem is to get the GPIO port of a given pin referred by his macro. For example I need to get the GPIO pointer of PA12 pin.
With Clarks library the pointer is PIN_MAP[PA12].gpio_device
Is in STM32 cores an analogue struct, macro or function to get the same result?
Any help very grateful Thank you
PIN_MAP in STM32 cores
Re: PIN_MAP in STM32 cores
The STM32 core is based on CMSIS.
So you can directly access to GPIO port register it by their name:
So you can directly access to GPIO port register it by their name:
Code: Select all
GPIOA->IDR
-
- Posts: 7
- Joined: Sun Jan 26, 2020 11:23 pm
Re: PIN_MAP in STM32 cores
I know,
but with maple I can do that:
I'm looking for something similiar with The STM32 core
Thank
but with maple I can do that:
Code: Select all
#define RS_PIN PA6
gpio_dev* RS_GPIO = PIN_MAP[RS_PIN].gpio_device;
...
//now I can use RS_GPIO that points to GPIOA (the port device of PA6 pin)
Thank
Re: PIN_MAP in STM32 cores
This implementation is not available in STM32 core.
What do you want achieve ?
Maybe this is you what you looking for:
This will return the GPIOA register pointer.
What do you want achieve ?
Maybe this is you what you looking for:
Code: Select all
digitalPinToPort(PA12);