/* De-initialises an PWM interface, Turns off an PWM hardware interface */
int32_t hal_pwm_finalize(pwm_dev_t *pwm)
/* De-initialises an PWM interface, Turns off an PWM hardware interface */
int32_t hal_pwm_finalize(pwm_dev_t *pwm)
{
	_HAL_PWM_PRIV_T *_cfg = (_HAL_PWM_PRIV_T *)pwm->priv;
	if (_cfg) {
		if (_cfg->start == 1) {
			hal_pwm_stop(pwm);
		}
		free(_cfg);
		pwm->priv = NULL;
	}
	return 0;
}