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

API Description

Go to the source code of this file.

Data Structures

struct  _es9257_context


es9257_context es9257_init (int32_t pin, int32_t min_pulse_width, int32_t max_pulse_width)
void es9257_halt (es9257_context dev)
upm_result_t es9257_set_angle (es9257_context dev, int32_t angle)
upm_result_t es9257_calc_pulse_travelling (const es9257_context dev, int32_t *ret_val, int32_t value)
void es9257_set_min_pulse_width (es9257_context dev, int width)
void es9257_set_max_pulse_width (es9257_context dev, int width)
int es9257_get_min_pulse_width (es9257_context dev)
int es9257_get_max_pulse_width (es9257_context dev)


#define ES9257_MIN_PULSE_WIDTH   475
#define ES9257_MAX_PULSE_WIDTH   2100
#define ES9257_PERIOD   20000
#define ES9257_MAX_ANGLE   180.0


typedef struct _es9257_contextes9257_context

Function Documentation

es9257_context es9257_init ( int32_t  pin,
int32_t  min_pulse_width,
int32_t  max_pulse_width 

Instantiates a the servo at the given pin

pinServo pin number
minPulseWidthMinimum pulse width, in microseconds
maxPulseWidthMaximum pulse width, in microseconds

Here is the call graph for this function:

void es9257_halt ( es9257_context  dev)

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

upm_result_t es9257_set_angle ( es9257_context  dev,
int32_t  angle 

Sets the angle of the servo engine.

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

Here is the caller graph for this function:

void es9257_set_min_pulse_width ( es9257_context  dev,
int  width 

Sets the minimum pulse width

widthMinimum HIGH signal width
void es9257_set_max_pulse_width ( es9257_context  dev,
int  width 

Sets the maximum pulse width

widthMaximum HIGH signal width
int es9257_get_min_pulse_width ( es9257_context  dev)

Returns the minimum pulse width

Minimum pulse width
int es9257_get_max_pulse_width ( es9257_context  dev)

Returns the maximum pulse width

Maximum pulse width