rotaryswitch 2.1.0.0
|
API for configuring and manipulating Rotary Switch Click driver. More...
Topics | |
Rotary Switch Registers List | |
List of registers of Rotary Switch Click driver. | |
Rotary Switch Registers Settings | |
Settings for registers of Rotary Switch Click driver. | |
Rotary Switch MikroBUS Map | |
MikroBUS pin mapping of Rotary Switch Click driver. | |
Functions | |
void | rotaryswitch_cfg_setup (rotaryswitch_cfg_t *cfg) |
Rotary Switch configuration object setup function. | |
err_t | rotaryswitch_init (rotaryswitch_t *ctx, rotaryswitch_cfg_t *cfg) |
Rotary Switch initialization function. | |
err_t | rotaryswitch_default_cfg (rotaryswitch_t *ctx) |
Rotary Switch default configuration function. | |
err_t | rotaryswitch_write_reg (rotaryswitch_t *ctx, uint8_t reg, uint8_t data_in) |
Rotary Switch write reg function. | |
err_t | rotaryswitch_read_reg (rotaryswitch_t *ctx, uint8_t reg, uint8_t *data_out) |
Rotary Switch read reg function. | |
err_t | rotaryswitch_get_position (rotaryswitch_t *ctx, uint8_t *position) |
Rotary Switch get position function. | |
API for configuring and manipulating Rotary Switch Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void rotaryswitch_cfg_setup | ( | rotaryswitch_cfg_t * | cfg | ) |
Rotary Switch configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rotaryswitch_cfg_t object definition for detailed explanation. |
err_t rotaryswitch_default_cfg | ( | rotaryswitch_t * | ctx | ) |
Rotary Switch default configuration function.
This function executes a default configuration of Rotary Switch Click board.
[in] | ctx | : Click context object. See rotaryswitch_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rotaryswitch_get_position | ( | rotaryswitch_t * | ctx, |
uint8_t * | position ) |
Rotary Switch get position function.
This function reads the rotary switch position.
[in] | ctx | : Click context object. See rotaryswitch_t object definition for detailed explanation. |
[out] | position | : Switch position [0-F]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rotaryswitch_init | ( | rotaryswitch_t * | ctx, |
rotaryswitch_cfg_t * | cfg ) |
Rotary Switch initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See rotaryswitch_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rotaryswitch_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rotaryswitch_read_reg | ( | rotaryswitch_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Rotary Switch read reg function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rotaryswitch_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. err_t rotaryswitch_write_reg | ( | rotaryswitch_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Rotary Switch write reg function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rotaryswitch_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.