LL UTILS Functions

Delay management

group LL_Utils_Delay

Functions

void LL_InitTick ( uint32_t cpuclk_frequency , uint32_t ticks )

This function configures the Cortex-M SysTick source of the time base.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_LOAD RELOAD LL_InitTick

SysTick_VAL CURRENT LL_InitTick

SysTick_CTRL CLKSOURCE LL_InitTick

SysTick_CTRL ENABLE LL_InitTick

Warning

When a RTOS is used, it is recommended to avoid changing the SysTick configuration by calling this function, for a delay use rather osDelay RTOS service.

Parameters :
  • cpuclk_frequency – CPU Clock frequency in Hz

  • ticks – ticks frequency (unit: Hz), must be > 0

void LL_Init1msTick ( uint32_t cpuclk_frequency )

This function configures the Cortex-M SysTick source to have 1ms time base.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_LOAD RELOAD LL_Init1msTick

SysTick_VAL CURRENT LL_Init1msTick

SysTick_CTRL CLKSOURCE LL_Init1msTick

SysTick_CTRL ENABLE LL_Init1msTick

Note

When a RTOS is used, it is recommended to avoid changing the Systick configuration by calling this function, for a delay use rather osDelay RTOS service.

Parameters :

cpuclk_frequency – CPU Clock frequency (unit: Hz)

void LL_Delay_NoISR ( uint32_t delay_ms )

This function provides delay (in milliseconds) based on SysTick counter flag.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_CTRL COUNTFLAG LL_Delay_NoISR

Note

Delay accuracy on requested value is [0; +1ms] due to uncertainty of initial SysTick counter value compared to reload value.

Note

To respect 1ms timebase, user must call LL_Init1msTick function which apply appropriate SysTick configuration.

Warning

When using an RTOS, it is recommended to avoid changing the Systick configuration by calling this function; rather, use the osDelay RTOS service for delays.

Parameters :

delay_ms – delay duration (unit: milliseconds)

Clock management

group LL_Utils_SystemClock

Functions

void LL_SetSystemCoreClock ( uint32_t cpuclk_frequency )

This function sets directly SystemCoreClock CMSIS variable.

Note

Variable can be calculated also through function “SystemCoreClockUpdate()”.

Parameters :

cpuclk_frequency – CPU Clock frequency (unit: Hz)