/*
 * drv_pwm.c
 *
 *  Created on: 2025年4月7日
 *      Author: 22332
 */
#include "drv_pwm.h"

status_t status = STATUS_SUCCESS;
void bsp_drv_pwm_init(void)
{
	  /* Initialize PWM */
	  status = PWM_Init(&pwm_pal_1_instance, &pwm_pal_1_configs);
	  DEV_ASSERT(status == STATUS_SUCCESS);
}
void bsp_drv_pwm_deinit(void)
{
	status = PWM_Deinit(&pwm_pal_1_instance);
	DEV_ASSERT(status == STATUS_SUCCESS);
}
void bsp_drv_change_duty(uint32_t duty)
{
	uint8_t channel = pwm_pal_1_configs.pwmChannels[0].channel;
	pwm_pal_1_configs.pwmChannels[0].duty = duty;
	status = PWM_UpdateDuty(&pwm_pal_1_instance, channel, duty);
    DEV_ASSERT(status == STATUS_SUCCESS);
}
