2024-08-07 06:17 AM - last edited on 2024-08-07 06:22 AM by Andrew Neil
Hi,
a bit of a basic question... for years I used PIC micros so I was very familiar with their manuals, register and bit naming etc.But being new to STM32 I found it difficult to figure out an easy way to find the naming of registers and bits inside register (without having to read tens of pages every time)?
Both in the reference manual (RM0394) and also the related HAL function?
So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
Thank you as always.
Solved! Go to Solution.
2024-08-07 08:07 AM
> So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
CubeMX has a different naming scheme than the registers in the reference manual. It's not always a 1:1 correspondence, so this is not possible in general. The HAL source code is the best place to look, although you can also use the manual.
Naming of registers and bits within registers will be in the RM, and the naming convention of these within the CMSIS headers is very consistent with the RM.
2024-08-07 06:21 AM
Usually, the HAL definitions follow the RM.
Try a text search through the code.
Use one of the example projects, and see what it does - the register names are quite systematic so, once you've found one, the others should follow easily ...
2024-08-07 08:07 AM
> So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
CubeMX has a different naming scheme than the registers in the reference manual. It's not always a 1:1 correspondence, so this is not possible in general. The HAL source code is the best place to look, although you can also use the manual.
Naming of registers and bits within registers will be in the RM, and the naming convention of these within the CMSIS headers is very consistent with the RM.
2024-08-07 06:32 PM
Thank you both