/* This function is used to enable the capture mode.  */
int tls_pwm_capture_mode_config(u8 channel)
/* This function is used to enable the capture mode.  */
int tls_pwm_capture_mode_config(u8 channel)
{
    if (channel != 0 && channel != 4)
        return WM_FAILED;
    if (channel == 0)
    {
        tls_reg_write32(HR_PWM_CTL,      tls_reg_read32(HR_PWM_CTL) |   BIT(24));
    }
    else
    {
        tls_reg_write32(HR_PWM_CAP2CTL,  tls_reg_read32(HR_PWM_CAP2CTL)  |   BIT(1));
    }
    return WM_SUCCESS;
}