2021-08-03 06: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.
2021-08-03 06:45 AM
2021-08-03 06: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?
2021-08-03 06: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..
2021-08-03 06: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?
2021-08-03 06:45 AM
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