int servo_init(servo_t *dev, pwm_t pwm, int pwm_channel, unsigned int min, unsigned int max)
Initialize a servo motor by assigning it a PWM device and channel.
Descriptor struct for a servo.
unsigned int min
minimum pulse width, in us
int channel
the channel the servo is connected to
void servo_set(const servo_t *dev, unsigned int pos)
Set the servo motor to a specified position.
unsigned int scale_den
timing scale factor, to adjust for an inexact PWM frequency, denominator
pwm_t device
the PWM device driving the servo
unsigned int max
maximum pulse width, in us
unsigned int scale_nom
timing scale factor, to adjust for an inexact PWM frequency, nominator
Low-level PWM peripheral driver interface definitions.
unsigned int pwm_t
Default PWM type definition.