12 CH32PWM(TIM_TypeDef* tim, uint16_t channel,
bool active_high, GPIO_TypeDef* gpio,
13 uint16_t pin, uint32_t pin_remap = 0,
bool complementary =
false);
17 ErrorCode
Enable()
override;
30 static bool IsAdvancedTimer(TIM_TypeDef* t);
31 static bool OnAPB2(TIM_TypeDef* t);
32 static uint32_t GetTimerClockHz(TIM_TypeDef* t);
34 static inline uint32_t ReadARR32(TIM_TypeDef* t) {
return t->ATRLR; }
36 void ApplyCompare(uint32_t pulse);
37 void OcInitForChannel(uint32_t pulse);
38 void EnableChannel(
bool en);
39 void EnableChannelN(
bool en);
42 static void EnableGPIOClock(GPIO_TypeDef* gpio);
43 static void EnableTIMClock(TIM_TypeDef* tim);