joystick4
2.1.0.0
|
API for configuring and manipulating Joystick 4 Click driver. More...
Modules | |
Joystick 4 Registers List | |
List of registers of Joystick 4 Click driver. | |
Joystick 4 Registers Settings | |
Settings for registers of Joystick 4 Click driver. | |
Joystick 4 MikroBUS Map | |
MikroBUS pin mapping of Joystick 4 Click driver. | |
Functions | |
void | joystick4_cfg_setup (joystick4_cfg_t *cfg) |
Joystick 4 configuration object setup function. More... | |
err_t | joystick4_init (joystick4_t *ctx, joystick4_cfg_t *cfg) |
Joystick 4 initialization function. More... | |
err_t | joystick4_default_cfg (joystick4_t *ctx) |
Joystick 4 default configuration function. More... | |
err_t | joystick4_write_reg (joystick4_t *ctx, uint8_t reg, uint8_t data_in) |
Joystick 4 write reg function. More... | |
err_t | joystick4_read_reg (joystick4_t *ctx, uint8_t reg, uint8_t *data_out) |
Joystick 4 read reg function. More... | |
void | joystick4_reset_device (joystick4_t *ctx) |
Joystick 4 reset device function. More... | |
void | joystick4_set_rst_pin (joystick4_t *ctx, uint8_t state) |
Joystick 4 set RST pin function. More... | |
uint8_t | joystick4_get_int_pin (joystick4_t *ctx) |
Joystick 4 get INT pin function. More... | |
err_t | joystick4_get_pins (joystick4_t *ctx, uint8_t *pin_mask) |
Joystick 4 get pins function. More... | |
uint8_t | joystick4_get_position (uint8_t pin_mask) |
Joystick 4 get position function. More... | |
API for configuring and manipulating Joystick 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void joystick4_cfg_setup | ( | joystick4_cfg_t * | cfg | ) |
Joystick 4 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See joystick4_cfg_t object definition for detailed explanation. |
err_t joystick4_default_cfg | ( | joystick4_t * | ctx | ) |
Joystick 4 default configuration function.
This function executes a default configuration of Joystick 4 Click board.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t joystick4_get_int_pin | ( | joystick4_t * | ctx | ) |
Joystick 4 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
err_t joystick4_get_pins | ( | joystick4_t * | ctx, |
uint8_t * | pin_mask | ||
) |
Joystick 4 get pins function.
This function reads all input pins logic state.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
[out] | pin_mask | : Input pins read state mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t joystick4_get_position | ( | uint8_t | pin_mask | ) |
Joystick 4 get position function.
This function returns the joystick position flag extracted from the input pins state mask.
[in] | pin_mask | : Input pins state mask. |
err_t joystick4_init | ( | joystick4_t * | ctx, |
joystick4_cfg_t * | cfg | ||
) |
Joystick 4 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See joystick4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t joystick4_read_reg | ( | joystick4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Joystick 4 read reg function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void joystick4_reset_device | ( | joystick4_t * | ctx | ) |
Joystick 4 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
void joystick4_set_rst_pin | ( | joystick4_t * | ctx, |
uint8_t | state | ||
) |
Joystick 4 set RST pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
[in] | state | :
|
err_t joystick4_write_reg | ( | joystick4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Joystick 4 write reg function.
This function writes a desired data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See joystick4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.