Function gx_timer_enable_pwm

int gx_timer_enable_pwm(unsigned int port, unsigned long int period_ns, unsigned long int duty_ns)

timer 输出pwm

参数
  • port -- PWM输出管脚

  • period_ns -- PWM周期

  • duty_ns -- 高电平时间

返回

成功返回自动分配的定时器ID,失败返回-1