57 #if (defined(PDL_PERIPHERAL_BT_ACTIVE))
68 #define BT_INSTANCE_COUNT (uint32_t)(sizeof(m_astcBtInstanceDataLut) / sizeof(m_astcBtInstanceDataLut[0]))
76 #if (PDL_PERIPHERAL_ENABLE_BT0 == PDL_ON)
82 #if (PDL_PERIPHERAL_ENABLE_BT1 == PDL_ON)
88 #if (PDL_PERIPHERAL_ENABLE_BT2 == PDL_ON)
94 #if (PDL_PERIPHERAL_ENABLE_BT3 == PDL_ON)
100 #if (PDL_PERIPHERAL_ENABLE_BT4 == PDL_ON)
106 #if (PDL_PERIPHERAL_ENABLE_BT5 == PDL_ON)
112 #if (PDL_PERIPHERAL_ENABLE_BT6 == PDL_ON)
118 #if (PDL_PERIPHERAL_ENABLE_BT7 == PDL_ON)
124 #if (PDL_PERIPHERAL_ENABLE_BT8 == PDL_ON)
130 #if (PDL_PERIPHERAL_ENABLE_BT9 == PDL_ON)
136 #if (PDL_PERIPHERAL_ENABLE_BT10 == PDL_ON)
142 #if (PDL_PERIPHERAL_ENABLE_BT11 == PDL_ON)
148 #if (PDL_PERIPHERAL_ENABLE_BT12 == PDL_ON)
154 #if (PDL_PERIPHERAL_ENABLE_BT13 == PDL_ON)
160 #if (PDL_PERIPHERAL_ENABLE_BT14 == PDL_ON)
166 #if (PDL_PERIPHERAL_ENABLE_BT15 == PDL_ON)
185 uint32_t u32Instance;
189 if (pstcBt == m_astcBtInstanceDataLut[u32Instance].pstcInstance)
198 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON) || \
199 (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON) || \
200 (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON) || \
201 (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON) || \
202 (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON) || \
203 (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON) || \
204 (PDL_INTERRUPT_ENABLE_BT12 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT13 == PDL_ON) || \
205 (PDL_INTERRUPT_ENABLE_BT14 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT15 == PDL_ON)
225 if ((u8Irq & (1ul<<2)) == (1ul<<2))
228 pstcBt->STC &= ~(1ul<<2);
238 if ((u8Irq & (1ul<<1)) == (1ul<<1))
241 pstcBt->STC &= ~(1ul<<1);
254 if ((u8Irq & 1ul) == 1ul)
277 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON)
280 NVIC_ClearPendingIRQ(BT0_IRQn);
281 NVIC_EnableIRQ(BT0_IRQn);
285 #if (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON)
288 NVIC_ClearPendingIRQ(BT1_IRQn);
289 NVIC_EnableIRQ(BT1_IRQn);
293 #if (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON)
296 NVIC_ClearPendingIRQ(BT2_IRQn);
297 NVIC_EnableIRQ(BT2_IRQn);
301 #if (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON)
304 NVIC_ClearPendingIRQ(BT3_IRQn);
305 NVIC_EnableIRQ(BT3_IRQn);
309 #if (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON)
312 NVIC_ClearPendingIRQ(BT4_IRQn);
313 NVIC_EnableIRQ(BT4_IRQn);
317 #if (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON)
320 NVIC_ClearPendingIRQ(BT5_IRQn);
321 NVIC_EnableIRQ(BT5_IRQn);
325 #if (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON)
328 NVIC_ClearPendingIRQ(BT6_IRQn);
329 NVIC_EnableIRQ(BT6_IRQn);
333 #if (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON)
336 NVIC_ClearPendingIRQ(BT7_IRQn);
337 NVIC_EnableIRQ(BT7_IRQn);
341 #if (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON)
344 NVIC_ClearPendingIRQ(BT8_IRQn);
345 NVIC_EnableIRQ(BT8_IRQn);
349 #if (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON)
352 NVIC_ClearPendingIRQ(BT9_IRQn);
353 NVIC_EnableIRQ(BT9_IRQn);
357 #if (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON)
360 NVIC_ClearPendingIRQ(BT10_IRQn);
361 NVIC_EnableIRQ(BT10_IRQn);
365 #if (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON)
368 NVIC_ClearPendingIRQ(BT11_IRQn);
369 NVIC_EnableIRQ(BT11_IRQn);
373 #if (PDL_INTERRUPT_ENABLE_BT12_13_14_15 == PDL_ON)
377 NVIC_ClearPendingIRQ(BT12_13_14_15_IRQn);
378 NVIC_EnableIRQ(BT12_13_14_15_IRQn);
393 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON)
396 NVIC_ClearPendingIRQ(BT0_IRQn);
397 NVIC_DisableIRQ(BT0_IRQn);
401 #if (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON)
404 NVIC_ClearPendingIRQ(BT1_IRQn);
405 NVIC_DisableIRQ(BT1_IRQn);
409 #if (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON)
412 NVIC_ClearPendingIRQ(BT2_IRQn);
413 NVIC_DisableIRQ(BT2_IRQn);
417 #if (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON)
420 NVIC_ClearPendingIRQ(BT3_IRQn);
421 NVIC_DisableIRQ(BT3_IRQn);
425 #if (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON)
428 NVIC_ClearPendingIRQ(BT4_IRQn);
429 NVIC_DisableIRQ(BT4_IRQn);
433 #if (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON)
436 NVIC_ClearPendingIRQ(BT5_IRQn);
437 NVIC_DisableIRQ(BT5_IRQn);
441 #if (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON)
444 NVIC_ClearPendingIRQ(BT6_IRQn);
445 NVIC_DisableIRQ(BT6_IRQn);
449 #if (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON)
452 NVIC_ClearPendingIRQ(BT7_IRQn);
453 NVIC_DisableIRQ(BT7_IRQn);
457 #if (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON)
460 NVIC_ClearPendingIRQ(BT8_IRQn);
461 NVIC_DisableIRQ(BT8_IRQn);
465 #if (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON)
468 NVIC_ClearPendingIRQ(BT9_IRQn);
469 NVIC_DisableIRQ(BT9_IRQn);
473 #if (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON)
476 NVIC_ClearPendingIRQ(BT10_IRQn);
477 NVIC_DisableIRQ(BT10_IRQn);
481 #if (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON)
484 NVIC_ClearPendingIRQ(BT11_IRQn);
485 NVIC_DisableIRQ(BT11_IRQn);
489 #if (PDL_INTERRUPT_ENABLE_BT12_13_14_15 == PDL_ON)
494 if(((FM4_BT12_PWM->STC & 0x70u) == 0x00u) &&
495 ((FM4_BT13_PWM->STC & 0x70u) == 0x00u) &&
496 ((FM4_BT14_PWM->STC & 0x70u) == 0x00u) &&
497 ((FM4_BT15_PWM->STC & 0x70u) == 0x00u) )
499 NVIC_ClearPendingIRQ(BT12_13_14_15_IRQn);
500 NVIC_DisableIRQ(BT12_13_14_15_IRQn);
527 if ((pstcBt == NULL) || (enIoMode >
BtIoMode8))
535 if(pstcBtInternData == NULL)
540 if((pstcBt == &
BT0) || (pstcBt == &
BT1))
542 FM4_BTIOSEL03->BTSEL0123 &= 0xF0;
543 FM4_BTIOSEL03->BTSEL0123 |= enIoMode;
545 else if((pstcBt == &
BT2) || (pstcBt == &
BT3))
547 FM4_BTIOSEL03->BTSEL0123 &= 0x0F;
548 FM4_BTIOSEL03->BTSEL0123 |= (enIoMode<<4);
550 else if((pstcBt == &
BT4) || (pstcBt == &
BT5))
552 FM4_BTIOSEL47->BTSEL4567 &= 0xF0;
553 FM4_BTIOSEL47->BTSEL4567 |= enIoMode;
555 else if((pstcBt == &
BT6) || (pstcBt == &
BT7))
557 FM4_BTIOSEL47->BTSEL4567 &= 0x0F;
558 FM4_BTIOSEL47->BTSEL4567 |= (enIoMode<<4);
560 else if((pstcBt == &
BT8) || (pstcBt == &
BT9))
562 FM4_BTIOSEL8B->BTSEL89AB &= 0xF0;
563 FM4_BTIOSEL8B->BTSEL89AB |= enIoMode;
565 else if((pstcBt == &
BT10) || (pstcBt == &
BT11))
567 FM4_BTIOSEL8B->BTSEL89AB &= 0x0F;
568 FM4_BTIOSEL8B->BTSEL89AB |= (enIoMode<<4);
570 else if((pstcBt == &
BT12) || (pstcBt == &
BT13))
572 FM4_BTIOSELCF->BTSELCDEF &= 0xF0;
573 FM4_BTIOSELCF->BTSELCDEF |= enIoMode;
575 else if((pstcBt == &
BT14) || (pstcBt == &
BT15))
577 FM4_BTIOSELCF->BTSELCDEF &= 0x0F;
578 FM4_BTIOSELCF->BTSELCDEF |= (enIoMode<<4);
600 if ((pstcBt == NULL) || (enTimerMode >
BtPwcMode))
608 if(pstcBtInternData == NULL)
613 pstcBt->TMCR &= ~(7ul<<4);
614 pstcBt->TMCR |= (enTimerMode<<4);
632 volatile FM4_BT_PWM_TypeDef* pRegBt = (FM4_BT_PWM_TypeDef*)pstcBt;
654 if(pstcBtInternData == NULL)
662 pRegBt->TMCR2 = 0x00;
663 pRegBt->TMCR &= ~(7ul<<12);
664 pRegBt->TMCR |= (pstcPwmConfig->
enPres<<12);
668 pRegBt->TMCR2 = 0x01;
669 pRegBt->TMCR &= ~(7ul<<12);
670 pRegBt->TMCR |= ((pstcPwmConfig->
enPres & 0x7)<<12);
679 pRegBt->TMCR &= ~(3ul<<8);
680 pRegBt->TMCR |= (pstcPwmConfig->
enExtTrig<<8);
682 pRegBt->TMCR_f.MDSE = pstcPwmConfig->
enMode;
703 ((FM4_BT_PWM_TypeDef*)pstcBt)->TMCR_f.CTEN = 1;
724 ((FM4_BT_PWM_TypeDef*)pstcBt)->TMCR_f.CTEN = 0;
745 ((FM4_BT_PWM_TypeDef*)pstcBt)->TMCR_f.STRG = 1;
749 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON) || \
750 (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON) || \
751 (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON) || \
752 (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON) || \
753 (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON) || \
754 (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON) || \
755 (PDL_INTERRUPT_ENABLE_BT12 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT13 == PDL_ON) || \
756 (PDL_INTERRUPT_ENABLE_BT14 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT15 == PDL_ON)
776 if ((pstcBt == NULL) ||
780 (pstcIntCallback == NULL))
788 if(pstcBtInternData == NULL)
796 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.TGIE = 1;
801 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.DTIE = 1;
806 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.UDIE = 1;
830 if ((pstcBt == NULL) ||
841 if(pstcBtInternData == NULL)
849 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.TGIE = 0;
854 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.DTIE = 0;
859 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.UDIE = 0;
861 if( (((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.TGIE == 0) &&
862 (((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.DTIE == 0) &&
863 (((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.UDIE == 0) )
890 enFlag = ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.TGIR ?
PdlSet :
PdlClr;
893 enFlag = ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.DTIR ?
PdlSet :
PdlClr;
896 enFlag = ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.UDIR ?
PdlSet :
PdlClr;
926 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.TGIR = 0;
929 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.DTIR = 0;
932 ((FM4_BT_PWM_TypeDef*)pstcBt)->STC_f.UDIR = 0;
954 if ((pstcBt == NULL))
959 ((FM4_BT_PWM_TypeDef*)pstcBt)->PCSR = u16Cycle;
976 if ((pstcBt == NULL))
981 ((FM4_BT_PWM_TypeDef*)pstcBt)->PDUT = u16Duty;
995 return ((FM4_BT_PWM_TypeDef*)pstcBt)->TMR;
1011 volatile FM4_BT_PPG_TypeDef* pRegBt = (FM4_BT_PPG_TypeDef*) pstcBt;
1033 if(pstcBtInternData == NULL)
1041 pRegBt->TMCR2 = 0x00;
1042 pRegBt->TMCR &= ~(7ul<<12);
1043 pRegBt->TMCR |= (pstcPpgConfig->
enPres<<12);
1047 pRegBt->TMCR2 = 0x01;
1048 pRegBt->TMCR &= ~(7ul<<12);
1049 pRegBt->TMCR |= ((pstcPpgConfig->
enPres & 0x7)<<12);
1052 pRegBt->TMCR_f.RTGEN = pstcPpgConfig->
enRestartEn;
1058 pRegBt->TMCR &= ~(3ul<<8);
1059 pRegBt->TMCR |= pstcPpgConfig->
enExtTrig;
1061 pRegBt->TMCR_f.MDSE = pstcPpgConfig->
enMode;
1082 ((FM4_BT_PPG_TypeDef*)pstcBt)->TMCR_f.CTEN = 1;
1103 ((FM4_BT_PPG_TypeDef*)pstcBt)->TMCR_f.CTEN = 0;
1124 ((FM4_BT_PPG_TypeDef*)pstcBt)->TMCR_f.STRG = 1;
1128 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON) || \
1129 (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON) || \
1130 (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON) || \
1131 (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON) || \
1132 (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON) || \
1133 (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON) || \
1134 (PDL_INTERRUPT_ENABLE_BT12 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT13 == PDL_ON) || \
1135 (PDL_INTERRUPT_ENABLE_BT14 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT15 == PDL_ON)
1155 if ((pstcBt == NULL) ||
1158 (pstcIntCallback == NULL))
1166 if(pstcBtInternData == NULL)
1174 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.TGIE = 1;
1179 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.UDIE = 1;
1203 if ((pstcBt == NULL) ||
1213 if(pstcBtInternData == NULL)
1221 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.TGIE = 0;
1226 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.UDIE = 0;
1229 if( (((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.TGIE == 0) &&
1230 (((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.UDIE == 0))
1256 enFlag = ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.TGIR ?
PdlSet :
PdlClr;
1259 enFlag = ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.UDIR ?
PdlSet :
PdlClr;
1289 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.TGIR = 0;
1292 ((FM4_BT_PPG_TypeDef*)pstcBt)->STC_f.UDIR = 0;
1314 if ((pstcBt == NULL))
1319 ((FM4_BT_PPG_TypeDef*)pstcBt)->PRLL = u16Val;
1336 if ((pstcBt == NULL))
1341 ((FM4_BT_PPG_TypeDef*)pstcBt)->PRLH = u16Val;
1355 return ((FM4_BT_PPG_TypeDef*)pstcBt)->TMR;
1371 volatile FM4_BT_RT_TypeDef* pRegBt = (FM4_BT_RT_TypeDef*) pstcBt;
1392 if(pstcBtInternData == NULL)
1400 pRegBt->TMCR2 = 0x00;
1401 pRegBt->TMCR &= ~(7ul<<12);
1402 pRegBt->TMCR |= (pstcRtConfig->
enPres<<12);
1406 pRegBt->TMCR2 = 0x01;
1407 pRegBt->TMCR &= ~(7ul<<12);
1408 pRegBt->TMCR |= ((pstcRtConfig->
enPres & 0x7)<<12);
1412 pRegBt->TMCR_f.T32 = pstcRtConfig->
enSize;
1418 pRegBt->TMCR2_f.GATE = 0;
1419 pRegBt->TMCR &= ~(3ul<<8);
1420 pRegBt->TMCR |= (pstcRtConfig->
enExtTrig)<<8;
1424 pRegBt->TMCR2_f.GATE = 1;
1425 pRegBt->TMCR &= ~(3ul<<8);
1429 pRegBt->TMCR2_f.GATE = 1;
1430 pRegBt->TMCR &= ~(3ul<<8);
1431 pRegBt->TMCR |= (1ul<<8);
1434 pRegBt->TMCR_f.MDSE = pstcRtConfig->
enMode;
1455 ((FM4_BT_RT_TypeDef*)pstcBt)->TMCR_f.CTEN = 1;
1476 ((FM4_BT_RT_TypeDef*)pstcBt)->TMCR_f.CTEN = 0;
1497 ((FM4_BT_RT_TypeDef*)pstcBt)->TMCR_f.STRG = 1;
1501 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON) || \
1502 (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON) || \
1503 (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON) || \
1504 (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON) || \
1505 (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON) || \
1506 (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON) || \
1507 (PDL_INTERRUPT_ENABLE_BT12 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT13 == PDL_ON) || \
1508 (PDL_INTERRUPT_ENABLE_BT14 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT15 == PDL_ON)
1528 if ((pstcBt == NULL) ||
1531 (pstcIntCallback == NULL))
1539 if(pstcBtInternData == NULL)
1547 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.TGIE = 1;
1552 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.UDIE = 1;
1576 if ((pstcBt == NULL) ||
1586 if(pstcBtInternData == NULL)
1594 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.TGIE = 0;
1599 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.UDIE = 0;
1626 enFlag = ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.TGIR ?
PdlSet :
PdlClr;
1629 enFlag = ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.UDIR ?
PdlSet :
PdlClr;
1659 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.TGIR = 0;
1662 ((FM4_BT_RT_TypeDef*)pstcBt)->STC_f.UDIR = 0;
1684 if ((pstcBt == NULL))
1689 ((FM4_BT_RT_TypeDef*)pstcBt)->PCSR = u16Val;
1703 return ((FM4_BT_RT_TypeDef*)pstcBt)->TMR;
1719 volatile FM4_BT_PWC_TypeDef* pRegBt = (FM4_BT_PWC_TypeDef*) pstcBt;
1739 if(pstcBtInternData == NULL)
1747 pRegBt->TMCR2 = 0x00;
1748 pRegBt->TMCR &= ~(7ul<<12);
1749 pRegBt->TMCR |= (pstcPwcConfig->
enPres<<12);
1753 pRegBt->TMCR2 = 0x01;
1754 pRegBt->TMCR &= ~(7ul<<12);
1755 pRegBt->TMCR |= ((pstcPwcConfig->
enPres & 0x7)<<12);
1758 pRegBt->TMCR_f.T32 = pstcPwcConfig->
enSize;
1760 pRegBt->TMCR &= ~(7ul<<8);
1763 pRegBt->TMCR_f.MDSE = pstcPwcConfig->
enMode;
1784 ((FM4_BT_PWC_TypeDef*)pstcBt)->TMCR_f.CTEN = 1;
1805 ((FM4_BT_PWC_TypeDef*)pstcBt)->TMCR_f.CTEN = 0;
1809 #if (PDL_INTERRUPT_ENABLE_BT0 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT1 == PDL_ON) || \
1810 (PDL_INTERRUPT_ENABLE_BT2 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT3 == PDL_ON) || \
1811 (PDL_INTERRUPT_ENABLE_BT4 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT5 == PDL_ON) || \
1812 (PDL_INTERRUPT_ENABLE_BT6 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT7 == PDL_ON) || \
1813 (PDL_INTERRUPT_ENABLE_BT8 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT9 == PDL_ON) || \
1814 (PDL_INTERRUPT_ENABLE_BT10 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT11 == PDL_ON) || \
1815 (PDL_INTERRUPT_ENABLE_BT12 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT13 == PDL_ON) || \
1816 (PDL_INTERRUPT_ENABLE_BT14 == PDL_ON) || (PDL_INTERRUPT_ENABLE_BT15 == PDL_ON)
1836 if ((pstcBt == NULL) ||
1839 (pstcIntCallback == NULL))
1847 if(pstcBtInternData == NULL)
1855 ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.EDIE = 1;
1860 ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.OVIE = 1;
1884 if ((pstcBt == NULL) ||
1894 if(pstcBtInternData == NULL)
1902 ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.EDIE = 0;
1907 ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.OVIE = 0;
1910 if( (((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.EDIE == 0) &&
1911 (((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.OVIE == 0))
1937 enFlag = ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.EDIR ?
PdlSet :
PdlClr;
1940 enFlag = ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.OVIR ?
PdlSet :
PdlClr;
1972 ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.OVIR = 0;
1997 enFlag = ((FM4_BT_PWC_TypeDef*)pstcBt)->STC_f.ERR ?
PdlSet :
PdlClr;
2014 uint16_t u16RegDtbf;
2015 u16RegDtbf = ((FM4_BT_PWC_TypeDef*)pstcBt)->DTBF;
2032 uint16_t u16RegLow, u16RegHigh;
2034 if((pstcBt == &
BT1) || (pstcBt == &
BT3) || (pstcBt == &
BT5) || (pstcBt == &
BT7) ||
2035 (pstcBt == &
BT9) || (pstcBt == &
BT11) || (pstcBt == &
BT13) || (pstcBt == &
BT15))
2037 u16RegLow = ((FM4_BT_PWC_TypeDef*)pstcBt)->DTBF;
2038 u16RegHigh = ((FM4_BT_PWC_TypeDef*)((uint8_t*)pstcBt + 0x40))->DTBF;
2039 return ((u16RegHigh<<16) | u16RegLow);
2058 FM4_SBSSR->BTSSSR = u16Value;