STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
stm32h7xx_hal_timebase_tim.c File Reference

HAL time base based on the hardware TIM. More...

#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_tim.h"
Include dependency graph for stm32h7xx_hal_timebase_tim.c:

Go to the source code of this file.

Functions

HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority)
 This function configures the TIM6 as a time base source.
void HAL_SuspendTick (void)
 Suspend Tick increment.
void HAL_ResumeTick (void)
 Resume Tick increment.

Variables

TIM_HandleTypeDef htim6

Detailed Description

HAL time base based on the hardware TIM.

Attention

Copyright (c) 2026 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32h7xx_hal_timebase_tim.c.

Function Documentation

◆ HAL_InitTick()

__weak HAL_StatusTypeDef HAL_InitTick ( uint32_t TickPriority)

This function configures the TIM6 as a time base source.

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 configured, by HAL_RCC_ClockConfig().
Parameters
TickPriorityTick interrupt priority.
Return values
HALstatus

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 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
TickPriorityTick interrupt priority.
Return values
HALstatus

Definition at line 41 of file stm32h7xx_hal_timebase_tim.c.

References __HAL_RCC_TIM6_CLK_ENABLE, __NVIC_PRIO_BITS, RCC_ClkInitTypeDef::APB1CLKDivider, HAL_ERROR, HAL_NVIC_EnableIRQ(), HAL_NVIC_SetPriority(), HAL_OK, HAL_RCC_GetClockConfig(), HAL_RCC_GetPCLK1Freq(), HAL_TIM_Base_Init(), HAL_TIM_Base_Start_IT(), htim6, RCC_HCLK_DIV1, TIM6, TIM6_DAC_IRQn, TIM_COUNTERMODE_UP, and uwTickPrio.

Referenced by HAL_Init(), and HAL_SetTickFreq().

Variable Documentation

◆ htim6