58 #if (defined(PDL_PERIPHERAL_MFT_FRT_ACTIVE))
70 #define FRT_INSTANCE_COUNT (uint32_t)(sizeof(m_astcMftFrtInstanceDataLut) \
71 / sizeof(m_astcMftFrtInstanceDataLut[0]))
79 #if (PDL_PERIPHERAL_ENABLE_MFT0_FRT == PDL_ON)
85 #if (PDL_PERIPHERAL_ENABLE_MFT1_FRT == PDL_ON)
91 #if (PDL_PERIPHERAL_ENABLE_MFT2_FRT == PDL_ON)
123 uint32_t u32Instance;
127 if (pstcFrt == m_astcMftFrtInstanceDataLut[u32Instance].pstcInstance)
129 return &m_astcMftFrtInstanceDataLut[u32Instance].
stcInternData;
136 #if (PDL_INTERRUPT_ENABLE_MFT0_FRT == PDL_ON) || \
137 (PDL_INTERRUPT_ENABLE_MFT1_FRT == PDL_ON) || \
138 (PDL_INTERRUPT_ENABLE_MFT2_FRT == PDL_ON)
159 static uint32_t* ptemp;
172 funCallBack = (
func_ptr_t)(*(uint32_t*)((uint32_t)ptemp +
175 if(funCallBack != NULL)
192 funCallBack = (
func_ptr_t)(*(uint32_t*)((uint32_t)ptemp +
196 if(funCallBack != NULL)
218 #if (PDL_INTERRUPT_ENABLE_MFT0_FRT == PDL_ON)
223 NVIC_ClearPendingIRQ(FRT0_ZERO_IRQn);
224 NVIC_EnableIRQ(FRT0_ZERO_IRQn);
229 NVIC_ClearPendingIRQ(FRT0_PEAK_IRQn);
230 NVIC_EnableIRQ(FRT0_PEAK_IRQn);
235 #if (PDL_INTERRUPT_ENABLE_MFT1_FRT == PDL_ON)
240 NVIC_ClearPendingIRQ(FRT1_ZERO_IRQn);
241 NVIC_EnableIRQ(FRT1_ZERO_IRQn);
246 NVIC_ClearPendingIRQ(FRT1_PEAK_IRQn);
247 NVIC_EnableIRQ(FRT1_PEAK_IRQn);
252 #if (PDL_INTERRUPT_ENABLE_MFT2_FRT == PDL_ON)
257 NVIC_ClearPendingIRQ(FRT2_ZERO_IRQn);
258 NVIC_EnableIRQ(FRT2_ZERO_IRQn);
263 NVIC_ClearPendingIRQ(FRT2_PEAK_IRQn);
264 NVIC_EnableIRQ(FRT2_PEAK_IRQn);
288 if ((pstcMft == NULL))
292 #if (PDL_INTERRUPT_ENABLE_MFT0_FRT == PDL_ON)
297 if((pstcMft->TCSA0_f.IRQZE == 0) && (pstcMft->TCSA1_f.IRQZE == 0) && (pstcMft->TCSA2_f.IRQZE == 0))
299 NVIC_ClearPendingIRQ(FRT0_ZERO_IRQn);
300 NVIC_DisableIRQ(FRT0_ZERO_IRQn);
306 if((pstcMft->TCSA0_f.ICRE == 0) && (pstcMft->TCSA1_f.ICRE == 0) && (pstcMft->TCSA2_f.ICRE == 0))
308 NVIC_ClearPendingIRQ(FRT0_PEAK_IRQn);
309 NVIC_DisableIRQ(FRT0_PEAK_IRQn);
315 #if (PDL_INTERRUPT_ENABLE_MFT1_FRT == PDL_ON)
320 if((pstcMft->TCSA0_f.IRQZE == 0) && (pstcMft->TCSA1_f.IRQZE == 0) && (pstcMft->TCSA2_f.IRQZE == 0))
322 NVIC_ClearPendingIRQ(FRT1_ZERO_IRQn);
323 NVIC_DisableIRQ(FRT1_ZERO_IRQn);
329 if((pstcMft->TCSA0_f.ICRE == 0) && (pstcMft->TCSA1_f.ICRE == 0) && (pstcMft->TCSA2_f.ICRE == 0))
331 NVIC_ClearPendingIRQ(FRT1_PEAK_IRQn);
332 NVIC_DisableIRQ(FRT1_PEAK_IRQn);
339 #if (PDL_INTERRUPT_ENABLE_MFT2_FRT == PDL_ON)
344 if((pstcMft->TCSA0_f.IRQZE == 0) && (pstcMft->TCSA1_f.IRQZE == 0) && (pstcMft->TCSA2_f.IRQZE == 0))
346 NVIC_ClearPendingIRQ(FRT2_ZERO_IRQn);
347 NVIC_DisableIRQ(FRT2_ZERO_IRQn);
353 if((pstcMft->TCSA0_f.ICRE == 0) && (pstcMft->TCSA1_f.ICRE == 0) && (pstcMft->TCSA2_f.ICRE == 0))
355 NVIC_ClearPendingIRQ(FRT2_PEAK_IRQn);
356 NVIC_DisableIRQ(FRT2_PEAK_IRQn);
394 stc_mft_frt_tcsa0_field_t* pstcTCSA;
397 if ((pstcMft == NULL) ||
398 (pstcFrtConfig == NULL) ||
410 if ( pstcFrtInternData != NULL )
421 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft + 0x48 + u8Ch*0x0C);
430 pstcTCSA->MODE = pstcFrtConfig->
enFrtMode;
433 pstcTCSA->BFE = pstcFrtConfig->
bEnBuffer;
460 uint8_t u8Ch, uint8_t u8Times)
462 stc_mft_frt_tcsc0_field_t* pstcTCSC;
465 if ( (pstcMft == NULL) ||
473 pstcTCSC=(stc_mft_frt_tcsc0_field_t*)((uint8_t*)pstcMft+0x4AUL+u8Ch*0x0C);
475 pstcTCSC->MSZI = u8Times;
498 stc_mft_frt_tcsc0_field_t* pstcTCSC;
501 if ( (pstcMft == NULL)
508 pstcTCSC = (stc_mft_frt_tcsc0_field_t*)((uint8_t*)pstcMft+0x4AUL+u8Ch*0x0C);
510 return (uint8_t)pstcTCSC->MSZC;
531 uint8_t u8Ch, uint8_t u8Times)
533 stc_mft_frt_tcsc0_field_t* pstcTCSC;
536 if ( (pstcMft == NULL) ||
544 pstcTCSC = (stc_mft_frt_tcsc0_field_t*)((uint8_t*)pstcMft+0x4AUL+u8Ch*0x0C);
546 pstcTCSC->MSPI = u8Times;
569 stc_mft_frt_tcsc0_field_t* pstcTCSC;
572 if ( (pstcMft == NULL)
579 pstcTCSC = (stc_mft_frt_tcsc0_field_t*)((uint8_t*)pstcMft+0x4AUL+u8Ch*0x0C);
581 return (uint8_t)pstcTCSC->MSPC;
602 stc_mft_frt_tcsa0_field_t* pstcTCSA;
605 if ( (pstcMft == NULL)
612 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
636 stc_mft_frt_tcsa0_field_t* pstcTCSA;
639 if ( (pstcMft == NULL)
646 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
653 #if (PDL_INTERRUPT_ENABLE_MFT0_FRT == PDL_ON) || \
654 (PDL_INTERRUPT_ENABLE_MFT1_FRT == PDL_ON) || \
655 (PDL_INTERRUPT_ENABLE_MFT2_FRT == PDL_ON)
684 stc_mft_frt_tcsa0_field_t* pstcTCSA;
688 if ( (pstcMft == NULL)
700 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
776 stc_mft_frt_tcsa0_field_t* pstcTCSA;
779 if ( (pstcMft == NULL)
788 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
828 stc_mft_frt_tcsa0_field_t* pstcTCSA;
832 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
870 stc_mft_frt_tcsa0_field_t* pstcTCSA;
873 if ( (pstcMft == NULL)
880 pstcTCSA = (stc_mft_frt_tcsa0_field_t*)((uint8_t*)pstcMft+0x48UL+u8Ch*0x0C);
915 uint8_t u8Ch, uint16_t u16Cycle)
920 if ( (pstcMft == NULL)
927 pstcTCCP = (uint16_t*)( (uint8_t*)pstcMft + 0x42UL + u8Ch*0x0C);
929 *pstcTCCP = u16Cycle;
954 uint8_t u8Ch,uint16_t u16Count)
959 if ( (pstcMft == NULL)
966 pstcTCDT = (uint16_t*)( (uint8_t*)pstcMft + 0x46UL + u8Ch*0x0C);
968 *pstcTCDT = u16Count;
993 if ( (pstcMft == NULL)
1000 pstcTCDT = (uint16_t*)( (uint8_t*)pstcMft + 0x46UL + u8Ch*0x0C);
1002 retTCDT = *pstcTCDT;
1009 #endif // #if (defined(PDL_PERIPHERAL_$$X_ACTIVE))