button3
2.1.0.0
|
API for configuring and manipulating Button 3 Click driver. More...
Modules | |
Button 3 Registers List | |
List of registers of Button 3 Click driver. | |
Button 3 Registers Settings | |
Settings for registers of Button 3 Click driver. | |
Button 3 MikroBUS Map | |
MikroBUS pin mapping of Button 3 Click driver. | |
Functions | |
void | button3_cfg_setup (button3_cfg_t *cfg) |
Button 3 configuration object setup function. More... | |
err_t | button3_init (button3_t *ctx, button3_cfg_t *cfg) |
Button 3 initialization function. More... | |
err_t | button3_default_cfg (button3_t *ctx) |
Button 3 default configuration function. More... | |
err_t | button3_write_reg (button3_t *ctx, uint8_t reg, uint8_t data_in) |
Button 3 write reg function. More... | |
err_t | button3_read_reg (button3_t *ctx, uint8_t reg, uint8_t *data_out) |
Button 3 read reg function. More... | |
void | button3_reset_device (button3_t *ctx) |
Button 3 reset device function. More... | |
void | button3_set_rst_pin (button3_t *ctx, uint8_t state) |
Button 3 set RST pin function. More... | |
uint8_t | button3_get_int_pin (button3_t *ctx) |
Button 3 get INT pin function. More... | |
err_t | button3_get_red_button (button3_t *ctx, uint8_t *state) |
Button 3 get red button function. More... | |
err_t | button3_get_green_button (button3_t *ctx, uint8_t *state) |
Button 3 get green button function. More... | |
err_t | button3_get_blue_button (button3_t *ctx, uint8_t *state) |
Button 3 get blue button function. More... | |
err_t | button3_get_red_led (button3_t *ctx, uint8_t *state) |
Button 3 get red led function. More... | |
err_t | button3_get_green_led (button3_t *ctx, uint8_t *state) |
Button 3 get green led function. More... | |
err_t | button3_get_blue_led (button3_t *ctx, uint8_t *state) |
Button 3 get blue led function. More... | |
err_t | button3_enable_red_led (button3_t *ctx) |
Button 3 enable red led function. More... | |
err_t | button3_enable_green_led (button3_t *ctx) |
Button 3 enable green led function. More... | |
err_t | button3_enable_blue_led (button3_t *ctx) |
Button 3 enable blue led function. More... | |
err_t | button3_disable_red_led (button3_t *ctx) |
Button 3 disable red led function. More... | |
err_t | button3_disable_green_led (button3_t *ctx) |
Button 3 disable green led function. More... | |
err_t | button3_disable_blue_led (button3_t *ctx) |
Button 3 disable blue led function. More... | |
err_t | button3_toggle_red_led (button3_t *ctx) |
Button 3 toggle red led function. More... | |
err_t | button3_toggle_green_led (button3_t *ctx) |
Button 3 toggle green led function. More... | |
err_t | button3_toggle_blue_led (button3_t *ctx) |
Button 3 toggle blue led function. More... | |
API for configuring and manipulating Button 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void button3_cfg_setup | ( | button3_cfg_t * | cfg | ) |
Button 3 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See button3_cfg_t object definition for detailed explanation. |
err_t button3_default_cfg | ( | button3_t * | ctx | ) |
Button 3 default configuration function.
This function executes a default configuration of Button 3 Click board.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_disable_blue_led | ( | button3_t * | ctx | ) |
Button 3 disable blue led function.
This function disables the blue button LED by setting the BK pin to the high logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_disable_green_led | ( | button3_t * | ctx | ) |
Button 3 disable green led function.
This function disables the green button LED by setting the GK pin to the high logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_disable_red_led | ( | button3_t * | ctx | ) |
Button 3 disable red led function.
This function disables the red button LED by setting the RK pin to the high logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_enable_blue_led | ( | button3_t * | ctx | ) |
Button 3 enable blue led function.
This function enables the blue button LED by setting the BK pin to the low logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_enable_green_led | ( | button3_t * | ctx | ) |
Button 3 enable green led function.
This function enables the green button LED by setting the GK pin to the low logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_enable_red_led | ( | button3_t * | ctx | ) |
Button 3 enable red led function.
This function enables the red button LED by setting the RK pin to the low logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_get_blue_button | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get blue button function.
This function reads the blue button (B1 pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_get_blue_led | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get blue led function.
This function reads the blue LED (BK pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_get_green_button | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get green button function.
This function reads the green button (G1 pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_get_green_led | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get green led function.
This function reads the green LED (GK pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t button3_get_int_pin | ( | button3_t * | ctx | ) |
Button 3 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
err_t button3_get_red_button | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get red button function.
This function reads the red button (R1 pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_get_red_led | ( | button3_t * | ctx, |
uint8_t * | state | ||
) |
Button 3 get red led function.
This function reads the red LED (RK pin) logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_init | ( | button3_t * | ctx, |
button3_cfg_t * | cfg | ||
) |
Button 3 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See button3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_read_reg | ( | button3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Button 3 read reg function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See button3_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 button3_reset_device | ( | button3_t * | ctx | ) |
Button 3 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
void button3_set_rst_pin | ( | button3_t * | ctx, |
uint8_t | state | ||
) |
Button 3 set RST pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
[in] | state | :
|
err_t button3_toggle_blue_led | ( | button3_t * | ctx | ) |
Button 3 toggle blue led function.
This function toggles the blue button LED by toggling the BK pin logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_toggle_green_led | ( | button3_t * | ctx | ) |
Button 3 toggle green led function.
This function toggles the green button LED by toggling the GK pin logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_toggle_red_led | ( | button3_t * | ctx | ) |
Button 3 toggle red led function.
This function toggles the red button LED by toggling the RK pin logic state.
[in] | ctx | : Click context object. See button3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t button3_write_reg | ( | button3_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Button 3 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 button3_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.