buzz 2.0.0.0
BUZZ Click Driver

API for configuring and manipulating BUZZ Click driver. More...

Topics

 BUZZ PWM Settings
 Settings for configuration of BUZZ Click driver.
 
 BUZZ MikroBUS Map
 MikroBUS pin mapping of BUZZ Click driver.
 
 Buzz_cfg
 
 Buzz_freq
 Buzz frequency.
 

Functions

void buzz_cfg_setup (buzz_cfg_t *cfg)
 BUZZ configuration object setup function.
 
err_t buzz_init (buzz_t *ctx, buzz_cfg_t *cfg)
 BUZZ initialization function.
 
err_t buzz_set_duty_cycle (buzz_t *ctx, float duty_cycle)
 BUZZ sets PWM duty cycle.
 
err_t buzz_pwm_stop (buzz_t *ctx)
 BUZZ stop PWM module.
 
err_t buzz_pwm_start (buzz_t *ctx)
 BUZZ start PWM module.
 
void buzz_play_sound (buzz_t *ctx, uint16_t freq, uint16_t level, uint16_t duration)
 BUZZ Play sound function.
 

Detailed Description

API for configuring and manipulating BUZZ 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

◆ buzz_cfg_setup()

void buzz_cfg_setup ( buzz_cfg_t * cfg)

BUZZ configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ buzz_init()

err_t buzz_init ( buzz_t * ctx,
buzz_cfg_t * cfg )

BUZZ initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See buzz_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See buzz_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ buzz_play_sound()

void buzz_play_sound ( buzz_t * ctx,
uint16_t freq,
uint16_t level,
uint16_t duration )

BUZZ Play sound function.

This function plays sound on buzzer.

Parameters
[out]ctx: Click context object. See buzz_t object definition for detailed explanation.
[in]freq: Buzz sound frequency.
[in]level: Buzz sound level. ( min = 1, max = 1000 )
[in]duration: Buzz sound duration in miliseconds.
Returns
Nothing.
Note
None.

◆ buzz_pwm_start()

err_t buzz_pwm_start ( buzz_t * ctx)

BUZZ start PWM module.

This function starts the PWM moudle output.

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

◆ buzz_pwm_stop()

err_t buzz_pwm_stop ( buzz_t * ctx)

BUZZ stop PWM module.

This function stops the PWM moudle output.

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

◆ buzz_set_duty_cycle()

err_t buzz_set_duty_cycle ( buzz_t * ctx,
float duty_cycle )

BUZZ sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

Parameters
[out]ctx: Click context object. See buzz_t object definition for detailed explanation.
[in]duty_ratio: PWM duty_ratio.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.