Skip to main content
Visitor II
January 3, 2023
Solved

STM32L0 HAL status bit or a flag read from registers

  • January 3, 2023
  • 3 replies
  • 1702 views

Hello, there is a bullet in the STM32L0 HAL that escape me. On page 38 of UM1749 it is said:

"When a status bit or a flag is read from registers, it is composed of shifted values depending on the number of read values and of their size. In this case, the returned status width is 32 bits. Example : STATUS = XX | (YY << 16) or STATUS = XX | (YY << 8) | (YY << 16) | (YY << 24)".

Can someone give me a function/macro that implements it so I can look at its implementation?

Does anyone know what case "In this case" refers to?

Does anyone know what XX and YY refer to?

If someone can give me a concrete example, I would greatly appreciate it.

    This topic has been closed for replies.
    Best answer by Patrice LF

    Hello,

    To share with you that this bullet will be removed from now on in future User Manuals describing the STM32 HAL and low-layer drivers published per STM32 series.

    Regards

    3 replies

    Super User
    January 4, 2023

    IMO this bullet just means that some library APIs return combination of several hardware bit fields as one 32-bit value. Nothing more meaningful there.

    > Does anyone know what XX and YY refer to?

    Hard to tell. In the 1st part of the sentence they are unsigned 16-bit values. Then some nonsense.

    Technical Moderator
    February 10, 2023

    You are right @Pavel A.​ 

    There is no real implementation from what I am aware of in the HAL drivers.

    Technical Moderator
    February 17, 2023

    Hello,

    To share with you that this bullet will be removed from now on in future User Manuals describing the STM32 HAL and low-layer drivers published per STM32 series.

    Regards