buzz3 2.0.0.0
|
API for configuring and manipulating Buzz 3 Click driver. More...
Topics | |
Buzz 3 PWM Settings | |
Settings for configuration of Buzz 3 Click driver. | |
Buzz 3 MikroBUS Map | |
MikroBUS pin mapping of Buzz 3 Click driver. | |
Buzz3_cfg | |
Functions | |
void | buzz3_cfg_setup (buzz3_cfg_t *cfg) |
Buzz 3 configuration object setup function. | |
err_t | buzz3_init (buzz3_t *ctx, buzz3_cfg_t *cfg) |
Buzz 3 initialization function. | |
err_t | buzz3_default_cfg (buzz3_t *ctx) |
Buzz 3 default configuration function. | |
err_t | buzz3_set_duty_cycle (buzz3_t *ctx, float duty_cycle) |
Buzz 3 sets PWM duty cycle. | |
err_t | buzz3_pwm_stop (buzz3_t *ctx) |
Buzz 3 stop PWM module. | |
err_t | buzz3_pwm_start (buzz3_t *ctx) |
Buzz 3 start PWM module. | |
err_t | buzz3_set_gain_operating_mode (buzz3_t *ctx, uint8_t op_mode) |
Buzz 3 set gain operating mode function. | |
void | buzz3_play_sound (buzz3_t *ctx, uint16_t freq, uint16_t duration) |
Buzz 3 play sound function. | |
API for configuring and manipulating Buzz 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void buzz3_cfg_setup | ( | buzz3_cfg_t * | cfg | ) |
Buzz 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buzz3_cfg_t object definition for detailed explanation. |
err_t buzz3_default_cfg | ( | buzz3_t * | ctx | ) |
Buzz 3 default configuration function.
This function executes a default configuration of Buzz 3 click board.
[in] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buzz3_init | ( | buzz3_t * | ctx, |
buzz3_cfg_t * | cfg ) |
Buzz 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See buzz3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void buzz3_play_sound | ( | buzz3_t * | ctx, |
uint16_t | freq, | ||
uint16_t | duration ) |
Buzz 3 play sound function.
This function plays sound on buzzer.
[out] | ctx | : Click object. |
[in] | freq | : Buzz sound frequency. |
[in] | duration | : Buzz sound duration in miliseconds. |
err_t buzz3_pwm_start | ( | buzz3_t * | ctx | ) |
Buzz 3 start PWM module.
This function starts the PWM module output.
[out] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buzz3_pwm_stop | ( | buzz3_t * | ctx | ) |
Buzz 3 stop PWM module.
This function stops the PWM module output.
[out] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buzz3_set_duty_cycle | ( | buzz3_t * | ctx, |
float | duty_cycle ) |
Buzz 3 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty cycle. |
0
- Success, -1
- Error.err_t buzz3_set_gain_operating_mode | ( | buzz3_t * | ctx, |
uint8_t | op_mode ) |
Buzz 3 set gain operating mode function.
The function set gain operating mode of the PAM8904 piezo sounder driver with integrated charge pump boost converter on Buzz 3 click board.
[out] | ctx | : Click context object. See buzz3_t object definition for detailed explanation. |
[out] | op_mode | : charge pump mode. |
0
- Success, -1
- Error.