buttong 2.0.0.0
|
API for configuring and manipulating Button G Click driver. More...
Topics | |
Button G PWM Settings | |
Settings for configuration of Button G Click driver. | |
Button G MikroBUS Map | |
MikroBUS pin mapping of Button G Click driver. | |
Buttong_cfg | |
Functions | |
void | buttong_cfg_setup (buttong_cfg_t *cfg) |
Button G configuration object setup function. | |
err_t | buttong_init (buttong_t *ctx, buttong_cfg_t *cfg) |
Button G initialization function. | |
err_t | buttong_set_duty_cycle (buttong_t *ctx, float duty_cycle) |
Button G sets PWM duty cycle. | |
err_t | buttong_pwm_stop (buttong_t *ctx) |
Button G stop PWM module. | |
err_t | buttong_pwm_start (buttong_t *ctx) |
Button G start PWM module. | |
uint8_t | buttong_get_button_state (buttong_t *ctx) |
Button G get button state function. | |
API for configuring and manipulating Button G Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void buttong_cfg_setup | ( | buttong_cfg_t * | cfg | ) |
Button G configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buttong_cfg_t object definition for detailed explanation. |
uint8_t buttong_get_button_state | ( | buttong_t * | ctx | ) |
Button G 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 buttong_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
err_t buttong_init | ( | buttong_t * | ctx, |
buttong_cfg_t * | cfg ) |
Button G initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See buttong_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See buttong_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttong_pwm_start | ( | buttong_t * | ctx | ) |
Button G start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See buttong_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttong_pwm_stop | ( | buttong_t * | ctx | ) |
Button G stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See buttong_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buttong_set_duty_cycle | ( | buttong_t * | ctx, |
float | duty_cycle ) |
Button G sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See buttong_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.