cancel
Showing results for 
Search instead for 
Did you mean: 

identify register and bit naming in manual and the HAL function naming

Ricko
Senior II

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.

 

 

Ricko_0-1723036509498.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
Andrew Neil
Evangelist III

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 ...

TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".
Ricko
Senior II

Thank you both