button2  2.1.0.0
Modules | Functions
Button 2 Click Driver

API for configuring and manipulating Button 2 Click driver. More...

Modules

 Button 2 Settings
 Settings of Button 2 Click driver.
 
 Button 2 MikroBUS Map
 MikroBUS pin mapping of Button 2 Click driver.
 

Functions

void button2_cfg_setup (button2_cfg_t *cfg)
 Button 2 configuration object setup function. More...
 
err_t button2_init (button2_t *ctx, button2_cfg_t *cfg)
 Button 2 initialization function. More...
 
void button2_enable_led (button2_t *ctx)
 Button 2 enable led function. More...
 
void button2_disable_led (button2_t *ctx)
 Button 2 disable led function. More...
 
void button2_toggle_led (button2_t *ctx)
 Button 2 toggle led function. More...
 
uint8_t button2_get_int_pin (button2_t *ctx)
 Button 2 get int pin function. More...
 

Detailed Description

API for configuring and manipulating Button 2 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

◆ button2_cfg_setup()

void button2_cfg_setup ( button2_cfg_t cfg)

Button 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ button2_disable_led()

void button2_disable_led ( button2_t ctx)

Button 2 disable led function.

This function disables button LED by setting the LED pin to the low logic state.

Parameters
[in]ctx: Click context object. See button2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ button2_enable_led()

void button2_enable_led ( button2_t ctx)

Button 2 enable led function.

This function enables button LED by setting the LED pin to the high logic state.

Parameters
[in]ctx: Click context object. See button2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ button2_get_int_pin()

uint8_t button2_get_int_pin ( button2_t ctx)

Button 2 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See button2_t object definition for detailed explanation.
Returns
  • 0 - Button pressed,
  • 1 - Button released.
Note
None.

◆ button2_init()

err_t button2_init ( button2_t ctx,
button2_cfg_t cfg 
)

Button 2 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See button2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See button2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ button2_toggle_led()

void button2_toggle_led ( button2_t ctx)

Button 2 toggle led function.

This function toggles the button LED state by toggling the LED pin logic state.

Parameters
[in]ctx: Click context object. See button2_t object definition for detailed explanation.
Returns
None.
Note
None.