Skip to main content
Graduate II
August 7, 2024
Solved

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

  • August 7, 2024
  • 3 replies
  • 1144 views

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

 

    This topic has been closed for replies.
    Best answer by TDK

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

    3 replies

    Super User
    August 7, 2024

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

    TDKAnswer
    Super User
    August 7, 2024

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

    RickoAuthor
    Graduate II
    August 8, 2024

    Thank you both