28#ifdef HIERODULE_TIM_HANDLE_IRQ
29 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
44#elif ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
48static const uint32_t
APB1_DIV1 = (RCC_CFGR_PPRE1_DIV1>>RCC_CFGR_PPRE1_Pos);
53static const uint32_t
APB2_DIV1 = (RCC_CFGR_PPRE2_DIV1>>RCC_CFGR_PPRE2_Pos);
58#ifdef HIERODULE_TIM_HANDLE_IRQ
59 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
102 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
113 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
124 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
135 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
146 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
187 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
198 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
209 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
220 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
231 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
237 #ifdef __STM32F401xC_H
323 #elif defined __STM32F030x6_H
391 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
408 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
413 #ifdef __STM32F103xB_H
428 #elif defined __STM32F401xC_H
459 #elif defined __STM32F030x6_H
513 offsetof(TIM_TypeDef, CCR1),
514 offsetof(TIM_TypeDef, CCR2),
515 offsetof(TIM_TypeDef, CCR3),
516 offsetof(TIM_TypeDef, CCR4)
537 volatile uint32_t BaseFreq;
539 #ifdef __STM32F103xB_H
542 BaseFreq = (SystemCoreClock >>
543 APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos]);
545 if( (READ_REG(RCC->CFGR) & RCC_CFGR_PPRE1) !=
APB1_DIV1 )
552 BaseFreq = (SystemCoreClock >>
553 APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos]);
555 if( (READ_REG(RCC->CFGR) & RCC_CFGR_PPRE2) !=
APB2_DIV1 )
561 #elif defined __STM32F401xC_H
562 if(Timer != TIM1 && Timer != TIM9 && Timer != TIM10 && Timer != TIM11)
564 BaseFreq = (SystemCoreClock >>
565 APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos]);
567 if( (READ_REG(RCC->CFGR) & RCC_CFGR_PPRE1) !=
APB1_DIV1 )
574 BaseFreq = (SystemCoreClock >>
575 APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos]);
577 if( (READ_REG(RCC->CFGR) & RCC_CFGR_PPRE2) !=
APB2_DIV1 )
583 #elif defined __STM32F030x6_H
584 BaseFreq = (SystemCoreClock >>
585 APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE) >> RCC_CFGR_PPRE_Pos]);
593 BaseFreq /= (Timer->PSC+1);
606 return (uint32_t*)((
char*)Timer + (
size_t)ChannelOffset);
610#ifdef HIERODULE_TIM_HANDLE_IRQ
611 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
663 WRITE_REG(Timer->ARR,
GetBaseFreq(Timer)*DurationSec-1.0);
671 return ((
double)READ_REG(Timer->ARR)+1.0)/((double)
GetBaseFreq(Timer));
680 WRITE_REG(Timer->ARR,
GetBaseFreq(Timer)/Frequency_Hz-1.0);
688 return ((
double)
GetBaseFreq(Timer))/((double)(READ_REG(Timer->ARR)+1.0));
707 WRITE_REG(Timer->RCR, Reps);
716 return READ_REG(Timer->RCR);
724 if( (Channel > 0) && (Channel < 5) )
728 else if( (Channel < 0) && (Channel > -4) )
739 if( (Channel > 0) && (Channel < 5) )
743 else if( (Channel < 0) && (Channel > -4) )
755 if( (Channel > 0) && (Channel < 5) )
767 else if( (Channel < 0) && (Channel > -4) )
789 SET_BIT(Timer->BDTR, TIM_BDTR_MOE);
796 CLEAR_BIT(Timer->BDTR, TIM_BDTR_MOE);
807 double NormalizedDutyCycle
810 if( (Channel > 0) && (Channel < 5) )
813 ((uint32_t)(READ_REG(Timer->ARR)))*NormalizedDutyCycle;
824 if( (Channel < 1) && (Channel > 4) )
832 / ((double)(READ_REG(Timer->ARR)));
840 WRITE_REG(Timer->SR, ~(TIM_SR_UIF));
847 WRITE_REG(Timer->SR, ~(TIM_SR_CC1IF));
854 WRITE_REG(Timer->SR, ~(TIM_SR_CC2IF));
861 WRITE_REG(Timer->SR, ~(TIM_SR_CC3IF));
868 WRITE_REG(Timer->SR, ~(TIM_SR_CC4IF));
875 WRITE_REG(Timer->SR, ~(TIM_SR_BIF));
882 return ((READ_BIT(Timer->SR, TIM_SR_UIF) == (TIM_SR_UIF)) ? 1UL : 0UL);
889 return ((READ_BIT(Timer->SR, TIM_SR_CC1IF) == (TIM_SR_CC1IF)) ? 1UL : 0UL);
896 return ((READ_BIT(Timer->SR, TIM_SR_CC2IF) == (TIM_SR_CC2IF)) ? 1UL : 0UL);
903 return ((READ_BIT(Timer->SR, TIM_SR_CC3IF) == (TIM_SR_CC3IF)) ? 1UL : 0UL);
910 return ((READ_BIT(Timer->SR, TIM_SR_CC4IF) == (TIM_SR_CC4IF)) ? 1UL : 0UL);
917 return ((READ_BIT(Timer->SR, TIM_SR_BIF) == (TIM_SR_BIF)) ? 1UL : 0UL);
925 SET_BIT(Timer->DIER, TIM_DIER_UIE);
933 SET_BIT(Timer->DIER, TIM_DIER_CC1IE);
941 SET_BIT(Timer->DIER, TIM_DIER_CC2IE);
949 SET_BIT(Timer->DIER, TIM_DIER_CC3IE);
957 SET_BIT(Timer->DIER, TIM_DIER_CC4IE);
965 SET_BIT(Timer->DIER, TIM_DIER_BIE);
972 CLEAR_BIT(Timer->DIER, TIM_DIER_UIE);
979 CLEAR_BIT(Timer->DIER, TIM_DIER_CC1IE);
986 CLEAR_BIT(Timer->DIER, TIM_DIER_CC2IE);
993 CLEAR_BIT(Timer->DIER, TIM_DIER_CC3IE);
1000 CLEAR_BIT(Timer->DIER, TIM_DIER_CC4IE);
1007 CLEAR_BIT(Timer->DIER, TIM_DIER_BIE);
1014 return ((READ_BIT(Timer->DIER, TIM_DIER_UIE) == (TIM_DIER_UIE))
1022 return ((READ_BIT(Timer->DIER, TIM_DIER_CC1IE) == (TIM_DIER_CC1IE))
1030 return ((READ_BIT(Timer->DIER, TIM_DIER_CC2IE) == (TIM_DIER_CC2IE))
1038 return ((READ_BIT(Timer->DIER, TIM_DIER_CC3IE) == (TIM_DIER_CC3IE))
1046 return ((READ_BIT(Timer->DIER, TIM_DIER_CC4IE) == (TIM_DIER_CC4IE))
1054 return ((READ_BIT(Timer->DIER, TIM_DIER_BIE) == (TIM_DIER_BIE))
1062 SET_BIT(Timer->BDTR, TIM_BDTR_AOE);
1069 CLEAR_BIT(Timer->BDTR, TIM_BDTR_AOE);
1076 SET_BIT(Timer->CR1, TIM_CR1_CEN);
1083 CLEAR_BIT(Timer->CR1, TIM_CR1_CEN);
1090 return ((READ_BIT(Timer->CR1, TIM_CR1_CEN) == (TIM_CR1_CEN)) ? 1UL : 0UL);
1094#ifdef HIERODULE_TIM_HANDLE_IRQ
1096#ifdef HIERODULE_TIM_CONVENIENT_IRQ
1101 uint32_t TimerAddress = (uint32_t)Timer;
1103 switch(TimerAddress)
1105 case ( (uint32_t)TIM1 ):
1109 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1110 case ( (uint32_t)TIM2 ):
1115 case ( (uint32_t)TIM3 ):
1119 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1120 case ( (uint32_t)TIM4 ):
1125 #ifdef __STM32F401xC_H
1126 case ( (uint32_t)TIM5 ):
1129 case ( (uint32_t)TIM9 ):
1132 case ( (uint32_t)TIM10 ):
1135 case ( (uint32_t)TIM11 ):
1139 #elif defined __STM32F030x6_H
1140 case ( (uint32_t)TIM14 ):
1143 case ( (uint32_t)TIM16 ):
1146 case ( (uint32_t)TIM17 ):
1160 uint32_t TimerAddress = (uint32_t)Timer;
1162 switch(TimerAddress)
1164 case ( (uint32_t)TIM1 ):
1168 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1169 case ( (uint32_t)TIM2 ):
1174 case ( (uint32_t)TIM3 ):
1178 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1179 case ( (uint32_t)TIM4 ):
1184 #ifdef __STM32F401xC_H
1185 case ( (uint32_t)TIM5 ):
1188 case ( (uint32_t)TIM9 ):
1191 case ( (uint32_t)TIM10 ):
1194 case ( (uint32_t)TIM11 ):
1198 #elif defined __STM32F030x6_H
1199 case ( (uint32_t)TIM14 ):
1202 case ( (uint32_t)TIM16 ):
1205 case ( (uint32_t)TIM17 ):
1219 uint32_t TimerAddress = (uint32_t)Timer;
1221 switch(TimerAddress)
1223 case ( (uint32_t)TIM1 ):
1227 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1228 case ( (uint32_t)TIM2 ):
1233 case ( (uint32_t)TIM3 ):
1237 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1238 case ( (uint32_t)TIM4 ):
1243 #ifdef __STM32F401xC_H
1244 case ( (uint32_t)TIM5 ):
1247 case ( (uint32_t)TIM9 ):
1261 uint32_t TimerAddress = (uint32_t)Timer;
1263 switch(TimerAddress)
1265 case ( (uint32_t)TIM1 ):
1269 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1270 case ( (uint32_t)TIM2 ):
1275 case ( (uint32_t)TIM3 ):
1279 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1280 case ( (uint32_t)TIM4 ):
1285 #ifdef __STM32F401xC_H
1286 case ( (uint32_t)TIM5 ):
1300 uint32_t TimerAddress = (uint32_t)Timer;
1302 switch(TimerAddress)
1304 case ( (uint32_t)TIM1 ):
1308 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1309 case ( (uint32_t)TIM2 ):
1314 case ( (uint32_t)TIM3 ):
1318 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1319 case ( (uint32_t)TIM4 ):
1324 #ifdef __STM32F401xC_H
1325 case ( (uint32_t)TIM5 ):
1339 uint32_t TimerAddress = (uint32_t)Timer;
1341 switch(TimerAddress)
1343 case ( (uint32_t)TIM1 ):
1347 #ifdef __STM32F030x6_H
1348 case ( (uint32_t)TIM17 ):
1369 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1387 #if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1394 #ifdef __STM32F103xB_H
1410 #elif defined __STM32F401xC_H
1441 #elif defined __STM32F030x6_H
1476#ifdef __STM32F103xB_H
1485#if (HIERODULE_TIM_RESERVED != 1)
1489 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1500#elif defined __STM32F401xC_H
1509#if ( (HIERODULE_TIM_RESERVED != 1) && (HIERODULE_TIM_RESERVED != 10) )
1513 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1544#if (HIERODULE_TIM_RESERVED != 1)
1548 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1575#ifdef __STM32F103xB_H
1584#if (HIERODULE_TIM_RESERVED != 1)
1588 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1598#elif defined __STM32F401xC_H
1607#if ( (HIERODULE_TIM_RESERVED != 1) && (HIERODULE_TIM_RESERVED != 9) )
1611 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1637#elif defined __STM32F030x6_H
1646#if (HIERODULE_TIM_RESERVED != 1)
1650 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1677#if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1679#if (HIERODULE_TIM_RESERVED != 2)
1683 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1721#if (HIERODULE_TIM_RESERVED != 3)
1725 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1763#if ( (defined __STM32F103xB_H) || (defined __STM32F401xC_H) )
1765#if (HIERODULE_TIM_RESERVED != 4)
1769 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1801#ifdef __STM32F401xC_H
1810#if (HIERODULE_TIM_RESERVED != 5)
1814 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1852#if ( (HIERODULE_TIM_RESERVED != 1) && (HIERODULE_TIM_RESERVED != 11) )
1856 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1874#elif defined __STM32F030x6_H
1884#if (HIERODULE_TIM_RESERVED != 14)
1888 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1914#if (HIERODULE_TIM_RESERVED != 16)
1918 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
1944#if (HIERODULE_TIM_RESERVED != 17)
1948 #ifdef HIERODULE_TIM_CONVENIENT_IRQ
static void InfiniteLoopOfError(void)
Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Requires HIERODULE_TIM_CONVENIENT_IRQ to be defined.
static FUNC_POINTER CC3_Handler_TIM3
ISR handler for capture compare channel 3 interrupt flag of timer 3 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER TIM5_ISR
Pointer to the Timer 5 IRQ routine. Requires the device specific macro __STM32F401xC_H to be defined....
static FUNC_POINTER CC3_Handler_TIM5
ISR handler for capture compare channel 3 interrupt flag of timer 5 Requires the device specific macr...
static FUNC_POINTER UPD_Handler_TIM10
ISR handler for update interrupt flag of timer 10 Requires the device specific macro __STM32F401xC_H ...
static FUNC_POINTER CC1_Handler_TIM1
ISR handler for capture compare channel 1 interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER CC2_Handler_TIM9
ISR handler for capture compare channel 2 interrupt flag of timer 9 Requires the device specific macr...
static const uint32_t APB1_DIV1
Constant to check if non-unitary prescaling has been applied to advanced peripheral bus 1....
static FUNC_POINTER CC3_Handler_TIM1
ISR handler for capture compare channel 3 interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER TIM3_ISR
Pointer to the Timer 3 IRQ routine. Requires HIERODULE_TIM_HANDLE_IRQ to be defined....
static FUNC_POINTER UPD_Handler_TIM16
ISR handler for update interrupt flag of timer 16 Requires the device specific macro __STM32F030x6_H ...
static FUNC_POINTER TIM16_ISR
Pointer to the Timer 16 IRQ routine. Requires the device specific macro __STM32F030x6_H to be defined...
static FUNC_POINTER CC1_Handler_TIM5
ISR handler for capture compare channel 1 interrupt flag of timer 5 Requires the device specific macr...
static FUNC_POINTER CC4_Handler_TIM3
ISR handler for capture compare channel 4 interrupt flag of timer 3 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER CC1_Handler_TIM9
ISR handler for capture compare channel 1 interrupt flag of timer 9 Requires the device specific macr...
static FUNC_POINTER CC4_Handler_TIM5
ISR handler for capture compare channel 4 interrupt flag of timer 5 Requires the device specific macr...
static FUNC_POINTER BRK_Handler_TIM17
ISR handler for break interrupt flag of timer 17 Requires the device specific macro __STM32F030x6_H t...
static FUNC_POINTER TIM2_ISR
Pointer to the Timer 2 IRQ routine. Requires the device specific macro __STM32F103xB_H or __STM32F401...
static FUNC_POINTER CC2_Handler_TIM3
ISR handler for capture compare channel 2 interrupt flag of timer 3 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER UPD_Handler_TIM9
ISR handler for update interrupt flag of timer 9 Requires the device specific macro __STM32F401xC_H t...
static FUNC_POINTER CC1_Handler_TIM14
ISR handler for capture compare channel 1 interrupt flag of timer 14 Requires the device specific mac...
static FUNC_POINTER TIM1_BRK_TIM9_ISR
Pointer to the Timer 1 break - timer 9 IRQ routine. Requires the device specific macro __STM32F401xC_...
static FUNC_POINTER TIM1_BRK_UP_TRG_COM_ISR
Pointer to the Timer 1 break - update - trigger - comm IRQ routine. Requires the device specific macr...
static FUNC_POINTER UPD_Handler_TIM4
ISR handler for update interrupt flag of timer 4 Requires the device specific macro __STM32F103xB_H o...
static const uint32_t APB2_DIV1
Constant to check if non-unitary prescaling has been applied to advanced peripheral bus 2....
static FUNC_POINTER UPD_Handler_TIM5
ISR handler for update interrupt flag of timer 5 Requires the device specific macro __STM32F401xC_H t...
static FUNC_POINTER UPD_Handler_TIM3
ISR handler for update interrupt flag of timer 3 Requires HIERODULE_TIM_HANDLE_IRQ to be defined....
static FUNC_POINTER CC4_Handler_TIM1
ISR handler for capture compare channel 4 interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER TIM17_ISR
Pointer to the Timer 17 IRQ routine. Requires the device specific macro __STM32F030x6_H to be defined...
static FUNC_POINTER CC1_Handler_TIM11
ISR handler for capture compare channel 1 interrupt flag of timer 11 Requires the device specific mac...
static FUNC_POINTER TIM1_TRG_COM_TIM11_ISR
Pointer to the Timer 1 trigger comm - timer 11 IRQ routine. Requires the device specific macro __STM3...
static FUNC_POINTER CC4_Handler_TIM2
ISR handler for capture compare channel 4 interrupt flag of timer 2 Requires the device specific macr...
static void Check_IT(TIM_TypeDef *Timer, FUNC_POINTER Handler, T2V_Function_Pointer ClearFlag)
Performs a routine if it's not NULL, and clears the flag of a timer as specified with the clear-flag ...
static FUNC_POINTER TIM1_UP_TIM10_ISR
Pointer to the Timer 1 update - timer 10 IRQ routine. Requires the device specific macro __STM32F401x...
static FUNC_POINTER UPD_Handler_TIM14
ISR handler for update interrupt flag of timer 14 Requires the device specific macro __STM32F030x6_H ...
static uint32_t * ChannelSelector(TIM_TypeDef *Timer, uint32_t ChannelOffset)
Returns the pointer to the target channel's capture compare register.
static FUNC_POINTER TIM1_BRK_ISR
Pointer to the Timer 1 break IRQ routine. Requires the device specific macro __STM32F103xB_H to be de...
static FUNC_POINTER BRK_Handler_TIM1
ISR handler for break interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ to be defined....
static FUNC_POINTER TIM1_CC_ISR
Pointer to the Timer 1 Capture Compare IRQ routine. Requires HIERODULE_TIM_HANDLE_IRQ to be defined....
static FUNC_POINTER CC2_Handler_TIM2
ISR handler for capture compare channel 2 interrupt flag of timer 2 Requires the device specific macr...
static FUNC_POINTER CC1_Handler_TIM17
ISR handler for capture compare channel 1 interrupt flag of timer 17 Requires the device specific mac...
static FUNC_POINTER CC1_Handler_TIM3
ISR handler for capture compare channel 1 interrupt flag of timer 3 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER CC3_Handler_TIM4
ISR handler for capture compare channel 3 interrupt flag of timer 4 Requires the device specific macr...
static FUNC_POINTER CC1_Handler_TIM2
ISR handler for capture compare channel 1 interrupt flag of timer 2 Requires the device specific macr...
static uint32_t GetBaseFreq(TIM_TypeDef *Timer)
Returns the base frequency of a timer.
static FUNC_POINTER CC3_Handler_TIM2
ISR handler for capture compare channel 3 interrupt flag of timer 2 Requires the device specific macr...
static FUNC_POINTER CC2_Handler_TIM4
ISR handler for capture compare channel 2 interrupt flag of timer 4 Requires the device specific macr...
static FUNC_POINTER CC1_Handler_TIM16
ISR handler for capture compare channel 1 interrupt flag of timer 16 Requires the device specific mac...
static const uint32_t TimerChannel_EN[7]
The array the timer PWM output channel enable bitmasks are kept.
static FUNC_POINTER TIM14_ISR
Pointer to the Timer 14 IRQ routine. Requires the device specific macro __STM32F030x6_H to be defined...
static FUNC_POINTER CC2_Handler_TIM5
ISR handler for capture compare channel 2 interrupt flag of timer 5 Requires the device specific macr...
static FUNC_POINTER CC4_Handler_TIM4
ISR handler for capture compare channel 4 interrupt flag of timer 4 Requires the device specific macr...
void(* T2V_Function_Pointer)(TIM_TypeDef *)
Used to reference a clear-flag routine for Check_IT.
static FUNC_POINTER CC1_Handler_TIM10
ISR handler for capture compare channel 1 interrupt flag of timer 10 Requires the device specific mac...
static FUNC_POINTER TIM4_ISR
Pointer to the Timer 4 IRQ routine. Requires the device specific macro __STM32F103xB_H or __STM32F401...
static FUNC_POINTER UPD_Handler_TIM17
ISR handler for update interrupt flag of timer 17 Requires the device specific macro __STM32F030x6_H ...
static FUNC_POINTER UPD_Handler_TIM2
ISR handler for update interrupt flag of timer 2 Requires the device specific macro __STM32F103xB_H o...
static FUNC_POINTER UPD_Handler_TIM11
ISR handler for update interrupt flag of timer 11 Requires the device specific macro __STM32F401xC_H ...
static const uint32_t TimerChannel_CCR[4]
Keeps the offsets to capture compare registers within a TIM_Typedef for all four channels.
static const uint32_t APB1_DIV1_SINGLE
Constant to check if non-unitary prescaling has been applied to advanced peripheral bus 1....
static FUNC_POINTER UPD_Handler_TIM1
ISR handler for update interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ to be defined....
static FUNC_POINTER TIM1_UP_ISR
Pointer to the Timer 1 update IRQ routine. Requires the device specific macro __STM32F103xB_H to be d...
static FUNC_POINTER CC2_Handler_TIM1
ISR handler for capture compare channel 2 interrupt flag of timer 1 Requires HIERODULE_TIM_HANDLE_IRQ...
static FUNC_POINTER CC1_Handler_TIM4
ISR handler for capture compare channel 1 interrupt flag of timer 4 Requires the device specific macr...
void HIERODULE_TIM_SetRepetition(TIM_TypeDef *Timer, uint32_t Reps)
Sets the additional period repetitions of a timer.
void TIM1_TRG_COM_TIM11_IRQHandler(void)
Timer 1 trigger comm interrupt - timer 11 IRQ implementation. Requires the device specific macro __ST...
void TIM1_BRK_UP_TRG_COM_IRQHandler(void)
Timer 1 break - update - trigger comm IRQ implementation. Requires the device specific macro __STM32F...
uint32_t HIERODULE_TIM_IsSetFlag_CC1(TIM_TypeDef *Timer)
Checks the status of the capture compare channel 1 interrupt flag of the timer.
void HIERODULE_TIM_ClearFlag_CC3(TIM_TypeDef *Timer)
Clears 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.
void HIERODULE_TIM_Enable_IT_UPD(TIM_TypeDef *Timer)
Enables the update interrupt of the timer.
void HIERODULE_TIM_SetPeriod(TIM_TypeDef *Timer, double DurationSec)
Sets the period duration of a timer.
void HIERODULE_TIM_Disable_IT_UPD(TIM_TypeDef *Timer)
Disables the update interrupt of the timer.
double HIERODULE_TIM_GetFrequency(TIM_TypeDef *Timer)
Returns the frequency of a timer in Hertz.
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 _...
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....
void HIERODULE_TIM_ClearFlag_CC4(TIM_TypeDef *Timer)
Clears the capture compare channel 4 interrupt flag of the 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_Disable_IT_CC4(TIM_TypeDef *Timer)
Disables the capture compare channel 4 interrupt of the timer.
void TIM2_IRQHandler(void)
Timer 2 IRQ implementation. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to ...
void TIM1_BRK_TIM9_IRQHandler(void)
Timer 1 break interrupt - timer 9 IRQ implementation. Requires the device specific macro __STM32F401x...
uint32_t HIERODULE_TIM_IsEnabledCounter(TIM_TypeDef *Timer)
Checks the status of the counter of a timer.
void TIM14_IRQHandler(void)
Timer 14 IRQ implementation. Requires the device specific macro __STM32F030x6_H to be 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...
uint32_t HIERODULE_TIM_IsSetFlag_UPD(TIM_TypeDef *Timer)
Checks the status of the update interrupt flag of the timer.
void TIM1_UP_IRQHandler(void)
Timer 1 update interrupt IRQ implementation. Requires the device specific macro __STM32F103xB_H to be...
uint32_t HIERODULE_TIM_IsEnabled_IT_UPD(TIM_TypeDef *Timer)
Checks the update interrupt 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_SetDutyCycle(TIM_TypeDef *Timer, uint8_t Channel, double NormalizedDutyCycle)
Sets the duty cycle of the specified PWM output channel of a timer.
uint32_t HIERODULE_TIM_IsSetFlag_CC2(TIM_TypeDef *Timer)
Checks the status of the capture compare channel 2 interrupt flag of the timer.
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...
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 ...
void TIM5_IRQHandler(void)
Timer 5 IRQ implementation. Requires the device specific macro __STM32F401xC_H to be defined....
void HIERODULE_TIM_Enable_IT_BRK(TIM_TypeDef *Timer)
Enables the break interrupt of the timer.
void HIERODULE_TIM_EnableCounter(TIM_TypeDef *Timer)
Enables the counter of a 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 TIM4_IRQHandler(void)
Timer 4 IRQ implementation. Requires the device specific macro __STM32F103xB_H or __STM32F401xC_H to ...
void HIERODULE_TIM_DisableChannel(TIM_TypeDef *Timer, int8_t Channel)
Disables the PWM output channel of a timer.
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 spec...
uint32_t HIERODULE_TIM_IsEnabled_IT_CC2(TIM_TypeDef *Timer)
Checks 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_SetFrequency(TIM_TypeDef *Timer, double Frequency_Hz)
Sets the frequency of a 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_CC1(TIM_TypeDef *Timer)
Enables the capture compare channel 1 interrupt of the timer.
uint32_t HIERODULE_TIM_IsEnabledChannel(TIM_TypeDef *Timer, int8_t Channel)
Checks the status of the PWM output channel of a timer.
uint32_t HIERODULE_TIM_IsEnabled_IT_BRK(TIM_TypeDef *Timer)
Checks the break interrupt of the timer.
void HIERODULE_TIM_EnableChannel(TIM_TypeDef *Timer, int8_t Channel)
Enables the PWM output channel of a timer.
void HIERODULE_TIM_Disable_IT_CC3(TIM_TypeDef *Timer)
Disables the capture compare channel 3 interrupt of the timer.
double HIERODULE_TIM_GetPeriod(TIM_TypeDef *Timer)
Returns the period duration of a timer in seconds.
void HIERODULE_TIM_Disable_IT_BRK(TIM_TypeDef *Timer)
Disables the break interrupt of the timer.
void(* FUNC_POINTER)(void)
Typedef as for an alias for the void function pointer.
uint32_t HIERODULE_TIM_IsSetFlag_CC3(TIM_TypeDef *Timer)
Checks the status of the capture compare channel 3 interrupt flag of the 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_Assign_TIM17_ISR(FUNC_POINTER ISR)
Assigns a function to the timer 17 IRQ handler. Requires the device specific macro __STM32F030x6_H to...
void TIM17_IRQHandler(void)
Timer 17 IRQ implementation. Requires the device specific macro __STM32F030x6_H 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 b...
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_ClearFlag_CC1(TIM_TypeDef *Timer)
Clears the capture compare channel 1 interrupt flag 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_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 ti...
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 ti...
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....
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...
void HIERODULE_TIM_ClearFlag_CC2(TIM_TypeDef *Timer)
Clears the capture compare channel 2 interrupt flag of the timer.
void TIM3_IRQHandler(void)
Timer 3 IRQ implementation. Requires HIERODULE_TIM_HANDLE_IRQ to be defined. Won't be compiled if HIE...
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 __S...
void TIM1_BRK_IRQHandler(void)
Timer 1 break interrupt IRQ implementation. Requires the device specific macro __STM32F103xB_H to be ...
void TIM1_UP_TIM10_IRQHandler(void)
Timer 1 update interrupt - timer 10 IRQ implementation. Requires the device specific macro __STM32F40...
void HIERODULE_TIM_Disable_IT_CC2(TIM_TypeDef *Timer)
Disables the capture compare channel 2 interrupt of the timer.
uint32_t HIERODULE_TIM_GetRepetition(TIM_TypeDef *Timer)
Returns the number of additional period repetitions of a timer.
uint32_t HIERODULE_TIM_IsEnabled_IT_CC4(TIM_TypeDef *Timer)
Checks the capture compare channel 4 interrupt of the timer.
void HIERODULE_TIM_ClearFlag_BRK(TIM_TypeDef *Timer)
Clears the break interrupt flag of the timer.
void HIERODULE_TIM_DisableCounter(TIM_TypeDef *Timer)
Disables the counter of a 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_Assign_TIM2_ISR(FUNC_POINTER ISR)
Assigns a function to the timer 2 IRQ handler. Requires the device specific macro __STM32F103xB_H or ...
uint32_t HIERODULE_TIM_IsEnabled_IT_CC1(TIM_TypeDef *Timer)
Checks the capture compare channel 1 interrupt of the timer.
void TIM16_IRQHandler(void)
Timer 16 IRQ implementation. Requires the device specific macro __STM32F030x6_H 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 ti...
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 ...
void TIM1_CC_IRQHandler(void)
Timer 1 capture compare interrupt IRQ implementation. Requires HIERODULE_TIM_HANDLE_IRQ to be defined...
void HIERODULE_TIM_ClearCounter(TIM_TypeDef *Timer)
Clears the counter register of a timer.
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 __STM32F103x...
void HIERODULE_TIM_ClearFlag_UPD(TIM_TypeDef *Timer)
Clears the update interrupt flag of the timer.
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 ti...
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 m...
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....
uint32_t HIERODULE_TIM_IsEnabled_IT_CC3(TIM_TypeDef *Timer)
Checks 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.
: Header file for the timer module.