HAL Control functions.
More...
HAL Control functions.
===============================================================================
##### HAL Control functions #####
===============================================================================
[..] This section provides functions allowing to:
(+) Provide a tick value in millisecond
(+) Provide a blocking delay in millisecond
(+) Suspend the time base source interrupt
(+) Resume the time base source interrupt
(+) Get the HAL API driver version
(+) Get the device identifier
(+) Get the device revision identifier
◆ HAL_Delay()
__weak void HAL_Delay |
( |
uint32_t |
Delay | ) |
|
This function provides minimum delay (in milliseconds) based on variable incremented.
- Note
- In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals where uwTick is incremented.
-
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Parameters
-
Delay | specifies the delay time length, in milliseconds. |
- Return values
-
Definition at line 394 of file stm32l4xx_hal.c.
397 uint32_t wait = Delay;
400 if (wait < HAL_MAX_DELAY)
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
◆ HAL_GetDEVID()
uint32_t HAL_GetDEVID |
( |
void |
| ) |
|
Return the device identifier.
- Return values
-
Definition at line 464 of file stm32l4xx_hal.c.
466 return(DBGMCU->IDCODE & DBGMCU_IDCODE_DEV_ID);
◆ HAL_GetHalVersion()
uint32_t HAL_GetHalVersion |
( |
void |
| ) |
|
Return the HAL revision.
- Return values
-
version | : 0xXYZR (8bits for each decimal, R for RC) |
Definition at line 446 of file stm32l4xx_hal.c.
448 return STM32L4XX_HAL_VERSION;
◆ HAL_GetREVID()
uint32_t HAL_GetREVID |
( |
void |
| ) |
|
Return the device revision identifier.
- Return values
-
Device | revision identifier |
Definition at line 455 of file stm32l4xx_hal.c.
457 return((DBGMCU->IDCODE & DBGMCU_IDCODE_REV_ID) >> 16);
◆ HAL_GetTick()
__weak uint32_t HAL_GetTick |
( |
void |
| ) |
|
Provide a tick value in millisecond.
- Note
- This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values
-
Definition at line 337 of file stm32l4xx_hal.c.
◆ HAL_GetTickFreq()
uint32_t HAL_GetTickFreq |
( |
void |
| ) |
|
◆ HAL_GetTickPrio()
uint32_t HAL_GetTickPrio |
( |
void |
| ) |
|
This function returns a tick priority.
- Return values
-
Definition at line 346 of file stm32l4xx_hal.c.
◆ HAL_GetUIDw0()
uint32_t HAL_GetUIDw0 |
( |
void |
| ) |
|
Return the first word of the unique device identifier (UID based on 96 bits)
- Return values
-
Definition at line 473 of file stm32l4xx_hal.c.
475 return(READ_REG(*((uint32_t *)UID_BASE)));
◆ HAL_GetUIDw1()
uint32_t HAL_GetUIDw1 |
( |
void |
| ) |
|
Return the second word of the unique device identifier (UID based on 96 bits)
- Return values
-
Definition at line 482 of file stm32l4xx_hal.c.
484 return(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
◆ HAL_GetUIDw2()
uint32_t HAL_GetUIDw2 |
( |
void |
| ) |
|
Return the third word of the unique device identifier (UID based on 96 bits)
- Return values
-
Definition at line 491 of file stm32l4xx_hal.c.
493 return(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
◆ HAL_IncTick()
__weak void HAL_IncTick |
( |
void |
| ) |
|
This function is called to increment a global variable "uwTick" used as application time base.
- Note
- In the default implementation, this variable is incremented each 1ms in SysTick ISR.
-
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values
-
Definition at line 326 of file stm32l4xx_hal.c.
◆ HAL_ResumeTick()
__weak void HAL_ResumeTick |
( |
void |
| ) |
|
Resume Tick increment.
- Note
- In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once HAL_ResumeTick() is called, the SysTick interrupt will be enabled and so Tick increment is resumed.
-
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values
-
Definition at line 436 of file stm32l4xx_hal.c.
439 SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
◆ HAL_SetTickFreq()
HAL_StatusTypeDef HAL_SetTickFreq |
( |
uint32_t |
Freq | ) |
|
Set new tick Freq.
- Parameters
-
- Return values
-
Definition at line 356 of file stm32l4xx_hal.c.
358 HAL_StatusTypeDef status =
HAL_OK;
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
This function configures the source of the time base: The time source is configured to have 1ms time ...
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_SuspendTick()
__weak void HAL_SuspendTick |
( |
void |
| ) |
|
Suspend Tick increment.
- Note
- In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once HAL_SuspendTick() is called, the SysTick interrupt will be disabled and so Tick increment is suspended.
-
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values
-
Definition at line 420 of file stm32l4xx_hal.c.
423 SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;