|
Hierodule 1.6.2
Utility module set for STM32 MCUs
|
Elements of the module that are not confined to the scope of the compilation unit. Perfectly corresponds to the module's header file, except the IRQ handlers. More...
Macros | |
| #define | HIERODULE_TIM_HANDLE_IRQ |
| Precompiler constant to toggle timer ISR management elements. | |
| #define | HIERODULE_TIM_RESERVED 0 |
| Precompiler constant to omit the IRQ implementation of a timer. | |
| #define | HIERODULE_TIM_CONVENIENT_IRQ |
| Precompiler constant to select timer ISR assignment routines. | |
Typedefs | |
| typedef void(* | FUNC_POINTER) (void) |
| Typedef as for an alias for the void function pointer. | |
Functions | |
| void | HIERODULE_TIM_SetPeriod (TIM_TypeDef *Timer, double DurationSec) |
| Sets the period duration of a timer. | |
| double | HIERODULE_TIM_GetPeriod (TIM_TypeDef *Timer) |
| Returns the period duration of a timer in seconds. | |
| void | HIERODULE_TIM_SetFrequency (TIM_TypeDef *Timer, double Frequency_Hz) |
| Sets the frequency of a timer. | |
| double | HIERODULE_TIM_GetFrequency (TIM_TypeDef *Timer) |
| Returns the frequency of a timer in Hertz. | |
| void | HIERODULE_TIM_ClearCounter (TIM_TypeDef *Timer) |
| Clears the counter register of a timer. | |
| void | HIERODULE_TIM_SetRepetition (TIM_TypeDef *Timer, uint32_t Reps) |
| Sets the additional period repetitions of a timer. | |
| uint32_t | HIERODULE_TIM_GetRepetition (TIM_TypeDef *Timer) |
| Returns the number of additional period repetitions of a timer. | |
| void | HIERODULE_TIM_EnableChannel (TIM_TypeDef *Timer, int8_t Channel) |
| Enables the PWM output channel of a timer. | |
| void | HIERODULE_TIM_DisableChannel (TIM_TypeDef *Timer, int8_t Channel) |
| Disables the PWM output channel of a timer. | |
| uint32_t | HIERODULE_TIM_IsEnabledChannel (TIM_TypeDef *Timer, int8_t Channel) |
| Checks the status of the PWM output channel of a timer. | |
| void | HIERODULE_TIM_EnableMainOutput (TIM_TypeDef *Timer) |
| Sets the main output enable bit in the break and dead time register of the timer. | |
| void | HIERODULE_TIM_DisableMainOutput (TIM_TypeDef *Timer) |
| Clears the main output enable bit in the break and dead time register of the timer. | |
| void | HIERODULE_TIM_SetDutyCycle (TIM_TypeDef *Timer, uint8_t Channel, double NormalizedDutyCycle) |
| Sets the duty cycle of the specified PWM output channel of a timer. | |
| double | HIERODULE_TIM_GetDutyCycle (TIM_TypeDef *Timer, uint8_t Channel) |
| Returns the duty cycle of the specified PWM output channel of a timer. | |
| void | HIERODULE_TIM_ClearFlag_UPD (TIM_TypeDef *Timer) |
| Clears the update interrupt flag of the timer. | |
| void | HIERODULE_TIM_ClearFlag_CC1 (TIM_TypeDef *Timer) |
| Clears the capture compare channel 1 interrupt flag of the timer. | |
| void | HIERODULE_TIM_ClearFlag_CC2 (TIM_TypeDef *Timer) |
| Clears the capture compare channel 2 interrupt flag of the timer. | |
| void | HIERODULE_TIM_ClearFlag_CC3 (TIM_TypeDef *Timer) |
| Clears the capture compare channel 3 interrupt flag of the timer. | |
| void | HIERODULE_TIM_ClearFlag_CC4 (TIM_TypeDef *Timer) |
| Clears the capture compare channel 4 interrupt flag of the timer. | |
| void | HIERODULE_TIM_ClearFlag_BRK (TIM_TypeDef *Timer) |
| Clears the break interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_UPD (TIM_TypeDef *Timer) |
| Checks the status of the update interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_CC1 (TIM_TypeDef *Timer) |
| Checks the status of the capture compare channel 1 interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_CC2 (TIM_TypeDef *Timer) |
| Checks the status of the capture compare channel 2 interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_CC3 (TIM_TypeDef *Timer) |
| Checks the status of the capture compare channel 3 interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_CC4 (TIM_TypeDef *Timer) |
| Checks the status of the capture compare channel 4 interrupt flag of the timer. | |
| uint32_t | HIERODULE_TIM_IsSetFlag_BRK (TIM_TypeDef *Timer) |
| Checks the status of the break interrupt flag of the timer. | |
| void | HIERODULE_TIM_Enable_IT_UPD (TIM_TypeDef *Timer) |
| Enables the update interrupt of the timer. | |
| void | HIERODULE_TIM_Enable_IT_CC1 (TIM_TypeDef *Timer) |
| Enables the capture compare channel 1 interrupt of the timer. | |
| void | HIERODULE_TIM_Enable_IT_CC2 (TIM_TypeDef *Timer) |
| Enables the capture compare channel 2 interrupt of the timer. | |
| void | HIERODULE_TIM_Enable_IT_CC3 (TIM_TypeDef *Timer) |
| Enables the capture compare channel 3 interrupt of the timer. | |
| void | HIERODULE_TIM_Enable_IT_CC4 (TIM_TypeDef *Timer) |
| Enables the capture compare channel 4 interrupt of the timer. | |
| void | HIERODULE_TIM_Enable_IT_BRK (TIM_TypeDef *Timer) |
| Enables the break interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_UPD (TIM_TypeDef *Timer) |
| Disables the update interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_CC1 (TIM_TypeDef *Timer) |
| Disables the capture compare channel 1 interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_CC2 (TIM_TypeDef *Timer) |
| Disables the capture compare channel 2 interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_CC3 (TIM_TypeDef *Timer) |
| Disables the capture compare channel 3 interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_CC4 (TIM_TypeDef *Timer) |
| Disables the capture compare channel 4 interrupt of the timer. | |
| void | HIERODULE_TIM_Disable_IT_BRK (TIM_TypeDef *Timer) |
| Disables the break interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_UPD (TIM_TypeDef *Timer) |
| Checks the update interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_CC1 (TIM_TypeDef *Timer) |
| Checks the capture compare channel 1 interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_CC2 (TIM_TypeDef *Timer) |
| Checks the capture compare channel 2 interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_CC3 (TIM_TypeDef *Timer) |
| Checks the capture compare channel 3 interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_CC4 (TIM_TypeDef *Timer) |
| Checks the capture compare channel 4 interrupt of the timer. | |
| uint32_t | HIERODULE_TIM_IsEnabled_IT_BRK (TIM_TypeDef *Timer) |
| Checks the break interrupt of the timer. | |
| void | HIERODULE_TIM_EnableAutomaticOutput (TIM_TypeDef *Timer) |
| Sets the automatic output enable bit in the break and dead time register of the timer. | |
| void | HIERODULE_TIM_DisableAutomaticOutput (TIM_TypeDef *Timer) |
| Clears the automatic output enable bit in the break and dead time register of the timer. | |
| void | HIERODULE_TIM_EnableCounter (TIM_TypeDef *Timer) |
| Enables the counter of a timer. | |
| void | HIERODULE_TIM_DisableCounter (TIM_TypeDef *Timer) |
| Disables the counter of a timer. | |
| uint32_t | HIERODULE_TIM_IsEnabledCounter (TIM_TypeDef *Timer) |
| Checks the status of the counter of a timer. | |
| void | HIERODULE_TIM_Assign_ISR_UPD (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the update interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_ISR_CC1 (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the capture compare channel 1 interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_ISR_CC2 (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the capture compare channel 2 interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_ISR_CC3 (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the capture compare channel 3 interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_ISR_CC4 (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the capture compare channel 4 interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_ISR_BRK (TIM_TypeDef *Timer, FUNC_POINTER ISR) |
| Assigns a function to the designated flag handler for the break interrupt of a timer. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined. | |
| void | HIERODULE_TIM_Assign_TIM1_CC_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 capture compare IRQ handler. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM2_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 2 IRQ handler. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM3_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 3 IRQ handler. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM4_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 4 IRQ handler. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_UP_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 update IRQ handler. Requires the device specific macro __STM32F103xB_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_BRK_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 break IRQ handler. Requires the device specific macro __STM32F103xB_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_UP_TIM10_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 update - timer 10 IRQ handler. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_BRK_TIM9_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 break - timer 9 IRQ handler. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM5_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 5 IRQ handler. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_TRG_COM_TIM11_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 trigger comm - timer 11 IRQ handler. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM1_BRK_UP_TRG_COM_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 1 break - update - trigger comm IRQ handler. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM14_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 14 IRQ handler. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM16_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 16 IRQ handler. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | HIERODULE_TIM_Assign_TIM17_ISR (FUNC_POINTER ISR) |
| Assigns a function to the timer 17 IRQ handler. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be NOT defined. | |
| void | TIM1_UP_IRQHandler (void) |
| Timer 1 update interrupt IRQ implementation. Requires the device specific macro __STM32F103xB_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1. | |
| void | TIM1_UP_TIM10_IRQHandler (void) |
| Timer 1 update interrupt - timer 10 IRQ implementation. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1 or 10. | |
| void | TIM1_CC_IRQHandler (void) |
| Timer 1 capture compare interrupt IRQ implementation. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1. | |
| void | TIM1_BRK_IRQHandler (void) |
| Timer 1 break interrupt IRQ implementation. Requires the device specific macro __STM32F103xB_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1. | |
| void | TIM1_BRK_TIM9_IRQHandler (void) |
| Timer 1 break interrupt - timer 9 IRQ implementation. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1 or 9. | |
| void | TIM1_BRK_UP_TRG_COM_IRQHandler (void) |
| Timer 1 break - update - trigger comm IRQ implementation. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1. | |
| void | TIM2_IRQHandler (void) |
| Timer 2 IRQ implementation. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 2. | |
| void | TIM3_IRQHandler (void) |
| Timer 3 IRQ implementation. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 3. | |
| void | TIM4_IRQHandler (void) |
| Timer 4 IRQ implementation. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 4. | |
| void | TIM5_IRQHandler (void) |
| Timer 5 IRQ implementation. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 5. | |
| void | TIM1_TRG_COM_TIM11_IRQHandler (void) |
| Timer 1 trigger comm interrupt - timer 11 IRQ implementation. Requires the device specific macro __STM32F401xC_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 1 or 11. | |
| void | TIM14_IRQHandler (void) |
| Timer 14 IRQ implementation. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 14. | |
| void | TIM16_IRQHandler (void) |
| Timer 16 IRQ implementation. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 16. | |
| void | TIM17_IRQHandler (void) |
| Timer 17 IRQ implementation. Requires the device specific macro __STM32F030x6_H to be defined. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIERODULE_TIM_RESERVED equals 17. | |
Consists of PWM output management and Timer interrupt handling routines, as well as a void function pointer alias typedef for convenience and a pair of precompiler constants to configure module behaviour.
Device-specific macro constants and type definitions are imported with an include directive to main.h, where the device driver headers are assumed to be included.
stdlib.h also included for abs.
| #define HIERODULE_TIM_CONVENIENT_IRQ |
When commented out, ISRs will be assigned per IRQ instead of per interrupt flag and the routine Check_IT will be omitted.
Requires HIERODULE_TIM_HANDLE_IRQ to be defined.
Definition at line 56 of file hierodule_tim.h.
| #define HIERODULE_TIM_HANDLE_IRQ |
When commented out, IRQ handler routines won't be defined in the source file.
Definition at line 39 of file hierodule_tim.h.
| #define HIERODULE_TIM_RESERVED 0 |
This is basically to reserve a timer for HAL timebase, when FreeRTOS uses SysTick.
When declared as 0, it will have no effect. When declared as n, TIMn IRQ won't be implemented.
Requires HIERODULE_TIM_HANDLE_IRQ to be defined.
Definition at line 48 of file hierodule_tim.h.
| typedef void(* FUNC_POINTER) (void) |
Used for convenience, really. It's used a lot, especially in the source file. It would be a clutter of asterisks and paranthesis otherwise.
Definition at line 66 of file hierodule_tim.h.
| void HIERODULE_TIM_Assign_ISR_BRK | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the break interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1337 of file hierodule_tim.c.
References BRK_Handler_TIM1, BRK_Handler_TIM17, and InfiniteLoopOfError().
| void HIERODULE_TIM_Assign_ISR_CC1 | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the capture compare channel 1 interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1158 of file hierodule_tim.c.
References CC1_Handler_TIM1, CC1_Handler_TIM10, CC1_Handler_TIM11, CC1_Handler_TIM14, CC1_Handler_TIM16, CC1_Handler_TIM17, CC1_Handler_TIM2, CC1_Handler_TIM3, CC1_Handler_TIM4, CC1_Handler_TIM5, CC1_Handler_TIM9, and InfiniteLoopOfError().
| void HIERODULE_TIM_Assign_ISR_CC2 | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the capture compare channel 2 interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1217 of file hierodule_tim.c.
References CC2_Handler_TIM1, CC2_Handler_TIM2, CC2_Handler_TIM3, CC2_Handler_TIM4, CC2_Handler_TIM5, CC2_Handler_TIM9, and InfiniteLoopOfError().
| void HIERODULE_TIM_Assign_ISR_CC3 | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the capture compare channel 3 interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1259 of file hierodule_tim.c.
References CC3_Handler_TIM1, CC3_Handler_TIM2, CC3_Handler_TIM3, CC3_Handler_TIM4, CC3_Handler_TIM5, and InfiniteLoopOfError().
| void HIERODULE_TIM_Assign_ISR_CC4 | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the capture compare channel 4 interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1298 of file hierodule_tim.c.
References CC4_Handler_TIM1, CC4_Handler_TIM2, CC4_Handler_TIM3, CC4_Handler_TIM4, CC4_Handler_TIM5, and InfiniteLoopOfError().
| void HIERODULE_TIM_Assign_ISR_UPD | ( | TIM_TypeDef * | Timer, |
| FUNC_POINTER | ISR ) |
| Timer | Pointer to timer struct. |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Assigns the the ISR to the designated handler for Check_IT to use inside the IRQ if the selected timer indeed has the update interrupt flag, branches to InfiniteLoopOfError otherwise.
Definition at line 1099 of file hierodule_tim.c.
References InfiniteLoopOfError(), UPD_Handler_TIM1, UPD_Handler_TIM10, UPD_Handler_TIM11, UPD_Handler_TIM14, UPD_Handler_TIM16, UPD_Handler_TIM17, UPD_Handler_TIM2, UPD_Handler_TIM3, UPD_Handler_TIM4, UPD_Handler_TIM5, and UPD_Handler_TIM9.
| void HIERODULE_TIM_Assign_TIM14_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1452 of file hierodule_tim.c.
References TIM14_ISR.
| void HIERODULE_TIM_Assign_TIM16_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1459 of file hierodule_tim.c.
References TIM16_ISR.
| void HIERODULE_TIM_Assign_TIM17_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1466 of file hierodule_tim.c.
References TIM17_ISR.
| void HIERODULE_TIM_Assign_TIM1_BRK_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1405 of file hierodule_tim.c.
References TIM1_BRK_ISR.
| void HIERODULE_TIM_Assign_TIM1_BRK_TIM9_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1421 of file hierodule_tim.c.
References TIM1_BRK_TIM9_ISR.
| void HIERODULE_TIM_Assign_TIM1_BRK_UP_TRG_COM_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1445 of file hierodule_tim.c.
References TIM1_BRK_UP_TRG_COM_ISR.
| void HIERODULE_TIM_Assign_TIM1_CC_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1361 of file hierodule_tim.c.
References TIM1_CC_ISR.
| void HIERODULE_TIM_Assign_TIM1_TRG_COM_TIM11_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1435 of file hierodule_tim.c.
References TIM1_TRG_COM_TIM11_ISR.
| void HIERODULE_TIM_Assign_TIM1_UP_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1398 of file hierodule_tim.c.
References TIM1_UP_ISR.
| void HIERODULE_TIM_Assign_TIM1_UP_TIM10_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1414 of file hierodule_tim.c.
References TIM1_UP_TIM10_ISR.
| void HIERODULE_TIM_Assign_TIM2_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1370 of file hierodule_tim.c.
References TIM2_ISR.
| void HIERODULE_TIM_Assign_TIM3_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1379 of file hierodule_tim.c.
References TIM3_ISR.
| void HIERODULE_TIM_Assign_TIM4_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1388 of file hierodule_tim.c.
References TIM4_ISR.
| void HIERODULE_TIM_Assign_TIM5_ISR | ( | FUNC_POINTER | ISR | ) |
| ISR | Pointer to ISR, a void-parameter void-return function. |
Self-explanatory code, nothing to elaborate.
Definition at line 1428 of file hierodule_tim.c.
References TIM5_ISR.
| void HIERODULE_TIM_ClearCounter | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Self-explanatory code, nothing to elaborate.
Definition at line 693 of file hierodule_tim.c.
| void HIERODULE_TIM_ClearFlag_BRK | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Break interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 873 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_BRK(), TIM17_IRQHandler(), TIM1_BRK_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), and TIM1_BRK_UP_TRG_COM_IRQHandler().
| void HIERODULE_TIM_ClearFlag_CC1 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Capture compare channel 1 interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 845 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_CC1(), TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_ClearFlag_CC2 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Capture compare channel 2 interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 852 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_CC2(), TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_ClearFlag_CC3 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Capture compare channel 3 interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 859 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_CC3(), TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_ClearFlag_CC4 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Capture compare channel 4 interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 866 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_CC4(), TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_ClearFlag_UPD | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Update interrupt flag is cleared software-wise with the logical NOT of the flag's timer status register bitmask.
Definition at line 838 of file hierodule_tim.c.
Referenced by HIERODULE_TIM_Enable_IT_UPD(), TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_BRK_UP_TRG_COM_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_Disable_IT_BRK | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The break interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 1005 of file hierodule_tim.c.
| void HIERODULE_TIM_Disable_IT_CC1 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The capture compare channel 1 interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 977 of file hierodule_tim.c.
| void HIERODULE_TIM_Disable_IT_CC2 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The capture compare channel 2 interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 984 of file hierodule_tim.c.
| void HIERODULE_TIM_Disable_IT_CC3 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The capture compare channel 3 interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 991 of file hierodule_tim.c.
| void HIERODULE_TIM_Disable_IT_CC4 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The capture compare channel 4 interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 998 of file hierodule_tim.c.
| void HIERODULE_TIM_Disable_IT_UPD | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The update interrupt is disabled by clearing the enable bit in the timer control register.
Definition at line 970 of file hierodule_tim.c.
| void HIERODULE_TIM_DisableAutomaticOutput | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Note that this will only work if the timer has the automatic output enable bit in a break and dead time register.
Definition at line 1067 of file hierodule_tim.c.
| void HIERODULE_TIM_DisableChannel | ( | TIM_TypeDef * | Timer, |
| int8_t | Channel ) |
| Timer | Pointer to timer struct. |
| Channel | Integer to specify the channel, 1 to 4, negative for complimentary output channels. |
Fetches the bit mask of the selected channel from the array TimerChannel_EN and uses that to clear the designated CCER register bit.
Channel parameter is ensured to be a valid integer value beforehand to avoid failure.
Definition at line 737 of file hierodule_tim.c.
References TimerChannel_EN.
| void HIERODULE_TIM_DisableCounter | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Self-explanatory code, nothing to elaborate.
Definition at line 1081 of file hierodule_tim.c.
| void HIERODULE_TIM_DisableMainOutput | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Note that this will only work if the timer has the main output enable bit in a break and dead time register.
Definition at line 794 of file hierodule_tim.c.
| void HIERODULE_TIM_Enable_IT_BRK | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the break interrupt flag.
Definition at line 962 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_BRK().
| void HIERODULE_TIM_Enable_IT_CC1 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the capture compare channel 1 interrupt flag.
Definition at line 930 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_CC1().
| void HIERODULE_TIM_Enable_IT_CC2 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the capture compare channel 2 interrupt flag.
Definition at line 938 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_CC2().
| void HIERODULE_TIM_Enable_IT_CC3 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the capture compare channel 3 interrupt flag.
Definition at line 946 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_CC3().
| void HIERODULE_TIM_Enable_IT_CC4 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the capture compare channel 4 interrupt flag.
Definition at line 954 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_CC4().
| void HIERODULE_TIM_Enable_IT_UPD | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The enable bit in the timer control register is set after clearing the update interrupt flag.
Definition at line 922 of file hierodule_tim.c.
References HIERODULE_TIM_ClearFlag_UPD().
| void HIERODULE_TIM_EnableAutomaticOutput | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Note that this will only work if the timer has the automatic output enable bit in a break and dead time register.
Definition at line 1060 of file hierodule_tim.c.
| void HIERODULE_TIM_EnableChannel | ( | TIM_TypeDef * | Timer, |
| int8_t | Channel ) |
| Timer | Pointer to timer struct. |
| Channel | Integer to specify the channel, 1 to 4, negative for complimentary output channels. |
Fetches the bit mask of the selected channel from the array TimerChannel_EN and uses that to set the designated CCER register bit.
Channel parameter is ensured to be a valid integer value beforehand to avoid failure.
Definition at line 722 of file hierodule_tim.c.
References TimerChannel_EN.
| void HIERODULE_TIM_EnableCounter | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Self-explanatory code, nothing to elaborate.
Definition at line 1074 of file hierodule_tim.c.
| void HIERODULE_TIM_EnableMainOutput | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Note that this will only work if the timer has the main output enable bit in a break and dead time register.
Definition at line 787 of file hierodule_tim.c.
| double HIERODULE_TIM_GetDutyCycle | ( | TIM_TypeDef * | Timer, |
| uint8_t | Channel ) |
| Timer | Pointer to timer struct. |
| Channel | Integer to specify the channel, 1 to 4, negative for complimentary output channels. |
The duty cycle is simply calculated dividing ARR by CCR, the pointer to which is acquired with a call to ChannelSelector with the timer struct pointer and the corresponding element of the CCR variable offset array TimerChannel_CCR.
Channel parameter is ensured to be a valid integer value beforehand to avoid failure. In case of an invalid input, -1.0 is returned.
Definition at line 822 of file hierodule_tim.c.
References ChannelSelector(), and TimerChannel_CCR.
| double HIERODULE_TIM_GetFrequency | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The frequency is calculated on the fly using the ARR and base frequency. See GetBaseFreq for further info.
\(Frequency = Base Frequency / (ARR+1) \)
Definition at line 686 of file hierodule_tim.c.
References GetBaseFreq().
| double HIERODULE_TIM_GetPeriod | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
The period is calculated on the fly using the ARR and base frequency. See GetBaseFreq for further info.
\(Period = (ARR+1) / Base Frequency \)
Definition at line 669 of file hierodule_tim.c.
References GetBaseFreq().
| uint32_t HIERODULE_TIM_GetRepetition | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
Basically reads from the repetition counter register and returns the value.
Note that this will only work if the timer has the repetition counter register.
Definition at line 714 of file hierodule_tim.c.
| uint32_t HIERODULE_TIM_IsEnabled_IT_BRK | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
TIM_DIER_BIE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1052 of file hierodule_tim.c.
Referenced by TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), and TIM1_BRK_UP_TRG_COM_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabled_IT_CC1 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
TIM_DIER_CC1IE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1020 of file hierodule_tim.c.
Referenced by TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabled_IT_CC2 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
TIM_DIER_CC2IE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1028 of file hierodule_tim.c.
Referenced by TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabled_IT_CC3 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
TIM_DIER_CC3IE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1036 of file hierodule_tim.c.
Referenced by TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabled_IT_CC4 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
TIM_DIER_CC4IE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1044 of file hierodule_tim.c.
Referenced by TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabled_IT_UPD | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
UIE bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1012 of file hierodule_tim.c.
Referenced by TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_BRK_UP_TRG_COM_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsEnabledChannel | ( | TIM_TypeDef * | Timer, |
| int8_t | Channel ) |
| Timer | Pointer to timer struct. |
| Channel | Integer to specify the channel, 1 to 4, negative for complimentary output channels. |
Fetches the bit mask of the selected channel from the array TimerChannel_EN and uses that to check the designated CCER register bit. Returns 1 if so and 0 otherwise.
Channel parameter is ensured to be a valid integer value beforehand to avoid failure.
Definition at line 753 of file hierodule_tim.c.
References TimerChannel_EN.
| uint32_t HIERODULE_TIM_IsEnabledCounter | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
CEN bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 1088 of file hierodule_tim.c.
| uint32_t HIERODULE_TIM_IsSetFlag_BRK | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
BIF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 915 of file hierodule_tim.c.
Referenced by TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), and TIM1_BRK_UP_TRG_COM_IRQHandler().
| uint32_t HIERODULE_TIM_IsSetFlag_CC1 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
CC1IF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 887 of file hierodule_tim.c.
Referenced by TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsSetFlag_CC2 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
CC2IF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 894 of file hierodule_tim.c.
Referenced by TIM1_BRK_TIM9_IRQHandler(), TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsSetFlag_CC3 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
CC3IF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 901 of file hierodule_tim.c.
Referenced by TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsSetFlag_CC4 | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
CC4IF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 908 of file hierodule_tim.c.
Referenced by TIM1_CC_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| uint32_t HIERODULE_TIM_IsSetFlag_UPD | ( | TIM_TypeDef * | Timer | ) |
| Timer | Pointer to timer struct. |
UIF bit is isolated from the register with its bitmask and compared to the same bitmask instead of shifting since the amount of shift would depend on the bitmask.
Definition at line 880 of file hierodule_tim.c.
Referenced by TIM14_IRQHandler(), TIM16_IRQHandler(), TIM17_IRQHandler(), TIM1_BRK_TIM9_IRQHandler(), TIM1_BRK_UP_TRG_COM_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), and TIM5_IRQHandler().
| void HIERODULE_TIM_SetDutyCycle | ( | TIM_TypeDef * | Timer, |
| uint8_t | Channel, | ||
| double | NormalizedDutyCycle ) |
| Timer | Pointer to timer struct. |
| Channel | Integer to specify the channel, 1 to 4, negative for complimentary output channels. |
| NormalizedDutyCycle | Duty cycle percentage, normalized. |
Scaling ARR with the normalized duty cycle yields the value meant to be loaded to the designated CCR, the pointer to which is acquired with a call to ChannelSelector with the timer struct pointer and the corresponding element of the CCR variable offset array TimerChannel_CCR.
Channel parameter is ensured to be a valid integer value beforehand to avoid failure.
Definition at line 803 of file hierodule_tim.c.
References ChannelSelector(), and TimerChannel_CCR.
| void HIERODULE_TIM_SetFrequency | ( | TIM_TypeDef * | Timer, |
| double | Frequency_Hz ) |
| Timer | Pointer to timer struct. |
| Frequency_Hz | Frequency in Hertz. |
This is performed by updating ARR value while keeping PSC constant. PSC value and peripheral bus clock determine the base frequency. See GetBaseFreq for further info.
\(Frequency = Base Frequency / (ARR+1) \)
\(ARR = Base Frequency * Period - 1\)
Definition at line 678 of file hierodule_tim.c.
References GetBaseFreq().
| void HIERODULE_TIM_SetPeriod | ( | TIM_TypeDef * | Timer, |
| double | DurationSec ) |
| Timer | Pointer to timer struct. |
| DurationSec | Duration of period in seconds. |
This is performed by updating ARR value while keeping PSC constant. PSC value and peripheral bus clock determine the base frequency. See GetBaseFreq for further info.
\(Period = (ARR+1) / Base Frequency \)
\(ARR = Base Frequency * Period - 1\)
Definition at line 661 of file hierodule_tim.c.
References GetBaseFreq().
| void HIERODULE_TIM_SetRepetition | ( | TIM_TypeDef * | Timer, |
| uint32_t | Reps ) |
| Timer | Pointer to timer struct. |
| Reps | Number of repetitions. |
Timer's RCR value is set to the input parameter. The UPD interrupt of the timer will get triggered after 0+Reps periods.
Keep in mind repetition value the hardware supports may not be as high as 65535, even though it's a 32 bit register. See the device manual to verify the maximum amount of repetitions allowed.
Note that this will only work if the timer has the repetition counter register.
Definition at line 705 of file hierodule_tim.c.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1885 of file hierodule_tim.c.
References CC1_Handler_TIM14, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_UPD(), TIM14_ISR, and UPD_Handler_TIM14.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1915 of file hierodule_tim.c.
References CC1_Handler_TIM16, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_UPD(), TIM16_ISR, and UPD_Handler_TIM16.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1945 of file hierodule_tim.c.
References BRK_Handler_TIM17, CC1_Handler_TIM17, Check_IT(), HIERODULE_TIM_ClearFlag_BRK(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_BRK(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_BRK(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_UPD(), TIM17_ISR, and UPD_Handler_TIM17.
|
extern |
Performs a call to Check_IT for the break interrupt if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1585 of file hierodule_tim.c.
References BRK_Handler_TIM1, Check_IT(), HIERODULE_TIM_ClearFlag_BRK(), and TIM1_BRK_ISR.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1608 of file hierodule_tim.c.
References BRK_Handler_TIM1, CC1_Handler_TIM9, CC2_Handler_TIM9, Check_IT(), HIERODULE_TIM_ClearFlag_BRK(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_BRK(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_BRK(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_UPD(), TIM1_BRK_TIM9_ISR, and UPD_Handler_TIM9.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1647 of file hierodule_tim.c.
References BRK_Handler_TIM1, Check_IT(), HIERODULE_TIM_ClearFlag_BRK(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_BRK(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_BRK(), HIERODULE_TIM_IsSetFlag_UPD(), TIM1_BRK_UP_TRG_COM_ISR, and UPD_Handler_TIM1.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1545 of file hierodule_tim.c.
References CC1_Handler_TIM1, CC2_Handler_TIM1, CC3_Handler_TIM1, CC4_Handler_TIM1, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_CC3(), HIERODULE_TIM_ClearFlag_CC4(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_CC3(), HIERODULE_TIM_IsEnabled_IT_CC4(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_CC3(), HIERODULE_TIM_IsSetFlag_CC4(), and TIM1_CC_ISR.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1853 of file hierodule_tim.c.
References CC1_Handler_TIM11, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_UPD(), TIM1_TRG_COM_TIM11_ISR, and UPD_Handler_TIM11.
|
extern |
Performs a call to Check_IT for the update interrupt if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1486 of file hierodule_tim.c.
References Check_IT(), HIERODULE_TIM_ClearFlag_UPD(), TIM1_UP_ISR, and UPD_Handler_TIM1.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1510 of file hierodule_tim.c.
References CC1_Handler_TIM10, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_UPD(), TIM1_UP_TIM10_ISR, UPD_Handler_TIM1, and UPD_Handler_TIM10.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1680 of file hierodule_tim.c.
References CC1_Handler_TIM2, CC2_Handler_TIM2, CC3_Handler_TIM2, CC4_Handler_TIM2, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_CC3(), HIERODULE_TIM_ClearFlag_CC4(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_CC3(), HIERODULE_TIM_IsEnabled_IT_CC4(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_CC3(), HIERODULE_TIM_IsSetFlag_CC4(), HIERODULE_TIM_IsSetFlag_UPD(), TIM2_ISR, and UPD_Handler_TIM2.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1722 of file hierodule_tim.c.
References CC1_Handler_TIM3, CC2_Handler_TIM3, CC3_Handler_TIM3, CC4_Handler_TIM3, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_CC3(), HIERODULE_TIM_ClearFlag_CC4(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_CC3(), HIERODULE_TIM_IsEnabled_IT_CC4(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_CC3(), HIERODULE_TIM_IsSetFlag_CC4(), HIERODULE_TIM_IsSetFlag_UPD(), TIM3_ISR, and UPD_Handler_TIM3.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1766 of file hierodule_tim.c.
References CC1_Handler_TIM4, CC2_Handler_TIM4, CC3_Handler_TIM4, CC4_Handler_TIM4, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_CC3(), HIERODULE_TIM_ClearFlag_CC4(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_CC3(), HIERODULE_TIM_IsEnabled_IT_CC4(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_CC3(), HIERODULE_TIM_IsSetFlag_CC4(), HIERODULE_TIM_IsSetFlag_UPD(), TIM4_ISR, and UPD_Handler_TIM4.
|
extern |
Performs a call to Check_IT for each flag set with its interrupt enabled if HIERODULE_TIM_CONVENIENT_IRQ is enabled, uses the plain ISR handler implemented by the user otherwise.
Definition at line 1811 of file hierodule_tim.c.
References CC1_Handler_TIM5, CC2_Handler_TIM5, CC3_Handler_TIM5, CC4_Handler_TIM5, Check_IT(), HIERODULE_TIM_ClearFlag_CC1(), HIERODULE_TIM_ClearFlag_CC2(), HIERODULE_TIM_ClearFlag_CC3(), HIERODULE_TIM_ClearFlag_CC4(), HIERODULE_TIM_ClearFlag_UPD(), HIERODULE_TIM_IsEnabled_IT_CC1(), HIERODULE_TIM_IsEnabled_IT_CC2(), HIERODULE_TIM_IsEnabled_IT_CC3(), HIERODULE_TIM_IsEnabled_IT_CC4(), HIERODULE_TIM_IsEnabled_IT_UPD(), HIERODULE_TIM_IsSetFlag_CC1(), HIERODULE_TIM_IsSetFlag_CC2(), HIERODULE_TIM_IsSetFlag_CC3(), HIERODULE_TIM_IsSetFlag_CC4(), HIERODULE_TIM_IsSetFlag_UPD(), TIM5_ISR, and UPD_Handler_TIM5.