joystick
2.0.0.0
|
Functions | |
void | joystick_cfg_setup (joystick_cfg_t *cfg) |
Config Object Initialization function. More... | |
JOYSTCIK_RETVAL | joystick_init (joystick_t *ctx, joystick_cfg_t *cfg) |
Initialization function. More... | |
void | joystick_default_cfg (joystick_t *ctx) |
Click Default Configuration function. More... | |
void | joystick_generic_write (joystick_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
void | joystick_generic_read (joystick_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
void | joystick_set_default_configuration (joystick_t *ctx) |
Set default configuration function. More... | |
uint8_t | joystick_check_id_code (joystick_t *ctx) |
Check sensor ID code function. More... | |
uint8_t | joystick_check_id_version (joystick_t *ctx) |
Check sensor ID version function. More... | |
void | joystick_set_low_power_mode (joystick_t *ctx, uint8_t timings) |
Set Low Power Mode function. More... | |
void | joystick_set_scaling_factor (joystick_t *ctx, uint8_t scaling_factor) |
Set scaling factor function. More... | |
void | joystick_disabled_interrupt (joystick_t *ctx) |
Set interrupt disabled function. More... | |
void | joystick_enabled_interrupt (joystick_t *ctx) |
Set interrupt enabled function. More... | |
void | joystick_invert_spinning (joystick_t *ctx) |
Invert the channel voltage function. More... | |
uint8_t | joystick_get_position (joystick_t *ctx) |
Get joystick position function. More... | |
uint8_t | joystick_get_interrupt (joystick_t *ctx) |
Get state of interrupt pin function. More... | |
uint8_t | joystick_press_button (joystick_t *ctx) |
Get state of Joystick button function. More... | |
void | joystick_soft_reset (joystick_t *ctx) |
General soft reset function. More... | |
void | joystick_hardware_reset (joystick_t *ctx) |
General hardware reset function. More... | |
void joystick_cfg_setup | ( | joystick_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t joystick_check_id_code | ( | joystick_t * | ctx | ) |
Check sensor ID code function.
ctx | Click object. |
@description Function read and return sensor ID code from ID Code register.
uint8_t joystick_check_id_version | ( | joystick_t * | ctx | ) |
Check sensor ID version function.
ctx | Click object. |
@description Function read and return sensor ID version from ID Version register.
void joystick_default_cfg | ( | joystick_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Joystick click.
void joystick_disabled_interrupt | ( | joystick_t * | ctx | ) |
Set interrupt disabled function.
ctx | Click object. |
Set interrupt disabled function
@description Function set interrupt output is disabled.
void joystick_enabled_interrupt | ( | joystick_t * | ctx | ) |
Set interrupt enabled function.
ctx | Click object. |
@description Function set interrupt output is enabled.
void joystick_generic_read | ( | joystick_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 joystick_generic_write | ( | joystick_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 joystick_get_interrupt | ( | joystick_t * | ctx | ) |
Get state of interrupt pin function.
ctx | Click object. |
@description Function read state of interrupt ( INT ) pin, and return 0 or 1.
uint8_t joystick_get_position | ( | joystick_t * | ctx | ) |
Get joystick position function.
ctx | Click object. |
@description Function get position of miniature joystick module ( N50P105 ), return position state value from 0 to 8 that calculeted by the value read from the register of the AS5013 Hall IC.
void joystick_hardware_reset | ( | joystick_t * | ctx | ) |
General hardware reset function.
ctx | Click object. |
@description Function hardware reset register of the AS5013 Hall IC, by set RST pin high.
JOYSTCIK_RETVAL joystick_init | ( | joystick_t * | ctx, |
joystick_cfg_t * | cfg | ||
) |
Initialization function.
joystick | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void joystick_invert_spinning | ( | joystick_t * | ctx | ) |
Invert the channel voltage function.
ctx | Click object. |
@description Function set invert the channel voltage, set to invert the magnet polarity.
uint8_t joystick_press_button | ( | joystick_t * | ctx | ) |
Get state of Joystick button function.
ctx | Click object. |
@description Function read state of Joystick button ( CS ) pin, and return 0 or 1.
void joystick_set_default_configuration | ( | joystick_t * | ctx | ) |
Set default configuration function.
ctx | Click object. |
@description Function set default configuration, set required Test bits of Control Register 2, set maximum sensitivity, set scaling Factor to 90.8% and reset read value by writing configuration 1 register.
void joystick_set_low_power_mode | ( | joystick_t * | ctx, |
uint8_t | timings | ||
) |
Set Low Power Mode function.
ctx | Click object. |
timings | timings by setting the low power timebase |
@description Function set default configuration, The measurements are triggered with an internal low power oscillator the user can select between 8 different timings by setting the low power timebase.
void joystick_set_scaling_factor | ( | joystick_t * | ctx, |
uint8_t | scaling_factor | ||
) |
Set scaling factor function.
ctx | Click object. | |
[in] | scalingFactor | scaling factor |
@description Function set scaling factor value of the XY coordinates to fit to the 8-bit X and Y_res_int register (full dynamic range);
void joystick_soft_reset | ( | joystick_t * | ctx | ) |
General soft reset function.
ctx | Click object. |
@description Function soft reset register of the AS5013 Hall IC. All the internal registers are loaded with their reset value. The Control Register 1 is loaded as well with the value 0xF0, then the Soft_rst bit goes back to 0 (Normal mode) once the internal reset sequence is finished.