138 #define HRTIM_FLTR_FLTxEN (HRTIM_FLTR_FLT1EN |\ 141 HRTIM_FLTR_FLT4EN | \ 144 #define HRTIM_TIMCR_TIMUPDATETRIGGER (HRTIM_TIMUPDATETRIGGER_MASTER |\ 145 HRTIM_TIMUPDATETRIGGER_TIMER_A |\ 146 HRTIM_TIMUPDATETRIGGER_TIMER_B |\ 147 HRTIM_TIMUPDATETRIGGER_TIMER_C |\ 148 HRTIM_TIMUPDATETRIGGER_TIMER_D |\ 149 HRTIM_TIMUPDATETRIGGER_TIMER_E) 151 #define HRTIM_TIM_OFFSET (uint32_t)0x00000080 174 uint32_t CompareUnit,
178 uint32_t CaptureUnit,
252 # pragma GCC diagnostic push 253 # pragma GCC diagnostic ignored "-Wunused-parameter" 262 # pragma GCC diagnostic pop 426 uint32_t HRTIM_dllcr;
432 HRTIM_dllcr = (HRTIMx->HRTIM_COMMON).DLLCR;
437 HRTIM_dllcr &= ~(HRTIM_DLLCR_CALEN);
438 HRTIM_dllcr |= HRTIM_DLLCR_CAL;
443 HRTIM_dllcr &= ~(HRTIM_DLLCR_CALRTE | HRTIM_DLLCR_CAL);
444 HRTIM_dllcr |= (CalibrationRate | HRTIM_DLLCR_CALEN);
448 HRTIMx->HRTIM_COMMON.DLLCR = HRTIM_dllcr;
515 (HRTIMx->HRTIM_COMMON).OENR |= OCChannel;
550 HRTIMx->HRTIM_COMMON.DISR |= OCChannel;
584 HRTIMx->HRTIM_COMMON.OENR |= PWMChannel;
618 HRTIMx->HRTIM_COMMON.DISR |= PWMChannel;
640 # pragma GCC diagnostic push 641 # pragma GCC diagnostic ignored "-Wunused-parameter" 645 uint32_t CaptureChannel)
652 # pragma GCC diagnostic pop 669 uint32_t CaptureChannel)
676 switch (CaptureChannel)
723 uint32_t OnePulseChannel)
729 HRTIMx->HRTIM_COMMON.OENR |= OnePulseChannel;
757 uint32_t OnePulseChannel)
763 HRTIMx->HRTIM_COMMON.DISR |= OnePulseChannel;
784 uint32_t TimersToStart)
787 HRTIMx->HRTIM_MASTER.MCR |= TimersToStart;
805 uint32_t TimersToStop)
808 HRTIMx->HRTIM_MASTER.MCR &= ~TimersToStop;
830 uint32_t OutputsToStart)
833 HRTIMx->HRTIM_COMMON.OENR = OutputsToStart;
855 uint32_t OutputsToStop)
858 HRTIMx->HRTIM_COMMON.DISR = OutputsToStop;
904 HRTIMx->HRTIM_MASTER.MDIER |= HRTIM_IT;
908 HRTIMx->HRTIM_MASTER.MDIER &= ~HRTIM_IT;
920 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxDIER |= HRTIM_IT;
924 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxDIER &= ~HRTIM_IT;
955 HRTIMx->HRTIM_COMMON.IER |= HRTIM_CommonIT;
959 HRTIMx->HRTIM_COMMON.IER &= ~HRTIM_CommonIT;
1002 HRTIMx->HRTIM_MASTER.MICR |= HRTIM_FLAG;
1011 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxICR |= HRTIM_FLAG;
1037 HRTIMx->HRTIM_COMMON.ICR |= HRTIM_CommonFLAG;
1079 HRTIMx->HRTIM_MASTER.MICR |= HRTIM_IT;
1088 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxICR |= HRTIM_IT;
1114 HRTIMx->HRTIM_COMMON.ICR |= HRTIM_CommonIT;
1159 if ((HRTIMx->HRTIM_MASTER.MISR & HRTIM_FLAG) !=
RESET)
1176 if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_FLAG) !=
RESET)
1212 if((HRTIMx->HRTIM_COMMON.ISR & HRTIM_CommonFLAG) !=
RESET)
1257 uint16_t itstatus = 0x0, itenable = 0x0;
1265 itstatus = HRTIMx->HRTIM_MASTER.MISR & HRTIM_IT;
1267 itenable = HRTIMx->HRTIM_MASTER.MDIER & HRTIM_IT;
1268 if ((itstatus != (uint16_t)
RESET) && (itenable != (uint16_t)RESET))
1285 itstatus = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_IT;
1287 itenable = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxDIER & HRTIM_IT;
1288 if ((itstatus != (uint16_t)
RESET) && (itenable != (uint16_t)RESET))
1323 uint16_t itstatus = 0x0, itenable = 0x0;
1325 itstatus = HRTIMx->HRTIM_COMMON.ISR & HRTIM_CommonIT;
1326 itenable = HRTIMx->HRTIM_COMMON.IER & HRTIM_CommonIT;
1328 if ((itstatus != (uint16_t)
RESET) && (itenable != (uint16_t)RESET))
1383 HRTIMx->HRTIM_MASTER.MDIER |= HRTIM_DMA;
1387 HRTIMx->HRTIM_MASTER.MDIER &= ~HRTIM_DMA;
1399 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxDIER |= HRTIM_DMA;
1403 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxDIER &= ~HRTIM_DMA;
1517 switch (pBasicOCChannelCfg->
Mode)
1594 uint32_t PWMChannel,
1680 uint32_t CaptureChannel,
1701 pBasicCaptureChannelCfg->
Event,
1708 pBasicCaptureChannelCfg->
Event);
1744 uint32_t OnePulseChannel,
1762 switch (OnePulseChannel)
1826 pBasicOnePulseChannelCfg->
Event,
1832 pBasicOnePulseChannelCfg->
Event);
1850 uint32_t HRTIM_timcr;
1851 uint32_t HRTIM_timfltr;
1852 uint32_t HRTIM_timoutr;
1853 uint32_t HRTIM_timrstr;
1867 HRTIM_timcr = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR;
1868 HRTIM_timfltr = HRTIMx->HRTIM_TIMERx[TimerIdx].FLTxR;
1869 HRTIM_timoutr = HRTIMx->HRTIM_TIMERx[TimerIdx].OUTxR;
1870 HRTIM_timrstr = HRTIMx->HRTIM_TIMERx[TimerIdx].RSTxR;
1873 HRTIM_timcr &= ~(HRTIM_TIMCR_PSHPLL);
1874 HRTIM_timcr |= pTimerCfg->
PushPull;
1877 HRTIM_timcr &= ~(HRTIM_TIMCR_TRSTU);
1889 HRTIM_timfltr &= ~(HRTIM_FLTR_FLTCLK);
1893 HRTIM_timoutr &= ~(HRTIM_OUTR_DTEN);
1897 HRTIM_timoutr &= ~(HRTIM_OUTR_DLYPRT| HRTIM_OUTR_DLYPRTEN);
1904 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR = HRTIM_timcr;
1905 HRTIMx->HRTIM_TIMERx[TimerIdx].FLTxR = HRTIM_timfltr;
1906 HRTIMx->HRTIM_TIMERx[TimerIdx].OUTxR = HRTIM_timoutr;
1907 HRTIMx->HRTIM_TIMERx[TimerIdx].RSTxR = HRTIM_timrstr;
1934 uint32_t CompareUnit,
1937 uint32_t HRTIM_timcr;
1944 switch (CompareUnit)
1949 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP1xR = pCompareCfg->
CompareValue;
1955 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP2xR = pCompareCfg->
CompareValue;
1960 HRTIM_timcr = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR;
1961 HRTIM_timcr &= ~HRTIM_TIMCR_DELCMP2;
1963 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR = HRTIM_timcr;
1980 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP3xR = pCompareCfg->
CompareValue;
1986 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP4xR = pCompareCfg->
CompareValue;
1991 HRTIM_timcr = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR;
1992 HRTIM_timcr &= ~HRTIM_TIMCR_DELCMP4;
1994 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR = HRTIM_timcr;
2026 uint32_t CompareUnit,
2033 switch (CompareUnit)
2038 HRTIMx->HRTIM_MASTER.MCMP1R = Compare;
2044 HRTIMx->HRTIM_MASTER.MCMP2R = Compare;
2050 HRTIMx->HRTIM_MASTER.MCMP3R = Compare;
2056 HRTIMx->HRTIM_MASTER.MCMP4R = Compare;
2078 uint32_t CompareUnit,
2085 switch (CompareUnit)
2090 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP1xR = Compare;
2096 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP2xR = Compare;
2102 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP3xR = Compare;
2108 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP4xR = Compare;
2130 uint32_t CaptureUnit,
2134 switch (CaptureUnit)
2138 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT1xCR = pCaptureCfg->
Trigger;
2143 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT2xCR = pCaptureCfg->
Trigger;
2216 uint32_t HRTIM_eefr;
2229 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = 0;
2230 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = 0;
2235 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1;
2236 HRTIM_eefr &= ~(HRTIM_EEFR1_EE1FLTR | HRTIM_EEFR1_EE1LTCH);
2237 HRTIM_eefr |= (pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch);
2238 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = HRTIM_eefr;
2243 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1;
2244 HRTIM_eefr &= ~(HRTIM_EEFR1_EE2FLTR | HRTIM_EEFR1_EE2LTCH);
2245 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 6);
2246 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = HRTIM_eefr;
2251 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1;
2252 HRTIM_eefr &= ~(HRTIM_EEFR1_EE3FLTR | HRTIM_EEFR1_EE3LTCH);
2253 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 12);
2254 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = HRTIM_eefr;
2259 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1;
2260 HRTIM_eefr &= ~(HRTIM_EEFR1_EE4FLTR | HRTIM_EEFR1_EE4LTCH);
2261 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 18);
2262 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = HRTIM_eefr;
2267 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1;
2268 HRTIM_eefr &= ~(HRTIM_EEFR1_EE5FLTR | HRTIM_EEFR1_EE5LTCH);
2269 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 24);
2270 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR1 = HRTIM_eefr;
2275 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2;
2276 HRTIM_eefr &= ~(HRTIM_EEFR2_EE6FLTR | HRTIM_EEFR2_EE6LTCH);
2277 HRTIM_eefr |= (pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch);
2278 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = HRTIM_eefr;
2283 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2;
2284 HRTIM_eefr &= ~(HRTIM_EEFR2_EE7FLTR | HRTIM_EEFR2_EE7LTCH);
2285 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 6);
2286 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = HRTIM_eefr;
2291 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2;
2292 HRTIM_eefr &= ~(HRTIM_EEFR2_EE8FLTR | HRTIM_EEFR2_EE8LTCH);
2293 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 12);
2294 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = HRTIM_eefr;
2299 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2;
2300 HRTIM_eefr &= ~(HRTIM_EEFR2_EE9FLTR | HRTIM_EEFR2_EE9LTCH);
2301 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 18);
2302 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = HRTIM_eefr;
2307 HRTIM_eefr = HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2;
2308 HRTIM_eefr &= ~(HRTIM_EEFR2_EE10FLTR | HRTIM_EEFR2_EE10LTCH);
2309 HRTIM_eefr |= ((pTimerEventFilteringCfg->
Filter | pTimerEventFilteringCfg->
Latch) << 24);
2310 HRTIMx->HRTIM_TIMERx[TimerIdx].EEFxR2 = HRTIM_eefr;
2342 HRTIM_dtr = HRTIMx->HRTIM_TIMERx[TimerIdx].DTxR;
2345 HRTIM_dtr &= ~(HRTIM_DTR_DTR | HRTIM_DTR_SDTR | HRTIM_DTR_DTPRSC |
2346 HRTIM_DTR_DTRSLK | HRTIM_DTR_DTRLK | HRTIM_DTR_SDTF |
2347 HRTIM_DTR_SDTR | HRTIM_DTR_DTFSLK | HRTIM_DTR_DTFLK);
2350 HRTIM_dtr |= (pDeadTimeCfg->
Prescaler << 10);
2361 HRTIMx->HRTIM_TIMERx[TimerIdx].DTxR = HRTIM_dtr;
2377 uint32_t HRTIM_chpr;
2382 HRTIM_chpr = HRTIMx->HRTIM_TIMERx[TimerIdx].CHPxR;
2385 HRTIM_chpr &= ~(HRTIM_CHPR_CARFRQ | HRTIM_CHPR_CARDTY | HRTIM_CHPR_STRPW);
2389 HRTIM_chpr |= (pChopperModeCfg->
DutyCycle << 4);
2390 HRTIM_chpr |= (pChopperModeCfg->
StartPulse << 7);
2393 HRTIMx->HRTIM_TIMERx[TimerIdx].CHPxR = HRTIM_chpr;
2430 uint32_t RegistersToUpdate)
2440 HRTIMx->HRTIM_COMMON.BDTAUPR = RegistersToUpdate;
2445 HRTIMx->HRTIM_COMMON.BDTBUPR = RegistersToUpdate;
2450 HRTIMx->HRTIM_COMMON.BDTCUPR = RegistersToUpdate;
2455 HRTIMx->HRTIM_COMMON.BDTDUPR = RegistersToUpdate;
2460 HRTIMx->HRTIM_COMMON.BDTEUPR = RegistersToUpdate;
2465 HRTIMx->HRTIM_COMMON.BDMUPDR = RegistersToUpdate;
2488 HRTIM_mcr = HRTIMx->HRTIM_MASTER.MCR;
2491 HRTIM_mcr &= ~(HRTIM_MCR_SYNC_IN);
2495 HRTIM_mcr &= ~(HRTIM_MCR_SYNC_SRC);
2499 HRTIM_mcr &= ~(HRTIM_MCR_SYNC_OUT);
2503 HRTIMx->HRTIM_MASTER.MCR = HRTIM_mcr;
2515 uint32_t HRTIM_bmcr;
2523 HRTIM_bmcr = HRTIMx->HRTIM_COMMON.BMCR;
2526 HRTIM_bmcr &= ~(HRTIM_BMCR_BMOM);
2527 HRTIM_bmcr |= pBurstModeCfg->
Mode;
2530 HRTIM_bmcr &= ~(HRTIM_BMCR_BMCLK);
2534 HRTIM_bmcr &= ~(HRTIM_BMCR_BMPSC);
2538 HRTIM_bmcr &= ~(HRTIM_BMCR_BMPREN);
2542 HRTIMx->HRTIM_COMMON.BMTRGR = pBurstModeCfg->
Trigger;
2545 HRTIMx->HRTIM_COMMON.BMCMPR = pBurstModeCfg->
IdleDuration;
2548 HRTIMx->HRTIM_COMMON.BMPER = pBurstModeCfg->
Period;
2551 HRTIMx->HRTIM_COMMON.BMCR = HRTIM_bmcr;
2602 uint32_t HRTIM_eecr3;
2608 HRTIM_eecr3 = HRTIMx->HRTIM_COMMON.EECR3;
2609 HRTIM_eecr3 &= ~(HRTIM_EECR3_EEVSD);
2610 HRTIM_eecr3 |= Prescaler;
2613 HRTIMx->HRTIM_COMMON.EECR3 = HRTIM_eecr3;
2633 uint32_t HRTIM_fltinr1;
2634 uint32_t HRTIM_fltinr2;
2644 HRTIM_fltinr1 = HRTIMx->HRTIM_COMMON.FLTINxR1;
2645 HRTIM_fltinr2 = HRTIMx->HRTIM_COMMON.FLTINxR2;
2651 HRTIM_fltinr1 &= ~(HRTIM_FLTINR1_FLT1P | HRTIM_FLTINR1_FLT1SRC | HRTIM_FLTINR1_FLT1F | HRTIM_FLTINR1_FLT1LCK);
2652 HRTIM_fltinr1 |= pFaultCfg->
Polarity;
2653 HRTIM_fltinr1 |= pFaultCfg->
Source;
2654 HRTIM_fltinr1 |= pFaultCfg->
Filter;
2655 HRTIM_fltinr1 |= pFaultCfg->
Lock;
2660 HRTIM_fltinr1 &= ~(HRTIM_FLTINR1_FLT2P | HRTIM_FLTINR1_FLT2SRC | HRTIM_FLTINR1_FLT2F | HRTIM_FLTINR1_FLT2LCK);
2661 HRTIM_fltinr1 |= (pFaultCfg->
Polarity << 8);
2662 HRTIM_fltinr1 |= (pFaultCfg->
Source << 8);
2663 HRTIM_fltinr1 |= (pFaultCfg->
Filter << 8);
2664 HRTIM_fltinr1 |= (pFaultCfg->
Lock << 8);
2669 HRTIM_fltinr1 &= ~(HRTIM_FLTINR1_FLT3P | HRTIM_FLTINR1_FLT3SRC | HRTIM_FLTINR1_FLT3F | HRTIM_FLTINR1_FLT3LCK);
2670 HRTIM_fltinr1 |= (pFaultCfg->
Polarity << 16);
2671 HRTIM_fltinr1 |= (pFaultCfg->
Source << 16);
2672 HRTIM_fltinr1 |= (pFaultCfg->
Filter << 16);
2673 HRTIM_fltinr1 |= (pFaultCfg->
Lock << 16);
2678 HRTIM_fltinr1 &= ~(HRTIM_FLTINR1_FLT4P | HRTIM_FLTINR1_FLT4SRC | HRTIM_FLTINR1_FLT4F | HRTIM_FLTINR1_FLT4LCK);
2679 HRTIM_fltinr1 |= (pFaultCfg->
Polarity << 24);
2680 HRTIM_fltinr1 |= (pFaultCfg->
Source << 24);
2681 HRTIM_fltinr1 |= (pFaultCfg->
Filter << 24);
2682 HRTIM_fltinr1 |= (pFaultCfg->
Lock << 24);
2687 HRTIM_fltinr2 &= ~(HRTIM_FLTINR2_FLT5P | HRTIM_FLTINR2_FLT5SRC | HRTIM_FLTINR2_FLT5F | HRTIM_FLTINR2_FLT5LCK);
2688 HRTIM_fltinr2 |= pFaultCfg->
Polarity;
2689 HRTIM_fltinr2 |= pFaultCfg->
Source;
2690 HRTIM_fltinr2 |= pFaultCfg->
Filter;
2691 HRTIM_fltinr2 |= pFaultCfg->
Lock;
2699 HRTIMx->HRTIM_COMMON.FLTINxR1 = HRTIM_fltinr1;
2700 HRTIMx->HRTIM_COMMON.FLTINxR2 = HRTIM_fltinr2;
2717 uint32_t HRTIM_fltinr2;
2723 HRTIM_fltinr2 = HRTIMx->HRTIM_COMMON.FLTINxR2;
2724 HRTIM_fltinr2 &= ~(HRTIM_FLTINR2_FLTSD);
2725 HRTIM_fltinr2 |= Prescaler;
2728 HRTIMx->HRTIM_COMMON.FLTINxR2 = HRTIM_fltinr2;
2749 uint32_t HRTIM_fltinr1;
2750 uint32_t HRTIM_fltinr2;
2757 HRTIM_fltinr1 = HRTIMx->HRTIM_COMMON.FLTINxR1;
2758 HRTIM_fltinr2 = HRTIMx->HRTIM_COMMON.FLTINxR2;
2764 HRTIM_fltinr1 &= ~HRTIM_FLTINR1_FLT1E;
2765 HRTIM_fltinr1 |= Enable;
2770 HRTIM_fltinr1 &= ~HRTIM_FLTINR1_FLT2E;
2771 HRTIM_fltinr1 |= (Enable<< 8);
2776 HRTIM_fltinr1 &= ~HRTIM_FLTINR1_FLT3E;
2777 HRTIM_fltinr1 |= (Enable << 16);
2782 HRTIM_fltinr1 &= ~HRTIM_FLTINR1_FLT4E;
2783 HRTIM_fltinr1 |= (Enable << 24);
2788 HRTIM_fltinr2 &= ~HRTIM_FLTINR2_FLT5E;
2789 HRTIM_fltinr2 |= Enable;
2797 HRTIMx->HRTIM_COMMON.FLTINxR1 = HRTIM_fltinr1;
2798 HRTIMx->HRTIM_COMMON.FLTINxR2 = HRTIM_fltinr2;
2815 uint32_t ADCTrigger,
2825 HRTIM_cr1 = HRTIMx->HRTIM_COMMON.CR1;
2831 HRTIM_cr1 &= ~(HRTIM_CR1_ADC1USRC);
2835 HRTIMx->HRTIM_COMMON.ADC1R = pADCTriggerCfg->
Trigger;
2840 HRTIM_cr1 &= ~(HRTIM_CR1_ADC2USRC);
2844 HRTIMx->HRTIM_COMMON.ADC2R = pADCTriggerCfg->
Trigger;
2849 HRTIM_cr1 &= ~(HRTIM_CR1_ADC3USRC);
2853 HRTIMx->HRTIM_COMMON.ADC3R = pADCTriggerCfg->
Trigger;
2857 HRTIM_cr1 &= ~(HRTIM_CR1_ADC4USRC);
2861 HRTIMx->HRTIM_COMMON.ADC4R = pADCTriggerCfg->
Trigger;
2869 HRTIMx->HRTIM_COMMON.CR1 = HRTIM_cr1;
2884 uint32_t HRTIM_bmcr;
2890 HRTIM_bmcr = HRTIMx->HRTIM_COMMON.BMCR;
2891 HRTIM_bmcr &= ~(HRTIM_BMCR_BME);
2892 HRTIM_bmcr |= Enable;
2895 HRTIMx->HRTIM_COMMON.BMCR = HRTIM_bmcr;
2914 uint32_t CaptureUnit)
2921 switch (CaptureUnit)
2925 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT1xCR |= HRTIM_CPT1CR_SWCPT;
2930 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT2xCR |= HRTIM_CPT2CR_SWCPT;
2954 uint32_t TimersToUpdate)
2960 HRTIMx->HRTIM_COMMON.CR2 |= TimersToUpdate;
2980 uint32_t TimersToReset)
2986 HRTIMx->HRTIM_COMMON.CR2 |= TimersToReset;
3019 uint32_t OutputLevel)
3037 HRTIMx->HRTIM_TIMERx[TimerIdx].SETx1R |= HRTIM_SET1R_SST;
3042 HRTIMx->HRTIM_TIMERx[TimerIdx].RSTx1R |= HRTIM_RST1R_SRT;
3055 HRTIMx->HRTIM_TIMERx[TimerIdx].SETx2R |= HRTIM_SET2R_SST;
3060 HRTIMx->HRTIM_TIMERx[TimerIdx].RSTx2R |= HRTIM_RST2R_SRT;
3103 uint32_t CaptureUnit)
3105 uint32_t captured_value = 0;
3112 switch (CaptureUnit)
3116 captured_value = HRTIMx->HRTIM_TIMERx[TimerIdx].CPT1xR;
3121 captured_value = HRTIMx->HRTIM_TIMERx[TimerIdx].CPT2xR;
3128 return captured_value;
3171 if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_O1CPY) !=
RESET)
3187 if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_O2CPY) !=
RESET)
3201 return output_level;
3225 # pragma GCC diagnostic push 3226 # pragma GCC diagnostic ignored "-Wunused-parameter" 3232 uint32_t output_bit = 0;
3243 output_bit = HRTIM_OENR_TA1OEN;
3248 output_bit = HRTIM_OENR_TA2OEN;
3253 output_bit = HRTIM_OENR_TB1OEN;
3258 output_bit = HRTIM_OENR_TB2OEN;
3263 output_bit = HRTIM_OENR_TC1OEN;
3268 output_bit = HRTIM_OENR_TC2OEN;
3273 output_bit = HRTIM_OENR_TD1OEN;
3278 output_bit = HRTIM_OENR_TD2OEN;
3283 output_bit = HRTIM_OENR_TE1OEN;
3288 output_bit = HRTIM_OENR_TE2OEN;
3295 if ((HRTIMx->HRTIM_COMMON.OENR & output_bit) !=
RESET)
3302 if ((HRTIMx->HRTIM_COMMON.ODSR & output_bit) !=
RESET)
3314 return(output_state);
3317 # pragma GCC diagnostic pop 3359 if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_O1STAT) !=
RESET)
3377 if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_O2STAT) !=
RESET)
3393 return delayed_protection_status;
3403 uint32_t burst_mode_status;
3406 burst_mode_status = (HRTIMx->HRTIM_COMMON.BMCR & HRTIM_BMCR_BMSTAT);
3408 return burst_mode_status;
3423 uint32_t current_pushpull_status;
3429 current_pushpull_status = (HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_CPPSTAT);
3431 return current_pushpull_status;
3447 uint32_t idle_pushpull_status;
3453 idle_pushpull_status = (HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_TIMISR_IPPSTAT);
3455 return idle_pushpull_status;
3466 HRTIMx->HRTIM_MASTER.MCR &= (uint32_t) ~(HRTIM_MCR_CK_PSC);
3467 HRTIMx->HRTIM_MASTER.MCR |= (uint32_t)HRTIM_BaseInitStruct->
PrescalerRatio;
3470 HRTIMx->HRTIM_MASTER.MCR &= (uint32_t) ~(HRTIM_MCR_CONT | HRTIM_MCR_RETRIG);
3471 HRTIMx->HRTIM_MASTER.MCR |= (uint32_t)HRTIM_BaseInitStruct->
Mode;
3474 HRTIMx->HRTIM_MASTER.MPER = HRTIM_BaseInitStruct->
Period;
3487 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR &= (uint32_t) ~(HRTIM_TIMCR_CK_PSC);
3488 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR |= (uint32_t)HRTIM_BaseInitStruct->
PrescalerRatio;
3491 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR &= (uint32_t) ~(HRTIM_TIMCR_CONT | HRTIM_TIMCR_RETRIG);
3492 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR |= (uint32_t)HRTIM_BaseInitStruct->
Mode;
3495 HRTIMx->HRTIM_TIMERx[TimerIdx].PERxR = HRTIM_BaseInitStruct->
Period;
3510 uint32_t HRTIM_bmcr;
3513 HRTIM_mcr = HRTIMx->HRTIM_MASTER.MCR;
3514 HRTIM_bmcr = HRTIMx->HRTIM_COMMON.BMCR;
3517 HRTIM_mcr &= ~(HRTIM_MCR_HALF);
3521 HRTIM_mcr &= ~(HRTIM_MCR_SYNCSTRTM);
3525 HRTIM_mcr &= ~(HRTIM_MCR_SYNCRSTM);
3529 HRTIM_mcr &= ~(HRTIM_MCR_DACSYNC);
3533 HRTIM_mcr &= ~(HRTIM_MCR_PREEN);
3537 HRTIM_mcr &= ~(HRTIM_MCR_BRSTDMA);
3541 HRTIM_mcr &= ~(HRTIM_MCR_MREPU);
3545 HRTIM_bmcr &= ~(HRTIM_BMCR_MTBM);
3549 HRTIMx->HRTIM_MASTER.MCR = HRTIM_mcr;
3550 HRTIMx->HRTIM_COMMON.BMCR = HRTIM_bmcr;
3565 uint32_t HRTIM_timcr;
3566 uint32_t HRTIM_bmcr;
3569 HRTIM_timcr = HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR;
3570 HRTIM_bmcr = HRTIMx->HRTIM_COMMON.BMCR;
3573 HRTIM_timcr &= ~(HRTIM_TIMCR_HALF);
3577 HRTIM_timcr &= ~(HRTIM_TIMCR_SYNCSTRT);
3581 HRTIM_timcr &= ~(HRTIM_TIMCR_SYNCRST);
3585 HRTIM_timcr &= ~(HRTIM_TIMCR_DACSYNC);
3589 HRTIM_timcr &= ~(HRTIM_TIMCR_PREEN);
3593 HRTIM_timcr &= ~(HRTIM_TIMCR_UPDGAT);
3597 HRTIM_timcr &= ~(HRTIM_TIMCR_TREPU);
3600 HRTIM_timcr |= HRTIM_TIMCR_TREPU;
3608 HRTIM_bmcr &= ~(HRTIM_BMCR_TABM);
3609 HRTIM_bmcr |= ( pTimerInit->
BurstMode << 1);
3614 HRTIM_bmcr &= ~(HRTIM_BMCR_TBBM);
3615 HRTIM_bmcr |= ( pTimerInit->
BurstMode << 2);
3620 HRTIM_bmcr &= ~(HRTIM_BMCR_TCBM);
3621 HRTIM_bmcr |= ( pTimerInit->
BurstMode << 3);
3626 HRTIM_bmcr &= ~(HRTIM_BMCR_TDBM);
3627 HRTIM_bmcr |= ( pTimerInit->
BurstMode << 4);
3632 HRTIM_bmcr &= ~(HRTIM_BMCR_TEBM);
3633 HRTIM_bmcr |= ( pTimerInit->
BurstMode << 5);
3641 HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxCR = HRTIM_timcr;
3642 HRTIMx->HRTIM_COMMON.BMCR = HRTIM_bmcr;
3655 uint32_t CompareUnit,
3661 switch (CompareUnit)
3665 HRTIMx->HRTIM_MASTER.MCMP1R = pCompareCfg->
CompareValue;
3670 HRTIMx->HRTIM_MASTER.MCMP2R = pCompareCfg->
CompareValue;
3675 HRTIMx->HRTIM_MASTER.MCMP3R = pCompareCfg->
CompareValue;
3680 HRTIMx->HRTIM_MASTER.MCMP4R = pCompareCfg->
CompareValue;
3690 switch (CompareUnit)
3694 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP1xR = pCompareCfg->
CompareValue;
3699 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP2xR = pCompareCfg->
CompareValue;
3704 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP3xR = pCompareCfg->
CompareValue;
3709 HRTIMx->HRTIM_TIMERx[TimerIdx].CMP4xR = pCompareCfg->
CompareValue;
3728 uint32_t CaptureUnit,
3789 switch (CaptureUnit)
3793 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT1xCR = CaptureTrigger;
3798 HRTIMx->HRTIM_TIMERx[TimerIdx].CPT2xCR = CaptureTrigger;
3819 uint32_t HRTIM_outr;
3822 HRTIM_outr = HRTIMx->HRTIM_TIMERx[TimerIdx].OUTxR;
3833 HRTIMx->HRTIM_TIMERx[TimerIdx].SETx1R = pOutputCfg->
SetSource;
3834 HRTIMx->HRTIM_TIMERx[TimerIdx].RSTx1R = pOutputCfg->
ResetSource;
3846 HRTIMx->HRTIM_TIMERx[TimerIdx].SETx2R = pOutputCfg->
SetSource;
3847 HRTIMx->HRTIM_TIMERx[TimerIdx].RSTx2R = pOutputCfg->
ResetSource;
3857 HRTIM_outr &= ~((HRTIM_OUTR_POL1 |
3862 HRTIM_OUTR_DIDL1) << shift);
3865 HRTIM_outr |= (pOutputCfg->
Polarity << shift);
3868 HRTIM_outr |= (pOutputCfg->
IdleMode << shift);
3871 HRTIM_outr |= (pOutputCfg->
IdleState << shift);
3874 HRTIM_outr |= (pOutputCfg->
FaultState << shift);
3883 HRTIMx->HRTIM_TIMERx[TimerIdx].OUTxR = HRTIM_outr;
3897 uint32_t hrtim_eecr1;
3898 uint32_t hrtim_eecr2;
3899 uint32_t hrtim_eecr3;
3902 hrtim_eecr1 = HRTIMx->HRTIM_COMMON.EECR1;
3903 hrtim_eecr2 = HRTIMx->HRTIM_COMMON.EECR2;
3904 hrtim_eecr3 = HRTIMx->HRTIM_COMMON.EECR3;
3910 hrtim_eecr1 &= ~(HRTIM_EECR1_EE1SRC | HRTIM_EECR1_EE1POL | HRTIM_EECR1_EE1SNS | HRTIM_EECR1_EE1FAST);
3911 hrtim_eecr1 |= pEventCfg->
Source;
3912 hrtim_eecr1 |= pEventCfg->
Polarity;
3915 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3917 hrtim_eecr1 |= pEventCfg->
FastMode;
3918 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3923 hrtim_eecr1 &= ~(HRTIM_EECR1_EE2SRC | HRTIM_EECR1_EE2POL | HRTIM_EECR1_EE2SNS | HRTIM_EECR1_EE2FAST);
3924 hrtim_eecr1 |= (pEventCfg->
Source << 6);
3925 hrtim_eecr1 |= (pEventCfg->
Polarity << 6);
3928 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3930 hrtim_eecr1 |= (pEventCfg->
FastMode << 6);
3931 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3936 hrtim_eecr1 &= ~(HRTIM_EECR1_EE3SRC | HRTIM_EECR1_EE3POL | HRTIM_EECR1_EE3SNS | HRTIM_EECR1_EE3FAST);
3937 hrtim_eecr1 |= (pEventCfg->
Source << 12);
3938 hrtim_eecr1 |= (pEventCfg->
Polarity << 12);
3941 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3943 hrtim_eecr1 |= (pEventCfg->
FastMode << 12);
3944 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3949 hrtim_eecr1 &= ~(HRTIM_EECR1_EE4SRC | HRTIM_EECR1_EE4POL | HRTIM_EECR1_EE4SNS | HRTIM_EECR1_EE4FAST);
3950 hrtim_eecr1 |= (pEventCfg->
Source << 18);
3951 hrtim_eecr1 |= (pEventCfg->
Polarity << 18);
3954 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3956 hrtim_eecr1 |= (pEventCfg->
FastMode << 18);
3957 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3962 hrtim_eecr1 &= ~(HRTIM_EECR1_EE5SRC | HRTIM_EECR1_EE5POL | HRTIM_EECR1_EE5SNS | HRTIM_EECR1_EE5FAST);
3963 hrtim_eecr1 |= (pEventCfg->
Source << 24);
3964 hrtim_eecr1 |= (pEventCfg->
Polarity << 24);
3967 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3969 hrtim_eecr1 |= (pEventCfg->
FastMode << 24);
3970 HRTIMx->HRTIM_COMMON.EECR1 = hrtim_eecr1;
3975 hrtim_eecr2 &= ~(HRTIM_EECR2_EE6SRC | HRTIM_EECR2_EE6POL | HRTIM_EECR2_EE6SNS);
3976 hrtim_eecr2 |= pEventCfg->
Source;
3977 hrtim_eecr2 |= pEventCfg->
Polarity;
3979 hrtim_eecr3 &= ~(HRTIM_EECR3_EE6F);
3980 hrtim_eecr3 |= pEventCfg->
Filter;
3982 HRTIMx->HRTIM_COMMON.EECR2 = hrtim_eecr2;
3983 HRTIMx->HRTIM_COMMON.EECR3 = hrtim_eecr3;
3988 hrtim_eecr2 &= ~(HRTIM_EECR2_EE7SRC | HRTIM_EECR2_EE7POL | HRTIM_EECR2_EE7SNS);
3989 hrtim_eecr2 |= (pEventCfg->
Source << 6);
3990 hrtim_eecr2 |= (pEventCfg->
Polarity << 6);
3992 hrtim_eecr3 &= ~(HRTIM_EECR3_EE7F);
3993 hrtim_eecr3 |= (pEventCfg->
Filter << 6);
3995 HRTIMx->HRTIM_COMMON.EECR2 = hrtim_eecr2;
3996 HRTIMx->HRTIM_COMMON.EECR3 = hrtim_eecr3;
4001 hrtim_eecr2 &= ~(HRTIM_EECR2_EE8SRC | HRTIM_EECR2_EE8POL | HRTIM_EECR2_EE8SNS);
4002 hrtim_eecr2 |= (pEventCfg->
Source << 12);
4003 hrtim_eecr2 |= (pEventCfg->
Polarity << 12);
4005 hrtim_eecr3 &= ~(HRTIM_EECR3_EE8F);
4006 hrtim_eecr3 |= (pEventCfg->
Filter << 12);
4008 HRTIMx->HRTIM_COMMON.EECR2 = hrtim_eecr2;
4009 HRTIMx->HRTIM_COMMON.EECR3 = hrtim_eecr3;
4014 hrtim_eecr2 &= ~(HRTIM_EECR2_EE9SRC | HRTIM_EECR2_EE9POL | HRTIM_EECR2_EE9SNS);
4015 hrtim_eecr2 |= (pEventCfg->
Source << 18);
4016 hrtim_eecr2 |= (pEventCfg->
Polarity << 18);
4018 hrtim_eecr3 &= ~(HRTIM_EECR3_EE9F);
4019 hrtim_eecr3 |= (pEventCfg->
Filter << 18);
4021 HRTIMx->HRTIM_COMMON.EECR2 = hrtim_eecr2;
4022 HRTIMx->HRTIM_COMMON.EECR3 = hrtim_eecr3;
4027 hrtim_eecr2 &= ~(HRTIM_EECR2_EE10SRC | HRTIM_EECR2_EE10POL | HRTIM_EECR2_EE10SNS);
4028 hrtim_eecr2 |= (pEventCfg->
Source << 24);
4029 hrtim_eecr2 |= (pEventCfg->
Polarity << 24);
4031 hrtim_eecr3 &= ~(HRTIM_EECR3_EE10F);
4032 hrtim_eecr3 |= (pEventCfg->
Filter << 24);
4034 HRTIMx->HRTIM_COMMON.EECR2 = hrtim_eecr2;
4035 HRTIMx->HRTIM_COMMON.EECR3 = hrtim_eecr3;
void HRTIM_ITCommonConfig(HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT, FunctionalState NewState)
Enables or disables the common interrupt request.
void HRTIM_FaultPrescalerConfig(HRTIM_TypeDef *HRTIMx, uint32_t Prescaler)
Configures the fault conditioning block prescaler.
static void HRTIM_TimingUnitBase_Config(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Configures timing unit (timer A to timer E) time base.
#define HRTIM_TIMERID_TIMER_E
#define IS_HRTIM_TIMERUPDATE(TIMERUPDATE)
#define HRTIM_CAPTURETRIGGER_EEV_2
#define IS_HRTIM_COMPAREUNIT_AUTODELAYEDMODE(COMPAREUNIT, AUTODELAYEDMODE)
void HRTIM_Waveform_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct, HRTIM_TimerInitTypeDef *HRTIM_TimerInitStruct)
Initializes a timer operating in waveform mode.
#define HRTIM_OUTPUTSTATE_FAULT
void HRTIM_BurstModeCtl(HRTIM_TypeDef *HRTIMx, uint32_t Enable)
Enables or disables the HRTIMx burst mode controller.
#define HRTIM_BASICOCMODE_INACTIVE
#define HRTIM_OUTPUTSTATE_RUN
#define IS_HRTIM_MODE(MODE)
void HRTIM_DMACmd(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_DMA, FunctionalState NewState)
Enables or disables the HRTIMx's DMA Requests.
void HRTIM_ChopperModeConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_ChopperModeCfgTypeDef *pChopperModeCfg)
Configures the chopper mode feature for a timer.
void HRTIM_SimpleOC_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Initializes the HRTIMx timer in basic output compare mode.
#define HRTIM_COMPAREUNIT_2
void HRTIM_ClearFlag(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG)
Clears the Master and slaves interrupt flags.
#define IS_HRTIM_TIMDEADTIMEINSERTION(TIMDEADTIMEINSERTION)
#define __HRTIM_DISABLE(__HANDLE__, __TIMERS__)
Dead time feature configuration definition.
#define IS_HRTIM_TIMER_OUTPUT(TIMER, OUTPUT)
#define HRTIM_ADCTRIGGER_1
FlagStatus HRTIM_GetFlagStatus(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG)
Checks whether the specified HRTIM flag is set or not.
#define HRTIM_TIMRESETTRIGGER_EEV_2
void HRTIM_SimpleOnePulseChannelConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel, HRTIM_BasicOnePulseChannelCfgTypeDef *pBasicOnePulseChannelCfg)
Configures an output basic one pulse mode.
#define HRTIM_OUTPUTCHOPPERMODE_DISABLED
#define HRTIM_COMPAREUNIT_3
#define HRTIM_OUTPUTSET_TIMCMP1
#define HRTIM_ADCTRIGGER_2
void HRTIM_SimplePWMChannelConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel, HRTIM_BasicPWMChannelCfgTypeDef *pBasicPWMChannelCfg)
Configures an output in basic PWM mode.
#define HRTIM_CAPTURETRIGGER_EEV_7
#define IS_HRTIM_ADCTRIGGER(ADCTRIGGER)
#define IS_HRTIM_ADCTRIGGERUPDATE(ADCTRIGGERUPDATE)
Capture unit configuration definition.
Waveform mode initialization parameters definition.
#define HRTIM_CAPTURETRIGGER_EEV_4
Timer configuration definition.
void HRTIM_SimpleOCChannelConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel, HRTIM_BasicOCChannelCfgTypeDef *pBasicOCChannelCfg)
Configures an output in basic output compare mode.
void HRTIM_SimpleOCStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel)
Stops the output compare signal generation on the designed timer output.
#define HRTIM_TIMERID_TIMER_C
#define HRTIM_CAPTURETRIGGER_EEV_5
#define HRTIM_BASICOCMODE_TOGGLE
void HRTIM_SimplePWMStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel)
Stops the PWM output signal generation on the designed timer output.
void HRTIM_DeInit(HRTIM_TypeDef *HRTIMx)
De-initializes a timer operating in all mode.
#define HRTIM_OUTPUTSTATE_IDLE
#define HRTIM_OUTPUTLEVEL_INACTIVE
HRTIM Configuration Structure definition - Time base related parameters.
#define HRTIM_CAPTURETRIGGER_EEV_1
void HRTIM_EventConfig(HRTIM_TypeDef *HRTIMx, uint32_t Event, HRTIM_EventCfgTypeDef *pEventCfg)
Configures the conditioning of an external event.
#define IS_HRTIM_TIMDELAYEDPROTECTION(TIMDELAYEDPROTECTION)
#define HRTIM_TIMCR_TIMUPDATETRIGGER
void HRTIM_DeadTimeConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_DeadTimeCfgTypeDef *pDeadTimeCfg)
Configures the dead time insertion feature for a timer.
Master synchronization configuration definition.
#define IS_HRTIM_EVENTPRESCALER(EVENTPRESCALER)
#define IS_HRTIM_CAPTUREUNIT(CAPTUREUNIT)
void HRTIM_EventPrescalerConfig(HRTIM_TypeDef *HRTIMx, uint32_t Prescaler)
Configures the external event conditioning block prescaler.
void HRTIM_WaveformCompareConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, HRTIM_CompareCfgTypeDef *pCompareCfg)
Configures the compare unit of a timer operating in waveform mode.
Chopper mode configuration definition.
#define HRTIM_TIMERINDEX_TIMER_A
uint32_t AutoDelayedTimeout
#define HRTIM_TIMRESETTRIGGER_EEV_9
static void HRTIM_OutputConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, HRTIM_OutputCfgTypeDef *OutputCfg)
Configures the output of a timing unit.
uint32_t ChopperModeEnable
void HRTIM_FaultModeCtl(HRTIM_TypeDef *HRTIMx, uint32_t Fault, uint32_t Enable)
Enables or disables the HRTIMx Fault mode.
#define IS_HRTIM_BURSTMODE(BURSTMODE)
#define IS_HRTIM_TIMDEADTIME_FALLINGLOCK(FALLINGLOCK)
void assert_param(int val)
#define IS_HRTIM_OUTPUTBURSTMODEENTRY(OUTPUTBURSTMODEENTRY)
void HRTIM_SimpleCaptureChannelConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel, HRTIM_BasicCaptureChannelCfgTypeDef *pBasicCaptureChannelCfg)
Configures a basic capture.
#define HRTIM_CAPTURETRIGGER_EEV_10
#define HRTIM_FLTR_FLTxEN
#define IS_HRTIM_BURSTMODEPRELOAD(BURSTMODEPRELOAD)
void HRTIM_SimpleCaptureStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel)
Enables a basic capture on the designed capture unit.
#define IS_HRTIM_FAULTCTL(FAULTCTL)
#define HRTIM_OUTPUTLEVEL_ACTIVE
#define HRTIM_OUTPUTRESET_TIMCMP2
#define IS_HRTIM_TIMERRESET(TIMERRESET)
#define IS_HRTIM_TIMDEADTIME_RISINGSIGNLOCK(RISINGSIGNLOCK)
#define IS_HRTIM_DACSYNC(DACSYNC)
uint32_t HRTIM_GetBurstStatus(HRTIM_TypeDef *HRTIMx)
Returns the actual status (active or inactive) of the burst mode controller.
uint32_t HRTIM_GetIdlePushPullStatus(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
Indicates on which output the signal was applied, in push-pull mode balanced fault mode or delayed id...
void HRTIM_SimpleBaseStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
Stops the counter of a timer operating in basic time base mode.
#define IS_HRTIM_TIMDEADTIME_FALLINGSIGNLOCK(FALLINGSIGNLOCK)
static void HRTIM_TIM_ResetConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Event)
Configures the timer counter reset.
#define IS_HRTIM_OUTPUTPOLARITY(OUTPUTPOLARITY)
#define HRTIM_TIMRESETTRIGGER_EEV_6
#define IS_HRTIM_EVENTSRC(EVENTSRC)
#define IS_HRTIM_BASICOCMODE(BASICOCMODE)
#define IS_HRTIM_OUTPUTCHOPPERMODE(OUTPUTCHOPPERMODE)
void HRTIM_WaveformCounterStart(HRTIM_TypeDef *HRTIMx, uint32_t TimersToStart)
Starts the counter of the designated timer(s) operating in waveform mode Timers can be combined (ORed...
#define IS_HRTIM_UPDATEONREPETITION(UPDATEONREPETITION)
External event channel configuration definition.
#define IS_HRTIM_TIMFAULTENABLE(TIMFAULTENABLE)
uint32_t HRTIM_GetDelayedProtectionStatus(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
Returns the level (active or inactive) of the designated output when the delayed protection was trigg...
void HRTIM_WaveformSetOutputLevel(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, uint32_t OutputLevel)
Forces the timer output to its active or inactive state.
#define IS_HRTIM_TIMER_BURSTDMA(TIMER, BURSTDMA)
#define HRTIM_COMPAREUNIT_4
#define IS_HRTIM_BURSTMODECTL(BURSTMODECTL)
void HRTIM_SimpleCaptureStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel)
Disables a basic capture on the designed capture unit.
static void HRTIM_MasterWaveform_Config(HRTIM_TypeDef *HRTIMx, HRTIM_TimerInitTypeDef *TimerInit)
Configures the master timer in waveform mode.
uint32_t EventSensitivity
uint32_t EventSensitivity
void HRTIM_WaveformCaptureConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, HRTIM_CaptureCfgTypeDef *pCaptureCfg)
Configures the capture unit of a timer operating in waveform mode.
void HRTIM_FaultConfig(HRTIM_TypeDef *HRTIMx, HRTIM_FaultCfgTypeDef *pFaultCfg, uint32_t Fault)
Configures the conditioning of fault input.
#define HRTIM_TIMERINDEX_TIMER_C
#define IS_HRTIM_FAULTPOLARITY(HRTIM_FAULTPOLARITY)
#define IS_HRTIM_TIMFAULTLOCK(TIMFAULTLOCK)
void HRTIM_WaveformCounterStop(HRTIM_TypeDef *HRTIMx, uint32_t TimersToStop)
Stops the counter of the designated timer(s) operating in waveform mode Timers can be combined (ORed)...
#define HRTIM_TIMEVENTFILTER_NONE
static void HRTIM_MasterBase_Config(HRTIM_TypeDef *HRTIMx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruc)
Configures the master timer time base.
#define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)
Output configuration definition.
#define IS_HRTIM_TIMERBURSTMODE(TIMERBURSTMODE)
#define HRTIM_TIMERID_TIMER_D
uint32_t RepetitionUpdate
#define HRTIM_TIMERINDEX_TIMER_B
#define IS_HRTIM_HALFMODE(HALFMODE)
Compare unit configuration definition.
#define IS_HRTIM_EVENTSENSITIVITY(EVENTSENSITIVITY)
#define HRTIM_OUTPUTSET_TIMPER
#define HRTIM_OUTPUTRESET_TIMCMP1
#define HRTIM_TIMERID_TIMER_B
#define HRTIM_TIMERINDEX_TIMER_D
#define IS_HRTIM_OUTPUTIDLESTATE(OUTPUTIDLESTATE)
#define HRTIM_CAPTUREUNIT_1
void HRTIM_SimpleOnePulseStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel)
Disables the basic one pulse signal generation on the designed output.
#define IS_HRTIM_TIMEVENTLATCH(TIMEVENTLATCH)
static void HRTIM_ExternalEventConfig(HRTIM_TypeDef *HRTIMx, uint32_t Event, HRTIM_EventCfgTypeDef *EventCfg)
Configures an external event channel.
This file contains all the functions prototypes for the HRTIM firmware library.
void HRTIM_SimplePWM_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Initializes the HRTIMx timer in basic PWM mode.
void HRTIM_ITConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT, FunctionalState NewState)
Enables or disables the Master and slaves interrupt request.
ADC trigger configuration definition.
void HRTIM_MasterSetCompare(HRTIM_TypeDef *HRTIMx, uint32_t CompareUnit, uint32_t Compare)
Sets the HRTIMx Master Comparex Register value.
#define HRTIM_TIMRESETTRIGGER_EEV_3
#define HRTIM_CAPTURETRIGGER_EEV_3
void HRTIM_SimpleOnePulseStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel)
Enables the basic one pulse signal generation on the designed output.
#define HRTIM_AUTODELAYEDMODE_REGULAR
void HRTIM_WaveformTimerConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_TimerCfgTypeDef *pTimerCfg)
Configures the general behavior of a timer operating in waveform mode.
void HRTIM_ClearCommonITPendingBit(HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT)
Clears the common interrupt pending bits.
void HRTIM_SimpleBaseStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
Starts the counter of a timer operating in basic time base mode.
#define IS_HRTIM_UPDATEGATING_TIM(UPDATEGATING)
#define HRTIM_TIMERID_MASTER
#define IS_HRTIM_EVENT(EVENT)
void HRTIM_WaveformOutputStop(HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStop)
Disables the generation of the waveform signal on the designated output(s) Outputs can be combined (O...
Burst mode configuration definition.
#define HRTIM_ADCTRIGGER_4
uint32_t RepetitionCounter
#define HRTIM_CAPTURETRIGGER_EEV_9
Basic output compare mode configuration definition.
#define IS_HRTIM_FAULTFILTER(FAULTFILTER)
void HRTIM_WaveformOutputConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, HRTIM_OutputCfgTypeDef *pOutputCfg)
Configures the output of a timer operating in waveform mode.
#define HRTIM_TIMRESETTRIGGER_EEV_8
#define HRTIM_CAPTURETRIGGER_EEV_6
Basic PWM output mode configuration definition.
#define IS_HRTIM_SYNCOUTPUTSOURCE(SYNCOUTPUTSOURCE)
External event filtering in timing units configuration definition.
void HRTIM_SimpleBase_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Initializes the HRTIMx timer in basic time base mode.
void HRTIM_TimerEventFilteringConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Event, HRTIM_TimerEventFilteringCfgTypeDef *pTimerEventFilteringCfg)
Configures the event filtering capabilities of a timer (blanking, windowing)
#define IS_HRTIM_EVENTPOLARITY(EVENTPOLARITY)
uint32_t HRTIM_WaveformGetOutputLevel(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
Returns actual level (active or inactive) of the designated output.
void HRTIM_ADCTriggerConfig(HRTIM_TypeDef *HRTIMx, uint32_t ADCTrigger, HRTIM_ADCTriggerCfgTypeDef *pADCTriggerCfg)
Configures both the ADC trigger register update source and the ADC trigger source.
uint32_t HRTIM_WaveformGetOutputState(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
Returns actual state (RUN, IDLE, FAULT) of the designated output.
#define IS_HRTIM_TIMEVENTFILTER(TIMEVENTFILTER)
void HRTIM_SynchronizationConfig(HRTIM_TypeDef *HRTIMx, HRTIM_SynchroCfgTypeDef *pSynchroCfg)
Configures the external input/output synchronization of the HRTIMx.
uint32_t BurstModeEntryDelayed
#define IS_HRTIM_OUTPUTFAULTSTATE(OUTPUTFAULTSTATE)
#define HRTIM_TIMRESETTRIGGER_EEV_4
#define IS_HRTIM_TIMDEADTIME_FALLINGSIGN(FALLINGSIGN)
#define IS_HRTIM_FAULTSOURCE(FAULTSOURCE)
#define IS_HRTIM_FAULTPRESCALER(FAULTPRESCALER)
#define IS_HRTIM_TIMPUSHPULLMODE(TIMPUSHPULLMODE)
#define HRTIM_BASICOCMODE_ACTIVE
#define RCC_APB2Periph_HRTIM1
uint32_t DeadTimeInsertion
void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
Forces or releases High Speed APB (APB2) peripheral reset.
#define HRTIM_TIMRESETTRIGGER_EEV_10
#define IS_HRTIM_COMPAREUNIT(COMPAREUNIT)
void HRTIM_SimplePWMStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel)
Starts the PWM output signal generation on the designed timer output.
#define HRTIM_CAPTURETRIGGER_EEV_8
#define IS_HRTIM_HRTIM_BURSTMODEPRESCALER(BURSTMODEPRESCALER)
void HRTIM_BurstDMAConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t RegistersToUpdate)
Configures the burst DMA controller for a timer.
Basic One Pulse mode configuration definition.
#define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1
void HRTIM_SoftwareUpdate(HRTIM_TypeDef *HRTIMx, uint32_t TimersToUpdate)
Triggers the update of the registers of one or several timers.
#define IS_HRTIM_UPDATEGATING_MASTER(UPDATEGATING)
uint32_t DelayedProtectionMode
void HRTIM_SlaveSetCompare(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, uint32_t Compare)
Sets the HRTIMx Slave Comparex Register value.
#define HRTIM_TIMERINDEX_TIMER_E
#define HRTIM_CAPTUREUNIT_2
void HRTIM_SoftwareCapture(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit)
Triggers a software capture on the designed capture unit.
#define IS_HRTIM_OUTPUTIDLEMODE(OUTPUTIDLEMODE)
#define IS_HRTIM_TIMRESETTRIGGER(TIMRESETTRIGGER)
#define HRTIM_TIMERID_TIMER_A
#define IS_HRTIM_SYNCOUTPUTPOLARITY(SYNCOUTPUTPOLARITY)
#define HRTIM_TIMRESETTRIGGER_EEV_1
static void HRTIM_CaptureUnitConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, uint32_t Event)
Configures a capture unit.
uint32_t SyncOutputSource
#define IS_HRTIM_FAULT(FAULT)
#define IS_HRTIM_TIMUPDATEONRESET(TIMUPDATEONRESET)
#define IS_HRTIM_OUTPUTLEVEL(OUTPUTLEVEL)
#define HRTIM_EVENTFASTMODE_DISABLE
#define HRTIM_OUTPUTBURSTMODEENTRY_REGULAR
#define IS_HRTIM_PRELOAD(PRELOAD)
#define IS_HRTIM_BURSTMODECLOCKSOURCE(BURSTMODECLOCKSOURCE)
#define IS_HRTIM_CALIBRATIONRATE(CALIBRATIONRATE)
void HRTIM_SimpleOnePulse_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Initializes the HRTIMx timer in basic one pulse mode.
#define HRTIM_ADCTRIGGER_3
#define HRTIM_OUTPUTSET_NONE
#define __HRTIM_ENABLE(__HANDLE__, __TIMERS__)
Enables or disables the timer counter(s)
#define HRTIM_TIMERINDEX_MASTER
#define IS_HRTIM_FAULTLOCK(FAULTLOCK)
ITStatus HRTIM_GetITStatus(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT)
Checks whether the specified HRTIM interrupt has occurred or not.
Fault channel configuration definition.
void HRTIM_SoftwareReset(HRTIM_TypeDef *HRTIMx, uint32_t TimersToReset)
Triggers the reset of one or several timers.
ITStatus HRTIM_GetCommonITStatus(HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT)
Checks whether the specified HRTIM common interrupt has occurred or not.
#define HRTIM_UPDATEONREPETITION_ENABLED
#define HRTIM_OUTPUTRESET_NONE
#define IS_HRTIM_EVENTFILTER(EVENTFILTER)
FlagStatus HRTIM_GetCommonFlagStatus(HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonFLAG)
Checks whether the specified HRTIM common flag is set or not.
void HRTIM_ClearCommonFlag(HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonFLAG)
Clears the common interrupt flags.
#define HRTIM_OUTPUTIDLEMODE_NONE
uint32_t SyncOutputPolarity
#define HRTIM_COMPAREUNIT_1
Basic capture mode configuration definition.
void HRTIM_DLLCalibrationStart(HRTIM_TypeDef *HRTIMx, uint32_t CalibrationRate)
Starts the DLL calibration.
static void HRTIM_TimingUnitWaveform_Config(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_TimerInitTypeDef *TimerInit)
Configures timing unit (timer A to timer E) in waveform mode.
void HRTIM_WaveformOutputStart(HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStart)
Enables the generation of the waveform signal on the designated output(s) Outputs can be combined (OR...
void HRTIM_BurstModeConfig(HRTIM_TypeDef *HRTIMx, HRTIM_BurstModeCfgTypeDef *pBurstModeCfg)
Configures the burst mode feature of the HRTIMx.
#define IS_HRTIM_TIMERINDEX(TIMERINDEX)
static void HRTIM_CompareUnitConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, HRTIM_CompareCfgTypeDef *CompareCfg)
Configures a compare unit.
void HRTIM_SimpleOCStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel)
Starts the output compare signal generation on the designed timer output.
uint32_t HRTIM_GetCapturedValue(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit)
Returns actual value of the capture register of the designated capture unit.
#define IS_HRTIM_EVENTFASTMODE(EVENTFASTMODE)
static uint32_t TimerIdxToTimerId[]
#define IS_HRTIM_TIMING_UNIT(TIMERINDEX)
#define IS_HRTIM_TIMUPDATETRIGGER(TIMUPDATETRIGGER)
void HRTIM_ClearITPendingBit(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT)
Clears the Master and slaves interrupt request pending bits.
#define IS_HRTIM_TIMDEADTIME_RISINGLOCK(RISINGLOCK)
#define HRTIM_SINGLE_CALIBRATION
#define HRTIM_TIMRESETTRIGGER_EEV_5
uint32_t HRTIM_GetCurrentPushPullStatus(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
Indicates on which output the signal is currently active (when the push pull mode is enabled) ...
#define HRTIM_OUTPUTSET_TIMCMP2
#define HRTIM_OUTPUTFAULTSTATE_NONE
#define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3
#define HRTIM_CAPTURETRIGGER_NONE
#define HRTIM_TIMRESETTRIGGER_EEV_7
void HRTIM_SimpleCapture_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
Initializes a timer operating in basic capture mode.