thumbwheel 2.0.0.0
Thumbwheel Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ thumbwheel_cfg_setup()

void thumbwheel_cfg_setup ( thumbwheel_cfg_t * cfg)

Thumbwheel configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See thumbwheel_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ thumbwheel_check_communication()

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.

Parameters
[in]ctx: Click context object. See thumbwheel_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thumbwheel_get_position()

err_t thumbwheel_get_position ( thumbwheel_t * ctx,
uint8_t * position )

Thumbwheel get position function.

This function gets the position of the rotary sprocket.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thumbwheel_gpio_selection()

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.

Parameters
[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.
Returns
Nothing.
Note
This gpio selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ thumbwheel_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ thumbwheel_read_register()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thumbwheel_reset_latches()

err_t thumbwheel_reset_latches ( thumbwheel_t * ctx)

Thumbwheel reset latches function.

This function resets activity latches.

Parameters
[in]ctx: Click context object. See thumbwheel_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thumbwheel_set_rst_pin()

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.

Parameters
[in]ctx: Click context object. See thumbwheel_t object definition for detailed explanation.
[in]state: State of the reset pin to be set.
Returns
None.
Note
None.

◆ thumbwheel_write_register()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.