thumbwheel 2.0.0.0
|
API for configuring and manipulating Thumbwheel Click driver. More...
Topics | |
Thumbwheel Commands List | |
List of commands of Thumbwheel Click driver. | |
Thumbwheel Settings | |
Settings of Thumbwheel Click driver. | |
Thumbwheel MikroBUS Map | |
MikroBUS pin mapping of Thumbwheel Click driver. | |
Thumbwheel_reg | |
Functions | |
void | thumbwheel_cfg_setup (thumbwheel_cfg_t *cfg) |
Thumbwheel configuration object setup function. | |
void | thumbwheel_gpio_selection (thumbwheel_cfg_t *cfg, thumbwheel_gpio_sel_t gpio_sel) |
Thumbwheel driver interface setup function. | |
err_t | thumbwheel_init (thumbwheel_t *ctx, thumbwheel_cfg_t *cfg) |
Thumbwheel initialization function. | |
err_t | thumbwheel_check_communication (thumbwheel_t *ctx) |
Thumbwheel check communication function. | |
err_t | thumbwheel_write_register (thumbwheel_t *ctx, uint16_t reg, uint8_t data_in) |
Thumbwheel write register function. | |
err_t | thumbwheel_read_register (thumbwheel_t *ctx, uint16_t reg, uint8_t *data_out) |
Thumbwheel read register function. | |
err_t | thumbwheel_reset_latches (thumbwheel_t *ctx) |
Thumbwheel reset latches function. | |
err_t | thumbwheel_get_position (thumbwheel_t *ctx, uint8_t *position) |
Thumbwheel get position function. | |
void | thumbwheel_set_rst_pin (thumbwheel_t *ctx, uint8_t state) |
Thumbwheel set reset pin function. | |
API for configuring and manipulating Thumbwheel Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void thumbwheel_cfg_setup | ( | thumbwheel_cfg_t * | cfg | ) |
Thumbwheel configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thumbwheel_cfg_t object definition for detailed explanation. |
err_t thumbwheel_check_communication | ( | thumbwheel_t * | ctx | ) |
Thumbwheel check communication function.
This function checks the communication by reading the ROM address twice and comparing the two results, as well as verifying the family code byte.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thumbwheel_get_position | ( | thumbwheel_t * | ctx, |
uint8_t * | position ) |
Thumbwheel get position function.
This function gets the position of the rotary sprocket.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
[out] | position | : Pointing to the address where to store the position value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thumbwheel_gpio_selection | ( | thumbwheel_cfg_t * | cfg, |
thumbwheel_gpio_sel_t | gpio_sel ) |
Thumbwheel driver interface setup function.
This function sets a communication GPIO pin which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See thumbwheel_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See thumbwheel_gpio_sel_t object definition for detailed explanation. |
err_t thumbwheel_init | ( | thumbwheel_t * | ctx, |
thumbwheel_cfg_t * | cfg ) |
Thumbwheel initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thumbwheel_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thumbwheel_read_register | ( | thumbwheel_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | data_out ) |
Thumbwheel read register function.
This function reads data from the register.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
[in] | reg | : Register to read data from. |
[out] | data_out | : Pointing to the address where to store data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thumbwheel_reset_latches | ( | thumbwheel_t * | ctx | ) |
Thumbwheel reset latches function.
This function resets activity latches.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thumbwheel_set_rst_pin | ( | thumbwheel_t * | ctx, |
uint8_t | state ) |
Thumbwheel set reset pin function.
This function sets the state of the reset pin.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
[in] | state | : State of the reset pin to be set. |
err_t thumbwheel_write_register | ( | thumbwheel_t * | ctx, |
uint16_t | reg, | ||
uint8_t | data_in ) |
Thumbwheel write register function.
This function writes data into the register.
[in] | ctx | : Click context object. See thumbwheel_t object definition for detailed explanation. |
[in] | reg | : Register to write data in. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.