|
upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|

Go to the source code of this file.
Data Structures | |
| struct | _joystick12_context |
Functions | |
| joystick12_context | joystick12_init (int16_t apin_x, int16_t apin_y) |
| void | joystick12_close (joystick12_context dev) |
| upm_result_t | joystick12_read_data (const joystick12_context dev, int *values) |
| upm_result_t | joystick12_set_offset_x (const joystick12_context dev, float offset) |
| upm_result_t | joystick12_set_offset_y (const joystick12_context dev, float offset) |
| upm_result_t | joystick12_set_scale_x (const joystick12_context dev, float scale) |
| upm_result_t | joystick12_set_scale_y (const joystick12_context dev, float scale) |
| upm_result_t | joystick12_get_value_x (const joystick12_context dev, float *value) |
| upm_result_t | joystick12_get_value_y (const joystick12_context dev, float *value) |
| upm_result_t | joystick12_zero (const joystick12_context dev) |
| upm_result_t | joystick12_calibrate_x (const joystick12_context dev) |
| upm_result_t | joystick12_calibrate_y (const joystick12_context dev) |
Typedefs | |
| typedef struct _joystick12_context * | joystick12_context |
| joystick12_context joystick12_init | ( | int16_t | apin_x, |
| int16_t | apin_y | ||
| ) |
Initialize analog sensor
| pin | is Analog pin |
| void joystick12_close | ( | joystick12_context | dev | ) |
Analog sensor destructor
| sensor | context pointer deallocate memory |
| upm_result_t joystick12_read_data | ( | const joystick12_context | dev, |
| int * | values | ||
| ) |
Generic read joystick data method
| dev | sensor device context pointer |
| value | pointer to an int[2] in which data is returned |

| upm_result_t joystick12_set_offset_x | ( | const joystick12_context | dev, |
| float | offset | ||
| ) |
Set sensor offset. This offset is applied to the return value: counts = counts + offset
| dev | sensor context pointer |
| offset | count offset value used |
| upm_result_t joystick12_set_offset_y | ( | const joystick12_context | dev, |
| float | offset | ||
| ) |
Set sensor offset. This offset is applied to the return value: counts = counts + offset
| dev | sensor context pointer |
| offset | count offset value used |
| upm_result_t joystick12_set_scale_x | ( | const joystick12_context | dev, |
| float | scale | ||
| ) |
Set sensor scale. This scale is applied to the return value: counts = counts * scale
| dev | sensor context pointer |
| scale | count scale value used |
| upm_result_t joystick12_set_scale_y | ( | const joystick12_context | dev, |
| float | scale | ||
| ) |
Set sensor scale. This scale is applied to the return value: counts = counts * scale
| dev | sensor context pointer |
| scale | count scale value used |
| upm_result_t joystick12_get_value_x | ( | const joystick12_context | dev, |
| float * | value | ||
| ) |
Read value from sensor
| dev | sensor context pointer |
| *value | normalized value from sensor, units depend on unit enum |
| unit | Enum which specifies units returned in *value |

| upm_result_t joystick12_get_value_y | ( | const joystick12_context | dev, |
| float * | value | ||
| ) |
Read value from sensor
| dev | sensor context pointer |
| *value | normalized value from sensor, units depend on unit enum |
| unit | Enum which specifies units returned in *value |

| upm_result_t joystick12_zero | ( | const joystick12_context | dev | ) |
Zero out the sensor x and y axis
| dev | sensor context pointer |

| upm_result_t joystick12_calibrate_x | ( | const joystick12_context | dev | ) |
Set x scale. Move joystick to min or max x and call calibrate
| dev | sensor context pointer |

| upm_result_t joystick12_calibrate_y | ( | const joystick12_context | dev | ) |
Set y scale. Move joystick to min or max y and call calibrate
| dev | sensor context pointer |

| typedef struct _joystick12_context * joystick12_context |
device context
1.8.11