buttony 2.0.0.0
Button Y Click Driver

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

Topics

 Button Y PWM Settings
 Settings for configuration of Button Y Click driver.
 
 Button Y MikroBUS Map
 MikroBUS pin mapping of Button Y Click driver.
 
 Buttony_cfg
 

Functions

void buttony_cfg_setup (buttony_cfg_t *cfg)
 Button Y configuration object setup function.
 
err_t buttony_init (buttony_t *ctx, buttony_cfg_t *cfg)
 Button Y initialization function.
 
err_t buttony_set_duty_cycle (buttony_t *ctx, float duty_cycle)
 Button Y sets PWM duty cycle.
 
err_t buttony_pwm_stop (buttony_t *ctx)
 Button Y stop PWM module.
 
err_t buttony_pwm_start (buttony_t *ctx)
 Button Y start PWM module.
 
uint8_t buttony_get_button_state (buttony_t *ctx)
 Button Y get button state function.
 

Detailed Description

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

◆ buttony_cfg_setup()

void buttony_cfg_setup ( buttony_cfg_t * cfg)

Button Y configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ buttony_get_button_state()

uint8_t buttony_get_button_state ( buttony_t * ctx)

Button Y get button state function.

This function reads the digital signal from the INT pin which tells us whether the button has been pressed or not.

Parameters
[out]ctx: Click context object. See buttony_t object definition for detailed explanation.
Returns
Function returns pin logical state (1 or 0).

See #err_t definition for detailed explanation.

Note
None.

◆ buttony_init()

err_t buttony_init ( buttony_t * ctx,
buttony_cfg_t * cfg )

Button Y initialization function.

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

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

◆ buttony_pwm_start()

err_t buttony_pwm_start ( buttony_t * ctx)

Button Y start PWM module.

This function starts the PWM moudle output.

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

◆ buttony_pwm_stop()

err_t buttony_pwm_stop ( buttony_t * ctx)

Button Y stop PWM module.

This function stops the PWM moudle output.

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

◆ buttony_set_duty_cycle()

err_t buttony_set_duty_cycle ( buttony_t * ctx,
float duty_cycle )

Button Y sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

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