nu_bpwm.h 21 KB

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