/* Initialize PWM Interface. 1. Initializes the resources needed for the PWM interface 2.registers event callback function.  */
pwm_handle_t drv_pwm_initialize(pin_t pwm_pin)
/* Initialize PWM Interface. 1. Initializes the resources needed for the PWM interface 2.registers event callback function.  */
pwm_handle_t drv_pwm_initialize(pin_t pwm_pin)
{
    uint32_t base = 0u;
    uint32_t irq = 0u;
    uint32_t ch_num = 0u;
    int32_t idx = target_pwm_init(pwm_pin, &ch_num, &base, &irq);
    if (idx < 0 || idx >= CONFIG_PWM_NUM) {
        return NULL;
    }
    ck_pwm_priv_t *pwm_priv = &pwm_instance[idx];
    pwm_priv->base      = base;
    pwm_priv->irq       = irq;
    pwm_priv->ch_num    = ch_num;
    return pwm_priv;
}