bpwm.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. /**************************************************************************//**
  2. * @file bpwm.h
  3. * @version V1.00
  4. * @brief M480 series PWM driver header file
  5. *
  6. * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved.
  7. *****************************************************************************/
  8. #ifndef __BPWM_H__
  9. #define __BPWM_H__
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif
  14. /** @addtogroup Standard_Driver Standard Driver
  15. @{
  16. */
  17. /** @addtogroup BPWM_Driver BPWM Driver
  18. @{
  19. */
  20. /** @addtogroup BPWM_EXPORTED_CONSTANTS BPWM Exported Constants
  21. @{
  22. */
  23. #define BPWM_CHANNEL_NUM (6) /*!< BPWM channel number \hideinitializer */
  24. #define BPWM_CH_0_MASK (0x1UL) /*!< BPWM channel 0 mask \hideinitializer */
  25. #define BPWM_CH_1_MASK (0x2UL) /*!< BPWM channel 1 mask \hideinitializer */
  26. #define BPWM_CH_2_MASK (0x4UL) /*!< BPWM channel 2 mask \hideinitializer */
  27. #define BPWM_CH_3_MASK (0x8UL) /*!< BPWM channel 3 mask \hideinitializer */
  28. #define BPWM_CH_4_MASK (0x10UL) /*!< BPWM channel 4 mask \hideinitializer */
  29. #define BPWM_CH_5_MASK (0x20UL) /*!< BPWM channel 5 mask \hideinitializer */
  30. /*---------------------------------------------------------------------------------------------------------*/
  31. /* Counter Type Constant Definitions */
  32. /*---------------------------------------------------------------------------------------------------------*/
  33. #define BPWM_UP_COUNTER (0UL) /*!< Up counter type \hideinitializer */
  34. #define BPWM_DOWN_COUNTER (1UL) /*!< Down counter type \hideinitializer */
  35. #define BPWM_UP_DOWN_COUNTER (2UL) /*!< Up-Down counter type \hideinitializer */
  36. /*---------------------------------------------------------------------------------------------------------*/
  37. /* Aligned Type Constant Definitions */
  38. /*---------------------------------------------------------------------------------------------------------*/
  39. #define BPWM_EDGE_ALIGNED (1UL) /*!< BPWM working in edge aligned type(down count) \hideinitializer */
  40. #define BPWM_CENTER_ALIGNED (2UL) /*!< BPWM working in center aligned type \hideinitializer */
  41. /*---------------------------------------------------------------------------------------------------------*/
  42. /* Output Level Constant Definitions */
  43. /*---------------------------------------------------------------------------------------------------------*/
  44. #define BPWM_OUTPUT_NOTHING (0UL) /*!< BPWM output nothing \hideinitializer */
  45. #define BPWM_OUTPUT_LOW (1UL) /*!< BPWM output low \hideinitializer */
  46. #define BPWM_OUTPUT_HIGH (2UL) /*!< BPWM output high \hideinitializer */
  47. #define BPWM_OUTPUT_TOGGLE (3UL) /*!< BPWM output toggle \hideinitializer */
  48. /*---------------------------------------------------------------------------------------------------------*/
  49. /* Synchronous Start Function Control Constant Definitions */
  50. /*---------------------------------------------------------------------------------------------------------*/
  51. #define BPWM_SSCTL_SSRC_PWM0 (0UL<<BPWM_SSCTL_SSRC_Pos) /*!< Synchronous start source comes from PWM0 */
  52. #define BPWM_SSCTL_SSRC_PWM1 (1UL<<BPWM_SSCTL_SSRC_Pos) /*!< Synchronous start source comes from PWM1 */
  53. #define BPWM_SSCTL_SSRC_BPWM0 (2UL<<BPWM_SSCTL_SSRC_Pos) /*!< Synchronous start source comes from BPWM0 */
  54. #define BPWM_SSCTL_SSRC_BPWM1 (3UL<<BPWM_SSCTL_SSRC_Pos) /*!< Synchronous start source comes from BPWM1 */
  55. /*---------------------------------------------------------------------------------------------------------*/
  56. /* Trigger Source Select Constant Definitions */
  57. /*---------------------------------------------------------------------------------------------------------*/
  58. #define BPWM_TRIGGER_ADC_EVEN_ZERO_POINT (0UL) /*!< BPWM trigger ADC while counter of even channel matches zero point \hideinitializer */
  59. #define BPWM_TRIGGER_ADC_EVEN_PERIOD_POINT (1UL) /*!< BPWM trigger ADC while counter of even channel matches period point \hideinitializer */
  60. #define BPWM_TRIGGER_ADC_EVEN_ZERO_OR_PERIOD_POINT (2UL) /*!< BPWM trigger ADC while counter of even channel matches zero or period point \hideinitializer */
  61. #define BPWM_TRIGGER_ADC_EVEN_CMP_UP_COUNT_POINT (3UL) /*!< BPWM trigger ADC while counter of even channel matches up count to comparator point \hideinitializer */
  62. #define BPWM_TRIGGER_ADC_EVEN_CMP_DOWN_COUNT_POINT (4UL) /*!< BPWM trigger ADC while counter of even channel matches down count to comparator point \hideinitializer */
  63. #define BPWM_TRIGGER_ADC_ODD_CMP_UP_COUNT_POINT (8UL) /*!< BPWM trigger ADC while counter of odd channel matches up count to comparator point \hideinitializer */
  64. #define BPWM_TRIGGER_ADC_ODD_CMP_DOWN_COUNT_POINT (9UL) /*!< BPWM trigger ADC while counter of odd channel matches down count to comparator point \hideinitializer */
  65. /*---------------------------------------------------------------------------------------------------------*/
  66. /* Capture Control Constant Definitions */
  67. /*---------------------------------------------------------------------------------------------------------*/
  68. #define BPWM_CAPTURE_INT_RISING_LATCH (1UL) /*!< BPWM capture interrupt if channel has rising transition \hideinitializer */
  69. #define BPWM_CAPTURE_INT_FALLING_LATCH (0x100UL) /*!< BPWM capture interrupt if channel has falling transition \hideinitializer */
  70. /*---------------------------------------------------------------------------------------------------------*/
  71. /* Duty Interrupt Type Constant Definitions */
  72. /*---------------------------------------------------------------------------------------------------------*/
  73. #define BPWM_DUTY_INT_DOWN_COUNT_MATCH_CMP (1 << BPWM_INTEN_CMPDIENn_Pos) /*!< BPWM duty interrupt triggered if down count match comparator \hideinitializer */
  74. #define BPWM_DUTY_INT_UP_COUNT_MATCH_CMP (1 << BPWM_INTEN_CMPUIENn_Pos) /*!< BPWM duty interrupt triggered if up down match comparator \hideinitializer */
  75. /*---------------------------------------------------------------------------------------------------------*/
  76. /* Load Mode Constant Definitions */
  77. /*---------------------------------------------------------------------------------------------------------*/
  78. #define BPWM_LOAD_MODE_IMMEDIATE (1 << BPWM_CTL0_IMMLDENn_Pos) /*!< BPWM immediately load mode \hideinitializer */
  79. #define BPWM_LOAD_MODE_CENTER (1 << BPWM_CTL0_CTRLDn_Pos) /*!< BPWM center load mode \hideinitializer */
  80. /*---------------------------------------------------------------------------------------------------------*/
  81. /* Clock Source Select Constant Definitions */
  82. /*---------------------------------------------------------------------------------------------------------*/
  83. #define BPWM_CLKSRC_BPWM_CLK (0UL) /*!< BPWM Clock source selects to BPWM0_CLK or BPWM1_CLK \hideinitializer */
  84. #define BPWM_CLKSRC_TIMER0 (1UL) /*!< BPWM Clock source selects to TIMER0 overflow \hideinitializer */
  85. #define BPWM_CLKSRC_TIMER1 (2UL) /*!< BPWM Clock source selects to TIMER1 overflow \hideinitializer */
  86. #define BPWM_CLKSRC_TIMER2 (3UL) /*!< BPWM Clock source selects to TIMER2 overflow \hideinitializer */
  87. #define BPWM_CLKSRC_TIMER3 (4UL) /*!< BPWM Clock source selects to TIMER3 overflow \hideinitializer */
  88. /*@}*/ /* end of group BPWM_EXPORTED_CONSTANTS */
  89. /** @addtogroup BPWM_EXPORTED_FUNCTIONS BPWM Exported Functions
  90. @{
  91. */
  92. /**
  93. * @brief Enable timer synchronous start counting function of specified channel(s)
  94. * @param[in] bpwm The pointer of the specified BPWM module
  95. * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used.
  96. * @param[in] u32SyncSrc Synchronous start source selection, valid values are:
  97. * - \ref BPWM_SSCTL_SSRC_PWM0
  98. * - \ref BPWM_SSCTL_SSRC_PWM1
  99. * - \ref BPWM_SSCTL_SSRC_BPWM0
  100. * - \ref BPWM_SSCTL_SSRC_BPWM1
  101. * @return None
  102. * @details This macro is used to enable timer synchronous start counting function of specified channel(s).
  103. * @note All channels share channel 0's setting.
  104. * \hideinitializer
  105. */
  106. #define BPWM_ENABLE_TIMER_SYNC(bpwm, u32ChannelMask, u32SyncSrc) ((bpwm)->SSCTL = ((bpwm)->SSCTL & ~BPWM_SSCTL_SSRC_Msk) | (u32SyncSrc) | BPWM_SSCTL_SSEN0_Msk)
  107. /**
  108. * @brief Disable timer synchronous start counting function of specified channel(s)
  109. * @param[in] bpwm The pointer of the specified BPWM module
  110. * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used.
  111. * @return None
  112. * @details This macro is used to disable timer synchronous start counting function of specified channel(s).
  113. * @note All channels share channel 0's setting.
  114. * \hideinitializer
  115. */
  116. #define BPWM_DISABLE_TIMER_SYNC(bpwm, u32ChannelMask) ((bpwm)->SSCTL &= ~BPWM_SSCTL_SSEN0_Msk)
  117. /**
  118. * @brief This macro enable BPWM counter synchronous start counting function.
  119. * @param[in] bpwm The pointer of the specified BPWM module
  120. * @return None
  121. * @details This macro is used to make selected BPWM0 and BPWM1 channel(s) start counting at the same time.
  122. * To configure synchronous start counting channel(s) by BPWM_ENABLE_TIMER_SYNC() and BPWM_DISABLE_TIMER_SYNC().
  123. * \hideinitializer
  124. */
  125. #define BPWM_TRIGGER_SYNC_START(bpwm) ((bpwm)->SSTRG = BPWM_SSTRG_CNTSEN_Msk)
  126. /**
  127. * @brief This macro enable output inverter of specified channel(s)
  128. * @param[in] bpwm The pointer of the specified BPWM module
  129. * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel
  130. * Bit 0 represents channel 0, bit 1 represents channel 1...
  131. * @return None
  132. * \hideinitializer
  133. */
  134. #define BPWM_ENABLE_OUTPUT_INVERTER(bpwm, u32ChannelMask) ((bpwm)->POLCTL = (u32ChannelMask))
  135. /**
  136. * @brief This macro get captured rising data
  137. * @param[in] bpwm The pointer of the specified BPWM module
  138. * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5
  139. * @return None
  140. * \hideinitializer
  141. */
  142. #define BPWM_GET_CAPTURE_RISING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].RCAPDAT)
  143. /**
  144. * @brief This macro get captured falling data
  145. * @param[in] bpwm The pointer of the specified BPWM module
  146. * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5
  147. * @return None
  148. * \hideinitializer
  149. */
  150. #define BPWM_GET_CAPTURE_FALLING_DATA(bpwm, u32ChannelNum) ((bpwm)->CAPDAT[(u32ChannelNum)].FCAPDAT)
  151. /**
  152. * @brief This macro mask output logic to high or low
  153. * @param[in] bpwm The pointer of the specified BPWM module
  154. * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel
  155. * Bit 0 represents channel 0, bit 1 represents channel 1...
  156. * @param[in] u32LevelMask Output logic to high or low
  157. * @return None
  158. * @details This macro is used to mask output logic to high or low of specified channel(s).
  159. * @note If u32ChannelMask parameter is 0, then mask function will be disabled.
  160. * \hideinitializer
  161. */
  162. #define BPWM_MASK_OUTPUT(bpwm, u32ChannelMask, u32LevelMask) \
  163. { \
  164. (bpwm)->MSKEN = (u32ChannelMask); \
  165. (bpwm)->MSK = (u32LevelMask); \
  166. }
  167. /**
  168. * @brief This macro set the prescaler of all channels
  169. * @param[in] bpwm The pointer of the specified BPWM module
  170. * @param[in] u32ChannelNum BPWM channel number. This parameter is not used.
  171. * @param[in] u32Prescaler Clock prescaler of specified channel. Valid values are between 1 ~ 0xFFF
  172. * @return None
  173. * \hideinitializer
  174. */
  175. #define BPWM_SET_PRESCALER(bpwm, u32ChannelNum, u32Prescaler) ((bpwm)->CLKPSC = (u32Prescaler))
  176. /**
  177. * @brief This macro set the duty of the selected channel
  178. * @param[in] bpwm The pointer of the specified BPWM module
  179. * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5
  180. * @param[in] u32CMR Duty of specified channel. Valid values are between 0~0xFFFF
  181. * @return None
  182. * @note This new setting will take effect on next BPWM period
  183. * \hideinitializer
  184. */
  185. #define BPWM_SET_CMR(bpwm, u32ChannelNum, u32CMR) ((bpwm)->CMPDAT[(u32ChannelNum)] = (u32CMR))
  186. /**
  187. * @brief This macro get the duty of the selected channel
  188. * @param[in] bpwm The pointer of the specified BPWM module
  189. * @param[in] u32ChannelNum BPWM channel number. Valid values are between 0~5
  190. * @return None
  191. * \hideinitializer
  192. */
  193. #define BPWM_GET_CMR(bpwm, u32ChannelNum) ((bpwm)->CMPDAT[(u32ChannelNum)])
  194. /**
  195. * @brief This macro set the period of all channels
  196. * @param[in] bpwm The pointer of the specified BPWM module
  197. * @param[in] u32ChannelNum BPWM channel number. This parameter is not used.
  198. * @param[in] u32CNR Period of specified channel. Valid values are between 0~0xFFFF
  199. * @return None
  200. * @note This new setting will take effect on next BPWM period
  201. * @note BPWM counter will stop if period length set to 0
  202. * \hideinitializer
  203. */
  204. #define BPWM_SET_CNR(bpwm, u32ChannelNum, u32CNR) ((bpwm)->PERIOD = (u32CNR))
  205. /**
  206. * @brief This macro get the period of all channels
  207. * @param[in] bpwm The pointer of the specified BPWM module
  208. * @param[in] u32ChannelNum BPWM channel number. This parameter is not used.
  209. * @return None
  210. * \hideinitializer
  211. */
  212. #define BPWM_GET_CNR(bpwm, u32ChannelNum) ((bpwm)->PERIOD)
  213. /**
  214. * @brief This macro set the BPWM aligned type
  215. * @param[in] bpwm The pointer of the specified BPWM module
  216. * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used.
  217. * @param[in] u32AlignedType BPWM aligned type, valid values are:
  218. * - \ref BPWM_EDGE_ALIGNED
  219. * - \ref BPWM_CENTER_ALIGNED
  220. * @return None
  221. * @note All channels share channel 0's setting.
  222. * \hideinitializer
  223. */
  224. #define BPWM_SET_ALIGNED_TYPE(bpwm, u32ChannelMask, u32AlignedType) ((bpwm)->CTL1 = (u32AlignedType))
  225. /**
  226. * @brief Clear counter of channel 0
  227. * @param[in] bpwm The pointer of the specified BPWM module
  228. * @param[in] u32ChannelMask Combination of enabled channels. This parameter is not used.
  229. * @return None
  230. * @details This macro is used to clear counter of channel 0
  231. * \hideinitializer
  232. */
  233. #define BPWM_CLR_COUNTER(bpwm, u32ChannelMask) ((bpwm)->CNTCLR = (BPWM_CNTCLR_CNTCLR0_Msk))
  234. /**
  235. * @brief Set output level at zero, compare up, period(center) and compare down of specified channel(s)
  236. * @param[in] bpwm The pointer of the specified BPWM module
  237. * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel
  238. * Bit 0 represents channel 0, bit 1 represents channel 1...
  239. * @param[in] u32ZeroLevel output level at zero point, valid values are:
  240. * - \ref BPWM_OUTPUT_NOTHING
  241. * - \ref BPWM_OUTPUT_LOW
  242. * - \ref BPWM_OUTPUT_HIGH
  243. * - \ref BPWM_OUTPUT_TOGGLE
  244. * @param[in] u32CmpUpLevel output level at compare up point, valid values are:
  245. * - \ref BPWM_OUTPUT_NOTHING
  246. * - \ref BPWM_OUTPUT_LOW
  247. * - \ref BPWM_OUTPUT_HIGH
  248. * - \ref BPWM_OUTPUT_TOGGLE
  249. * @param[in] u32PeriodLevel output level at period(center) point, valid values are:
  250. * - \ref BPWM_OUTPUT_NOTHING
  251. * - \ref BPWM_OUTPUT_LOW
  252. * - \ref BPWM_OUTPUT_HIGH
  253. * - \ref BPWM_OUTPUT_TOGGLE
  254. * @param[in] u32CmpDownLevel output level at compare down point, valid values are:
  255. * - \ref BPWM_OUTPUT_NOTHING
  256. * - \ref BPWM_OUTPUT_LOW
  257. * - \ref BPWM_OUTPUT_HIGH
  258. * - \ref BPWM_OUTPUT_TOGGLE
  259. * @return None
  260. * @details This macro is used to Set output level at zero, compare up, period(center) and compare down of specified channel(s)
  261. * \hideinitializer
  262. */
  263. #define BPWM_SET_OUTPUT_LEVEL(bpwm, u32ChannelMask, u32ZeroLevel, u32CmpUpLevel, u32PeriodLevel, u32CmpDownLevel) \
  264. do{ \
  265. int i; \
  266. for(i = 0; i < 6; i++) { \
  267. if((u32ChannelMask) & (1 << i)) { \
  268. (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (2 * i))) | ((u32ZeroLevel) << (2 * i))); \
  269. (bpwm)->WGCTL0 = (((bpwm)->WGCTL0 & ~(3UL << (BPWM_WGCTL0_PRDPCTLn_Pos + (2 * i)))) | ((u32PeriodLevel) << (BPWM_WGCTL0_PRDPCTLn_Pos + (2 * i)))); \
  270. (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (2 * i))) | ((u32CmpUpLevel) << (2 * i))); \
  271. (bpwm)->WGCTL1 = (((bpwm)->WGCTL1 & ~(3UL << (BPWM_WGCTL1_CMPDCTLn_Pos + (2 * i)))) | ((u32CmpDownLevel) << (BPWM_WGCTL1_CMPDCTLn_Pos + (2 * i)))); \
  272. } \
  273. } \
  274. }while(0)
  275. /*---------------------------------------------------------------------------------------------------------*/
  276. /* Define BPWM functions prototype */
  277. /*---------------------------------------------------------------------------------------------------------*/
  278. uint32_t BPWM_ConfigCaptureChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge);
  279. uint32_t BPWM_ConfigOutputChannel(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle);
  280. void BPWM_Start(BPWM_T *bpwm, uint32_t u32ChannelMask);
  281. void BPWM_Stop(BPWM_T *bpwm, uint32_t u32ChannelMask);
  282. void BPWM_ForceStop(BPWM_T *bpwm, uint32_t u32ChannelMask);
  283. void BPWM_EnableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition);
  284. void BPWM_DisableADCTrigger(BPWM_T *bpwm, uint32_t u32ChannelNum);
  285. void BPWM_ClearADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Condition);
  286. uint32_t BPWM_GetADCTriggerFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  287. void BPWM_EnableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask);
  288. void BPWM_DisableCapture(BPWM_T *bpwm, uint32_t u32ChannelMask);
  289. void BPWM_EnableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask);
  290. void BPWM_DisableOutput(BPWM_T *bpwm, uint32_t u32ChannelMask);
  291. void BPWM_EnableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge);
  292. void BPWM_DisableCaptureInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge);
  293. void BPWM_ClearCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32Edge);
  294. uint32_t BPWM_GetCaptureIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  295. void BPWM_EnableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType);
  296. void BPWM_DisableDutyInt(BPWM_T *bpwm, uint32_t u32ChannelNum);
  297. void BPWM_ClearDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  298. uint32_t BPWM_GetDutyIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  299. void BPWM_EnablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType);
  300. void BPWM_DisablePeriodInt(BPWM_T *bpwm, uint32_t u32ChannelNum);
  301. void BPWM_ClearPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  302. uint32_t BPWM_GetPeriodIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  303. void BPWM_EnableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum);
  304. void BPWM_DisableZeroInt(BPWM_T *bpwm, uint32_t u32ChannelNum);
  305. void BPWM_ClearZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  306. uint32_t BPWM_GetZeroIntFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  307. void BPWM_EnableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode);
  308. void BPWM_DisableLoadMode(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32LoadMode);
  309. void BPWM_SetClockSource(BPWM_T *bpwm, uint32_t u32ChannelNum, uint32_t u32ClkSrcSel);
  310. uint32_t BPWM_GetWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  311. void BPWM_ClearWrapAroundFlag(BPWM_T *bpwm, uint32_t u32ChannelNum);
  312. /*@}*/ /* end of group BPWM_EXPORTED_FUNCTIONS */
  313. /*@}*/ /* end of group BPWM_Driver */
  314. /*@}*/ /* end of group Standard_Driver */
  315. #ifdef __cplusplus
  316. }
  317. #endif
  318. #endif /* __BPWM_H__ */
  319. /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/