buttonpower 2.0.0.0
|
API for configuring and manipulating Button Power Click driver. More...
Modules | |
Button Power PWM Settings | |
Settings for configuration of Button Power Click driver. | |
Button Power MikroBUS Map | |
MikroBUS pin mapping of Button Power Click driver. | |
Buttonpower_cfg | |
Functions | |
void | buttonpower_cfg_setup (buttonpower_cfg_t *cfg) |
Button Power configuration object setup function. More... | |
err_t | buttonpower_init (buttonpower_t *ctx, buttonpower_cfg_t *cfg) |
Button Power initialization function. More... | |
err_t | buttonpower_set_duty_cycle (buttonpower_t *ctx, float duty_cycle) |
Button Power sets PWM duty cycle. More... | |
err_t | buttonpower_pwm_stop (buttonpower_t *ctx) |
Button Power stop PWM module. More... | |
err_t | buttonpower_pwm_start (buttonpower_t *ctx) |
Button Power start PWM module. More... | |
uint8_t | buttonpower_get_button_state (buttonpower_t *ctx) |
Button Power get button state function. More... | |
API for configuring and manipulating Button Power Click driver.
void buttonpower_cfg_setup | ( | buttonpower_cfg_t * | cfg | ) |
Button Power configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buttonpower_cfg_t object definition for detailed explanation. |
uint8_t buttonpower_get_button_state | ( | buttonpower_t * | ctx | ) |
Button Power 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 buttonpower_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
err_t buttonpower_init | ( | buttonpower_t * | ctx, |
buttonpower_cfg_t * | cfg | ||
) |
Button Power initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See buttonpower_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See buttonpower_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttonpower_pwm_start | ( | buttonpower_t * | ctx | ) |
Button Power start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See buttonpower_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttonpower_pwm_stop | ( | buttonpower_t * | ctx | ) |
Button Power stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See buttonpower_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttonpower_set_duty_cycle | ( | buttonpower_t * | ctx, |
float | duty_cycle | ||
) |
Button Power sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See buttonpower_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.