buttony 2.0.0.0
|
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. | |
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.
void buttony_cfg_setup | ( | buttony_cfg_t * | cfg | ) |
Button Y configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buttony_cfg_t object definition for detailed explanation. |
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.
[out] | ctx | : Click context object. See buttony_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
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.
[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. |
0
- Success, -1
- Error.err_t buttony_pwm_start | ( | buttony_t * | ctx | ) |
Button Y start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See buttony_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttony_pwm_stop | ( | buttony_t * | ctx | ) |
Button Y stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See buttony_t object definition for detailed explanation. |
0
- Success, -1
- Error.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 ] ).
[out] | ctx | : Click context object. See buttony_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.