thumbstick
2.0.0.0
|
Functions | |
void | thumbstick_cfg_setup (thumbstick_cfg_t *cfg) |
Config Object Initialization function. More... | |
THUMBSTICK_RETVAL | thumbstick_init (thumbstick_t *ctx, thumbstick_cfg_t *cfg) |
Initialization function. More... | |
void | thumbstick_generic_transfer (thumbstick_t *ctx, spi_master_transfer_data_t *block) |
Generic transfer function. More... | |
uint16_t | thumbstick_read_data (thumbstick_t *ctx, uint8_t channel) |
Generic read 2 byte of data function. More... | |
uint8_t | thumbstick_get_position (thumbstick_t *ctx) |
Get thumbstick position function. More... | |
uint8_t | thumbstick_button_state (thumbstick_t *ctx) |
Get state of thumbstick button function. More... | |
uint8_t thumbstick_button_state | ( | thumbstick_t * | ctx | ) |
Get state of thumbstick button function.
Function return state of thumbstick button 0 or 1 by read state of INT pin from MCP3204 chip of the Thumbstick Click.
void thumbstick_cfg_setup | ( | thumbstick_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void thumbstick_generic_transfer | ( | thumbstick_t * | ctx, |
spi_master_transfer_data_t * | block | ||
) |
Generic transfer function.
ctx | Click object. |
block | Transfer block structure. |
Generic SPI transfer, for sending and receiving packages
uint8_t thumbstick_get_position | ( | thumbstick_t * | ctx | ) |
Get thumbstick position function.
Function get position of thumbstick, return position state value from 0 to 5 that calculeted by the value read ADC value from the MCP3204 chip.
THUMBSTICK_RETVAL thumbstick_init | ( | thumbstick_t * | ctx, |
thumbstick_cfg_t * | cfg | ||
) |
Initialization function.
thumbstick | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
uint16_t thumbstick_read_data | ( | thumbstick_t * | ctx, |
uint8_t | channel | ||
) |
Generic read 2 byte of data function.
read_channel |
|
14-bit read ADC data
Function read 14-bit ADC data from selected channel from MCP3204 chip of the Thumbstick Click.