HAL TIM Overview

Introducing TIM

group TIM_Introduction

  • This introduction is under development.

Module and files

The following diagram illustrates the TIM module and its associated files.

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the TIM module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.



@startuml

<style>

componentDiagram {

   arrow {

      FontSize 8

   }

}

</style>



title TIM Software Component Diagram



package "HAL" {

    [HAL_SERVICE (RCC, CORTEX, ...)]

    [HAL_TIM]

    [HAL_DMA]

}



package "Low Layer" {

    [LL_TIM]

    [CMSIS]

    [TIM Interrupt routine service]

    [DMA Interrupt routine service]

}



package "HW" {

    [STM32_HW]

}



[Appli] --> [HAL_TIM] : HAL TIM API

[Appli] <-- [HAL_TIM] : TIM callback

[HAL_TIM] --> [LL_TIM] : LL TIM API

[HAL_TIM] -l-> [CMSIS] : IS_TIM_<FEATURE>_INSTANCE

[HAL_TIM] -r-> [HAL_DMA] : HAL_DMA_StartDirectXfer_IT\nHAL_DMA_Abort_IT

[HAL_TIM] -l-> [HAL_SERVICE (RCC, CORTEX, ...)] : HAL_GetTick

[HAL_TIM] <-- [TIM Interrupt routine service]

[HAL_TIM] <-r- [HAL_DMA]:Half transfer complete\nTransfer complete\nError

[LL_TIM] --> [CMSIS]:TIM register def

[HAL_DMA] <-d- [DMA Interrupt routine service]

[STM32_HW] -u--> [TIM Interrupt routine service]: TIMx Irq

[STM32_HW] -u--> [DMA Interrupt routine service] : DMA Channel Irq

[STM32_HW] <-- [LL_TIM] : TIM registers R/W

@enduml

Configuration table

The following table lists the configuration defines for the HAL TIM module, specifying their locations, default values, and descriptions:

group TIM_Configuration_Table

Configuration inside the TIM driver

Config defines

Where

Default value

Note

USE_HAL_TIM_MODULE

hal_conf.h

1

HAL TIM module is enabled

USE_HAL_TIM_DMA

hal_conf.h

1

Enable the DMA code inside TIM

USE_HAL_TIM_REGISTER_CALLBACKS

hal_conf.h

0

Enable register callback feature

USE_HAL_TIM_CLK_ENABLE_MODEL

hal_conf.h

HAL_CLK_ENABLE_NO

Enable the gating of the peripheral clock

USE_HAL_CHECK_PARAM

hal_conf.h

0

Enable run time parameter check

USE_HAL_CHECK_PROCESS_STATE

hal_conf.h

0

Enable atomic access to process state check

USE_ASSERT_DBG_PARAM

PreProcessor env

NA

Enable the params assert

USE_ASSERT_DBG_STATE

PreProcessor env

NA

Enable the state assert

USE_HAL_TIM_GET_LAST_ERRORS

hal_conf.h

0

Enable retrieving the error codes

USE_HAL_TIM_USER_DATA

hal_conf.h

0

Add pointer for user data in HAL TIM handle