Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Initialization and de-initialization Functions

Initialization and de-initialization Functions
[HAL Exported Functions]

Initialization and de-initialization functions. More...

Functions

HAL_StatusTypeDef HAL_Init (void)
 This function configures the Flash prefetch, Configures time base source, NVIC and Low level hardware.
HAL_StatusTypeDef HAL_DeInit (void)
 This function de-Initializes common part of the HAL and stops the source of time base.
__weak void HAL_MspInit (void)
 Initializes the MSP.
__weak void HAL_MspDeInit (void)
 DeInitializes the MSP.
__weak HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority)
 This function configures the source of the time base.

Detailed Description

Initialization and de-initialization functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
   [..]  This section provides functions allowing to:
      (+) Initializes the Flash interface, the NVIC allocation and initial clock 
          configuration. It initializes the source of time base also when timeout 
          is needed and the backup domain when enabled.
      (+) de-Initializes common part of the HAL.
      (+) Configure The time base source to have 1ms time base with a dedicated 
          Tick interrupt priority. 
        (++) Systick timer is used by default as source of time base, but user 
             can eventually implement his proper time base source (a general purpose 
             timer for example or other time source), keeping in mind that Time base 
             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
             handled in milliseconds basis.
        (++) Time base configuration function (HAL_InitTick ()) is called automatically 
             at the beginning of the program after reset by HAL_Init() or at any time 
             when clock is configured, by HAL_RCC_ClockConfig(). 
        (++) Source of time base is configured  to generate interrupts at regular 
             time intervals. Care must be taken if HAL_Delay() is called from a 
             peripheral ISR process, the Tick interrupt line must have higher priority 
            (numerically lower) than the peripheral interrupt. Otherwise the caller 
            ISR process will be blocked. 
       (++) functions affecting time base configurations are declared as __Weak  
             to make  override possible  in case of other  implementations in user file.
 

Function Documentation

HAL_StatusTypeDef HAL_DeInit ( void   )

This function de-Initializes common part of the HAL and stops the source of time base.

Note:
This function is optional.
Return values:
HALstatus

Definition at line 190 of file stm32f1xx_hal.c.

HAL_StatusTypeDef HAL_Init ( void   )

This function configures the Flash prefetch, Configures time base source, NVIC and Low level hardware.

Note:
This function is called at the beginning of program after reset and before the clock configuration
The time base configuration is based on MSI clock when exiting from Reset. Once done, time base tick start incrementing. In the default implementation,Systick is used as source of time base. The tick variable is incremented each 1ms in its ISR.
Return values:
HALstatus

Definition at line 157 of file stm32f1xx_hal.c.

__weak 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 base with a dedicated Tick interrupt priority.

Note:
This function is called automatically at the beginning of program after reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig().
In the default implementation, SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Care must be taken if HAL_Delay() is called from a peripheral ISR process, The the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. The function is declared as __Weak to be overwritten in case of other implementation in user file.
Parameters:
TickPriority,:Tick interrupt priority.
Return values:
HALstatus

Definition at line 249 of file stm32f1xx_hal.c.

__weak void HAL_MspDeInit ( void   )

DeInitializes the MSP.

Return values:
None

Definition at line 226 of file stm32f1xx_hal.c.

__weak void HAL_MspInit ( void   )

Initializes the MSP.

Return values:
None

Definition at line 215 of file stm32f1xx_hal.c.