Accessing GPIOA CRL and CRH registers using STM32 HAL libraries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:03 AM
Hey,
I was wondering how to interface GPIO port registers CRL and CRH with HAL libraries, as I don't see such an option and simple GPIOB->CRL line gives an error.
Here are the available selections:
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:45 AM
The STM32F4 doesn't have CRL/CRH registers in GPIO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:15 AM
CRL and CRH aren't GPIO registers on all chips. On chips that they are, you can access them just fine with GPIOx->CRL and GPIOx->CRH. What chip are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:27 AM
I'm using a STM32F446VET6 chip.
Might be off topic, but I'm trying to interface a TFT Screen which sends commands through data pins on a GPIO port. And looking through some examples, a writing direction needs to be set, and all libraries use the CRL and CRH registers. Although I have another problem, that my Data pins of the screen are not on the same port..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:30 AM
But as I understand, when selecting writing or reading direction from the screen, you set the pins to input or output mode, which I can do with HAL, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 6:45 AM
The STM32F4 doesn't have CRL/CRH registers in GPIO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-03 12:48 PM
> when selecting writing or reading direction from the screen, you set the pins to input or output mode
It's simpler in 'F4 (and all other STM32 family) than in 'F1 - simply write 0b00 or 0b01 into the bitfield respective to given pin in GPIOx_MODER.
> which I can do with HAL, right?
Sure, you can even click it in CubeMX (or so I think, I don't use Cube/CubeMX).
JW
