/* param base PWM peripheral base address param subModule PWM submodule to configure param prescaler Set prescaler value  */
void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler)
/* param base PWM peripheral base address param subModule PWM submodule to configure param prescaler Set prescaler value  */
void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler)
{
    uint16_t reg = base->SM[subModule].CTRL;
    if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule)))
    {
        base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule);
    }
    reg &= ~(uint16_t)PWM_CTRL_PRSC_MASK;
    reg |= PWM_CTRL_PRSC(prescaler);
    base->SM[subModule].CTRL = reg;
    base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK;
    base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule);
    base->SM[subModule].CTRL = reg;
}