Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_servo

Driver for Servo. More...

Data Structures

struct  bc_servo_t
 Servo instance. More...
 

Macros

#define BC_SERVO_NO_ANGLE   255
 
#define BC_SERVO_UNKNOWN_ANGLE   250
 
#define BC_SERVO_DEFAULT_MIN   544
 
#define BC_SERVO_DEFAULT_MAX   2400
 

Functions

void bc_servo_init (bc_servo_t *self, bc_pwm_channel_t channel)
 Initialize Servo. More...
 
void bc_servo_set_angle (bc_servo_t *self, uint8_t angle)
 Set angle. More...
 
uint8_t bc_servo_get_angle (bc_servo_t *self)
 Get angle. More...
 
void bc_servo_set_pulse_limits (bc_servo_t *self, uint16_t min_us, uint16_t max_us)
 Set pulse limits. More...
 
void bc_servo_set_microseconds (bc_servo_t *self, uint16_t us)
 Set Microseconds. More...
 

Detailed Description

Driver for Servo.

Function Documentation

uint8_t bc_servo_get_angle ( bc_servo_t self)

Get angle.

Parameters
[in]selfInstance

Definition at line 48 of file bc_servo.c.

void bc_servo_init ( bc_servo_t self,
bc_pwm_channel_t  channel 
)

Initialize Servo.

Parameters
[in]selfInstance
[in]channelPWM Channel

Definition at line 6 of file bc_servo.c.

Here is the call graph for this function:

void bc_servo_set_angle ( bc_servo_t self,
uint8_t  angle 
)

Set angle.

Parameters
[in]selfInstance
[in]angleAngle in degrees, 0 to 180

Definition at line 29 of file bc_servo.c.

Here is the call graph for this function:

void bc_servo_set_microseconds ( bc_servo_t self,
uint16_t  us 
)

Set Microseconds.

Parameters
[in]selfInstance
[in]usMicroseconds

Definition at line 60 of file bc_servo.c.

Here is the call graph for this function:

void bc_servo_set_pulse_limits ( bc_servo_t self,
uint16_t  min_us,
uint16_t  max_us 
)

Set pulse limits.

Parameters
[in]selfInstance
[in]min_usMin pulse in us (Default 544us)
[in]max_usMax pulse in us (Default 2400us)

Definition at line 53 of file bc_servo.c.