60 #if (defined(PDL_PERIPHERAL_MFT_OCU_ACTIVE))
72 #define OCU_INSTANCE_COUNT (uint32_t)(sizeof(m_astcMftOcuInstanceDataLut) \
73 / sizeof(m_astcMftOcuInstanceDataLut[0]))
81 #if (PDL_PERIPHERAL_ENABLE_MFT0_OCU == PDL_ON)
87 #if (PDL_PERIPHERAL_ENABLE_MFT1_OCU == PDL_ON)
93 #if (PDL_PERIPHERAL_ENABLE_MFT2_OCU == PDL_ON)
128 uint32_t u32Instance;
132 if (pstcOcu == m_astcMftOcuInstanceDataLut[u32Instance].pstcInstance)
134 return &m_astcMftOcuInstanceDataLut[u32Instance].
stcInternData;
141 #if (PDL_INTERRUPT_ENABLE_MFT0_OCU == PDL_ON) || \
142 (PDL_INTERRUPT_ENABLE_MFT1_OCU == PDL_ON) || \
143 (PDL_INTERRUPT_ENABLE_MFT2_OCU == PDL_ON)
174 funCallBack = (
func_ptr_t)(*(uint32_t*)((uint32_t)ptemp +
177 if(funCallBack != NULL)
198 #if (PDL_INTERRUPT_ENABLE_MFT0_OCU == PDL_ON)
201 NVIC_ClearPendingIRQ(OCU0_IRQn);
202 NVIC_EnableIRQ(OCU0_IRQn);
206 #if (PDL_INTERRUPT_ENABLE_MFT1_OCU == PDL_ON)
209 NVIC_ClearPendingIRQ(OCU1_IRQn);
210 NVIC_EnableIRQ(OCU1_IRQn);
214 #if (PDL_INTERRUPT_ENABLE_MFT2_OCU == PDL_ON)
217 NVIC_ClearPendingIRQ(OCU2_IRQn);
218 NVIC_EnableIRQ(OCU2_IRQn);
236 if((pstcMft->OCSA10_f.IOE0 == 0) && (pstcMft->OCSA10_f.IOE1 == 0) &&
237 (pstcMft->OCSA32_f.IOE0 == 0) && (pstcMft->OCSA10_f.IOE1 == 0) &&
238 (pstcMft->OCSA54_f.IOE0 == 0) && (pstcMft->OCSA10_f.IOE1 == 0) )
240 #if (PDL_INTERRUPT_ENABLE_MFT0_OCU == PDL_ON)
243 NVIC_ClearPendingIRQ(OCU0_IRQn);
244 NVIC_DisableIRQ(OCU0_IRQn);
249 #if (PDL_INTERRUPT_ENABLE_MFT1_OCU == PDL_ON)
252 NVIC_ClearPendingIRQ(OCU1_IRQn);
253 NVIC_DisableIRQ(OCU1_IRQn);
257 #if (PDL_INTERRUPT_ENABLE_MFT2_OCU == PDL_ON)
260 NVIC_ClearPendingIRQ(OCU2_IRQn);
261 NVIC_DisableIRQ(OCU2_IRQn);
298 stc_mft_ocu_ocsb10_field_t* pstcOCSB;
300 stc_mft_ocu_ocsd10_field_t* pstcOCSD;
303 if ( (pstcMft == NULL) ||
306 (pstcOcuConfig->
bFm4 > 1) ||
307 (pstcOcuConfig->
bCmod > 1) ||
316 if ( pstcOcuInternData != NULL )
327 p32OCFS = (uint8_t*)((uint8_t*)pstcMft + 0x68UL + u8Ch/2);
328 pstcOCSB = (stc_mft_ocu_ocsb10_field_t*)((uint8_t*)pstcMft + 0x19UL + (u8Ch/2)*4);
329 p8OCSC = (uint8_t*)((uint8_t*)pstcMft + 0x25UL);
330 pstcOCSD = (stc_mft_ocu_ocsd10_field_t*)((uint8_t*)pstcMft + 0x1AUL + (u8Ch/2)*4);
333 pstcOCSB->CMOD = pstcOcuConfig->
bCmod;
334 pstcOCSB->FM4 = pstcOcuConfig->
bFm4;
337 *p8OCSC = pstcOcuConfig->
u8Mod;
384 if ( (pstcMft == NULL)
386 || (pstcConfig == NULL)
401 p16OCSE0 = (uint16_t*)((uint8_t*)pstcMft + 0x28UL + EvenCh*4);
440 if ( (pstcMft == NULL)
464 p32OCSE1 = (uint32_t*)((uint8_t*)pstcMft + 0x28UL + OddCh*4);
506 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
509 if ( (pstcMft == NULL)
516 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
549 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
552 if ( (pstcMft == NULL)
559 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
574 #if (PDL_INTERRUPT_ENABLE_MFT0_OCU == PDL_ON) || \
575 (PDL_INTERRUPT_ENABLE_MFT1_OCU == PDL_ON) || \
576 (PDL_INTERRUPT_ENABLE_MFT2_OCU == PDL_ON)
599 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
602 if ( (pstcMft == NULL)
612 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
628 *fnCallback = pfnCallback;
654 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
657 if ( (pstcMft == NULL)
667 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
668 pstcOcuInternData = pstcOcuInternData + (
sizeof(pstcOcuInternData)) * u8Ch;
681 pstcOcuInternData = NULL;
706 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
710 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
743 stc_mft_ocu_ocsa10_field_t* pstcOCSA;
746 if ( (pstcMft == NULL)
753 pstcOCSA = (stc_mft_ocu_ocsa10_field_t*)((uint8_t*)pstcMft + 0x18UL + (u8Ch/2)*4);
784 stc_mft_ocu_ocsb10_field_t* pstcOCSB;
788 pstcOCSB = (stc_mft_ocu_ocsb10_field_t*)((uint8_t*)pstcMft + 0x19UL + (u8Ch/2)*4);
820 uint8_t u8Ch, uint16_t u16Occp)
825 if ( (pstcMft == NULL)
831 p16OCCP = (uint16_t*)((uint8_t*)pstcMft + 0x02 + u8Ch*4);
857 if ( (pstcMft == NULL)
863 p16OCCP = (uint16_t*)((uint8_t*)pstcMft + 0x02 + u8Ch*4);
865 return (uint16_t)((*p16OCCP) & 0xFFFF);
870 #endif // #if (defined(PDL_PERIPHERAL_$$X_ACTIVE))