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
(+) Enable/Disable Debug module during SLEEP mode
(+) Enable/Disable Debug module during STOP mode
(+) Enable/Disable Debug module during STANDBY mode
◆ HAL_IncTick()
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
-
◆ 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
-
396 uint32_t wait = Delay;
◆ HAL_GetTick()
__weak uint32_t HAL_GetTick |
( |
void |
| ) |
|
Provides 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
-
◆ HAL_GetTickPrio()
uint32_t HAL_GetTickPrio |
( |
void |
| ) |
|
This function returns a tick priority.
- Return values
-
◆ HAL_SetTickFreq()
Set new tick Freq.
- Return values
-
◆ HAL_GetTickFreq()
Return tick frequency.
- Return values
-
◆ HAL_SuspendTick()
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
-
422 SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;
◆ HAL_ResumeTick()
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
-
438 SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
◆ HAL_GetHalVersion()
uint32_t HAL_GetHalVersion |
( |
void |
| ) |
|
Returns the HAL revision.
- Return values
-
version | : 0xXYZR (8bits for each decimal, R for RC) |
◆ HAL_GetREVID()
uint32_t HAL_GetREVID |
( |
void |
| ) |
|
Returns the device revision identifier.
- Return values
-
Device | revision identifier |
456 return((DBGMCU->IDCODE) >> 16U);
◆ HAL_GetDEVID()
uint32_t HAL_GetDEVID |
( |
void |
| ) |
|
Returns the device identifier.
- Return values
-
◆ HAL_DBGMCU_EnableDBGSleepMode()
void HAL_DBGMCU_EnableDBGSleepMode |
( |
void |
| ) |
|
Enable the Debug Module during SLEEP mode.
- Return values
-
474 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
◆ HAL_DBGMCU_DisableDBGSleepMode()
void HAL_DBGMCU_DisableDBGSleepMode |
( |
void |
| ) |
|
Disable the Debug Module during SLEEP mode.
- Return values
-
483 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
◆ HAL_DBGMCU_EnableDBGStopMode()
void HAL_DBGMCU_EnableDBGStopMode |
( |
void |
| ) |
|
Enable the Debug Module during STOP mode.
- Return values
-
492 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
◆ HAL_DBGMCU_DisableDBGStopMode()
void HAL_DBGMCU_DisableDBGStopMode |
( |
void |
| ) |
|
Disable the Debug Module during STOP mode.
- Return values
-
501 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
◆ HAL_DBGMCU_EnableDBGStandbyMode()
void HAL_DBGMCU_EnableDBGStandbyMode |
( |
void |
| ) |
|
Enable the Debug Module during STANDBY mode.
- Return values
-
510 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
◆ HAL_DBGMCU_DisableDBGStandbyMode()
void HAL_DBGMCU_DisableDBGStandbyMode |
( |
void |
| ) |
|
Disable the Debug Module during STANDBY mode.
- Return values
-
519 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
◆ HAL_EnableCompensationCell()
void HAL_EnableCompensationCell |
( |
void |
| ) |
|
Enables the I/O Compensation Cell.
- Note
- The I/O compensation cell can be used only when the device supply voltage ranges from 2.4 to 3.6 V.
- Return values
-
◆ HAL_DisableCompensationCell()
void HAL_DisableCompensationCell |
( |
void |
| ) |
|
Power-down the I/O Compensation Cell.
- Note
- The I/O compensation cell can be used only when the device supply voltage ranges from 2.4 to 3.6 V.
- Return values
-
◆ HAL_GetUID()
void HAL_GetUID |
( |
uint32_t * |
UID | ) |
|
Return the unique device identifier (UID based on 96 bits)
- Parameters
-
UID | pointer to 3 words array. |
- Return values
-
551 UID[0] = (uint32_t)(READ_REG(*((uint32_t *)UID_BASE)));
552 UID[1] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
553 UID[2] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 8U))));