joystick2 2.0.0.0
|
Functions | |
void | joystick2_cfg_setup (joystick2_cfg_t *cfg) |
Config Object Initialization function. | |
JOYSTICK2_RETVAL | joystick2_init (joystick2_t *ctx, joystick2_cfg_t *cfg) |
Initialization function. | |
void | joystick2_default_cfg (joystick2_t *ctx) |
Click Default Configuration function. | |
void | joystick2_generic_write (joystick2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | joystick2_generic_read (joystick2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | joystick2_reset (joystick2_t *ctx) |
Functions for reset module. | |
uint8_t | joystick2_get_interrupt_state (joystick2_t *ctx) |
Functions for read interrupt state. | |
void | joystick2_set_cfg_register (joystick2_t *ctx, uint8_t cfg_data) |
Functions for configuration joystick. | |
uint8_t | joystick2_get_position (joystick2_t *ctx) |
Functions for get Joystick position. | |
void joystick2_cfg_setup | ( | joystick2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void joystick2_default_cfg | ( | joystick2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Joystick2 click.
CONFIGURATION ------------------------------------------- JOYSTICK2_CFG_ENABLE_DOWN_POS JOYSTICK2_CFG_ENABLE_LEFT_POS JOYSTICK2_CFG_ENABLE_UP_POS JOYSTICK2_CFG_ENABLE_RIGHT_POS JOYSTICK2_CFG_ENABLE_BUTTON
void joystick2_generic_read | ( | joystick2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void joystick2_generic_write | ( | joystick2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t joystick2_get_interrupt_state | ( | joystick2_t * | ctx | ) |
Functions for read interrupt state.
ctx | Click object. |
Interrupt | state on the INT pin |
uint8_t joystick2_get_position | ( | joystick2_t * | ctx | ) |
Functions for get Joystick position.
ctx | Click object. |
Joystick | position (UP, DOWN, LEFT, RIGHT or BUTTON ACTIVE) |
JOYSTICK2_RETVAL joystick2_init | ( | joystick2_t * | ctx, |
joystick2_cfg_t * | cfg ) |
Initialization function.
joystick2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void joystick2_reset | ( | joystick2_t * | ctx | ) |
Functions for reset module.
ctx | Click object. |
void joystick2_set_cfg_register | ( | joystick2_t * | ctx, |
uint8_t | cfg_data ) |
Functions for configuration joystick.
ctx | Click object. |
cfg_data | The configuration data to be set |