buzz2 2.0.0.0
|
API for configuring and manipulating BUZZ 2 Click driver. More...
Topics | |
BUZZ 2 PWM Settings | |
Settings for configuration of BUZZ 2 Click driver. | |
BUZZ 2 MikroBUS Map | |
MikroBUS pin mapping of BUZZ 2 Click driver. | |
Buzz2_cfg | |
Buzz2_freq | |
BUZZ 2 default frequency. | |
Functions | |
void | buzz2_cfg_setup (buzz2_cfg_t *cfg) |
BUZZ 2 configuration object setup function. | |
err_t | buzz2_init (buzz2_t *ctx, buzz2_cfg_t *cfg) |
BUZZ 2 initialization function. | |
err_t | buzz2_set_duty_cycle (buzz2_t *ctx, float duty_cycle) |
BUZZ 2 sets PWM duty cycle. | |
void | buzz2_play_sound (buzz2_t *ctx, uint16_t freq, uint16_t level, uint16_t duration) |
Play sound function. | |
err_t | buzz2_pwm_stop (buzz2_t *ctx) |
BUZZ 2 stop PWM module. | |
err_t | buzz2_pwm_start (buzz2_t *ctx) |
BUZZ 2 start PWM module. | |
API for configuring and manipulating BUZZ 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void buzz2_cfg_setup | ( | buzz2_cfg_t * | cfg | ) |
BUZZ 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buzz2_cfg_t object definition for detailed explanation. |
err_t buzz2_init | ( | buzz2_t * | ctx, |
buzz2_cfg_t * | cfg ) |
BUZZ 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See buzz2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See buzz2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void buzz2_play_sound | ( | buzz2_t * | ctx, |
uint16_t | freq, | ||
uint16_t | level, | ||
uint16_t | duration ) |
Play sound function.
This function plays sound on buzzer.
[out] | ctx | Click object. |
[in] | freq | Buzz sound frequency. |
[in] | level | Buzz sound level. ( min = 1, max = 1000 ) |
[in] | duration | Buzz sound duration in miliseconds. |
err_t buzz2_pwm_start | ( | buzz2_t * | ctx | ) |
BUZZ 2 start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See buzz2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buzz2_pwm_stop | ( | buzz2_t * | ctx | ) |
BUZZ 2 stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See buzz2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t buzz2_set_duty_cycle | ( | buzz2_t * | ctx, |
float | duty_cycle ) |
BUZZ 2 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See buzz2_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty_cycle. |
0
- Success, -1
- Error.