buzz3 2.0.0.0
Buzz 3 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ buzz3_cfg_setup()

void buzz3_cfg_setup ( buzz3_cfg_t * cfg)

Buzz 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See buzz3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ buzz3_default_cfg()

err_t buzz3_default_cfg ( buzz3_t * ctx)

Buzz 3 default configuration function.

This function executes a default configuration of Buzz 3 click board.

Parameters
[in]ctx: Click context object. See buzz3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ buzz3_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ buzz3_play_sound()

void buzz3_play_sound ( buzz3_t * ctx,
uint16_t freq,
uint16_t duration )

Buzz 3 play sound function.

This function plays sound on buzzer.

Parameters
[out]ctx: Click object.
[in]freq: Buzz sound frequency.
[in]duration: Buzz sound duration in miliseconds.
Returns
Nothing.

◆ buzz3_pwm_start()

err_t buzz3_pwm_start ( buzz3_t * ctx)

Buzz 3 start PWM module.

This function starts the PWM module output.

Parameters
[out]ctx: Click context object. See buzz3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ buzz3_pwm_stop()

err_t buzz3_pwm_stop ( buzz3_t * ctx)

Buzz 3 stop PWM module.

This function stops the PWM module output.

Parameters
[out]ctx: Click context object. See buzz3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ buzz3_set_duty_cycle()

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 ] ).

Parameters
[out]ctx: Click context object. See buzz3_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ buzz3_set_gain_operating_mode()

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.

Parameters
[out]ctx: Click context object. See buzz3_t object definition for detailed explanation.
[out]op_mode: charge pump mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.