Can I Use Directly The Macros Defined In Xx_Hal_Ppp.h ?; Where Must Ppp_Handletypedef Structure Peripheral Handler Be Declared?; When Should I Use Hal Versus Ll Drivers?; Is There Any Ll Apis Which Are Not Available With Hal? - ST STM32F2 User Manual

Description of stm32f2 hal and low layer drivers
Hide thumbs Also See for STM32F2:
Table of Contents

Advertisement

UM1940
FAQs

Can I use directly the macros defined in xx_hal_ppp.h ?

Yes, you can: a set of macros is provided with the APIs. They allow accessing directly
some specific features using peripheral flags.

Where must PPP_HandleTypedef structure peripheral handler be declared?

PPP_HandleTypedef structure peripheral handler must be declared as a global variable, so
that all the structure fields are set to 0 by default. In this way, the peripheral handler default
state are set to HAL_PPP_STATE_RESET, which is the default state for each peripheral
after a system reset.

When should I use HAL versus LL drivers?

HAL drivers offer high-level and function-oriented APIs, with a high level of portability.
Product/IPs complexity is hidden for end users. LL drivers offer low-level APIs at registers
level, with a better optimization but less portability. They require a deep knowledge of
product/IPs specifications.
How can I include LL drivers in my environment? Is there any LL
configuration file as for HAL?
There is no configuration file. Source code shall directly include the necessary
stm32f2xx_ll_ppp.h file(s).
Can I use HAL and LL drivers together? If yes, what are the constraints?
It is possible to use both HAL and LL drivers. One can handle the IP initialization phase
with HAL and then manage the I/O operations with LL drivers. The major difference
between HAL and LL is that HAL drivers require to create and use handles for operation
management while LL drivers operates directly on peripheral registers. Mixing HAL and LL
is illustrated in Examples_MIX example.

Is there any LL APIs which are not available with HAL?

Yes, there are. A few Cortex® APIs have been added in stm32f2xx_ll_cortex.h e.g. for
accessing SCB or SysTick registers.
Why are SysTick interrupts not enabled on LL drivers?
When using LL drivers in standalone mode, you do not need to enable SysTick interrupts
because they are not used in LL APIs, while HAL functions requires SysTick interrupts to
manage timeouts.
DocID028236 Rev 2
1369/1371

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF