This is the latest (main) BeagleBoard documentation. If you are looking for stable releases, use the drop-down menu on the bottom-left and select the desired version.

Function rc_pwm_set_duty_ns

Function Documentation

int rc_pwm_set_duty_ns(int ss, char ch, unsigned int duty_ns)

Like rc_pwm_set_duty() but takes a pulse width in nanoseconds.

duty_ns which must range from 0 (off) to the number of nanoseconds in a single cycle as determined by the freqency specified when calling rc_pwm_init(). For example, a pwm frequency of 25kz corresponds to a maximum pulse width of 40,000ns.

Parameters
  • ss[in] subsystem 0,1,2

  • ch[in] channel ‘A’ or ‘B’

  • duty_ns[in] The duty cycle (pulse width) in nanoseconds

Returns

Returns 0 on success or -1 on failure.