joystick3 2.1.0.0
|
API for configuring and manipulating Joystick 3 Click driver. More...
Topics | |
Joystick 3 Registers Settings | |
Settings for registers of Joystick 3 Click driver. | |
Joystick 3 MikroBUS Map | |
MikroBUS pin mapping of Joystick 3 Click driver. | |
Functions | |
void | joystick3_cfg_setup (joystick3_cfg_t *cfg) |
Joystick 3 configuration object setup function. | |
err_t | joystick3_init (joystick3_t *ctx, joystick3_cfg_t *cfg) |
Joystick 3 initialization function. | |
err_t | joystick3_read_raw_adc (joystick3_t *ctx, uint16_t *raw_x, uint16_t *raw_y) |
Joystick 3 read raw adc function. | |
float | joystick3_get_angle (uint16_t raw_x, uint16_t raw_y) |
Joystick 3 get angle function. | |
uint8_t | joystick3_get_position (uint16_t raw_x, uint16_t raw_y) |
Joystick 3 get position function. | |
API for configuring and manipulating Joystick 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void joystick3_cfg_setup | ( | joystick3_cfg_t * | cfg | ) |
Joystick 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See joystick3_cfg_t object definition for detailed explanation. |
float joystick3_get_angle | ( | uint16_t | raw_x, |
uint16_t | raw_y ) |
Joystick 3 get angle function.
This function calculates and returns joystick angle in degrees from raw ADC values for X and Y axis.
[in] | raw_x | : RAW X axis data (0-4095). |
[in] | raw_y | : RAW Y axis data (0-4095). |
uint8_t joystick3_get_position | ( | uint16_t | raw_x, |
uint16_t | raw_y ) |
Joystick 3 get position function.
This function calculates and returns joystick position flag from raw ADC values for X and Y axis.
[in] | raw_x | : RAW X axis data (0-4095). |
[in] | raw_y | : RAW Y axis data (0-4095). |
err_t joystick3_init | ( | joystick3_t * | ctx, |
joystick3_cfg_t * | cfg ) |
Joystick 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See joystick3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See joystick3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t joystick3_read_raw_adc | ( | joystick3_t * | ctx, |
uint16_t * | raw_x, | ||
uint16_t * | raw_y ) |
Joystick 3 read raw adc function.
This function reads the raw ADC for X and Y axis by using SPI serial interface.
[in] | ctx | : Click context object. See joystick3_t object definition for detailed explanation. |
[out] | raw_x | : RAW X axis data (0-4095). |
[out] | raw_y | : RAW Y axis data (0-4095). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.