nu_bpwm.h 20 KB

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