upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Macros | Typedefs
Include dependency graph for es08a.h:

API Description

Go to the source code of this file.

Data Structures

struct  _es08a_context
 

Functions

es08a_context es08a_init (int32_t pin, int32_t min_pulse_width, int32_t max_pulse_width)
 
void es08a_halt (es08a_context dev)
 
upm_result_t es08a_set_angle (es08a_context dev, int32_t angle)
 
upm_result_t es08a_calc_pulse_travelling (const es08a_context dev, int32_t *ret_val, int32_t value)
 
void es08a_set_min_pulse_width (es08a_context dev, int width)
 
void es08a_set_max_pulse_width (es08a_context dev, int width)
 
int es08a_get_min_pulse_width (es08a_context dev)
 
int es08a_get_max_pulse_width (es08a_context dev)
 

Macros

#define ES08A_MIN_PULSE_WIDTH   600
 
#define ES08A_MAX_PULSE_WIDTH   2200
 
#define ES08A_PERIOD   20000
 
#define ES08A_MAX_ANGLE   180.0
 

Typedefs

typedef struct _es08a_contextes08a_context
 

Function Documentation

es08a_context es08a_init ( int32_t  pin,
int32_t  min_pulse_width,
int32_t  max_pulse_width 
)

Instantiates a the servo at the given pin

Parameters
pinServo pin number
minPulseWidthMinimum pulse width, in microseconds
maxPulseWidthMaximum pulse width, in microseconds
waitAndDisablePwmIf 1, PWM is enabled only during the setAngle() execution for a period of 1 second, and then turned back off. If 0, PWM remains on afterward.

Here is the call graph for this function:

void es08a_halt ( es08a_context  dev)

Halts PWM for this servo and allows it to move freely.

upm_result_t es08a_set_angle ( es08a_context  dev,
int32_t  angle 
)

Sets the angle of the servo engine.

Parameters
angleNumber between 0 and 180
Returns
0 if successful, non-zero otherwise

Here is the caller graph for this function:

void es08a_set_min_pulse_width ( es08a_context  dev,
int  width 
)

Sets the minimum pulse width

Parameters
widthMinimum HIGH signal width
void es08a_set_max_pulse_width ( es08a_context  dev,
int  width 
)

Sets the maximum pulse width

Parameters
widthMaximum HIGH signal width
int es08a_get_min_pulse_width ( es08a_context  dev)

Returns the minimum pulse width

Returns
Minimum pulse width
int es08a_get_max_pulse_width ( es08a_context  dev)

Returns the maximum pulse width

Returns
Maximum pulse width

Typedef Documentation

typedef struct _es08a_context * es08a_context

device context