buzz3 2.0.0.0
main.c File Reference

Buzz3 Click example. More...

#include "board.h"
#include "log.h"
#include "buzz3.h"

Macros

#define W   4*Q
 
#define H   2*Q
 
#define Q   250
 
#define E   Q/2
 
#define S   Q/4
 

Functions

void buzz3_melody (void)
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Buzz3 Click example.

Description

This example demonstrates the use of Buzz 3 click boards with PAM8904 for play the Imperial March. PAM8904 is piezo-sounder driver with an integrated Multi-Mode charge pump boost converter from Diodes Incorporated.

The demo application is composed of two sections :

Application Init

Initializes GPIO, set AN and RST pin as outputs, begins to write a log. Initialization driver enables - GPIO and configures the appropriate MCU pin for sound generation, also write log.

Application Task

Plays the Imperial March melody. Also logs an appropriate message on the USB UART.

Additional Functions :

Note
The minimal PWM Clock frequency required for this example is the frequency of tone C6 - 1047 Hz. So, in order to run this example and play all tones correctly, the user will need to decrease the MCU's main clock frequency in MCU Settings for the certain architectures in order to get the required PWM clock frequency.
Author
Jelena Milosavljevic

Macro Definition Documentation

◆ E

#define E   Q/2

◆ H

#define H   2*Q

◆ Q

#define Q   250

◆ S

#define S   Q/4

◆ W

#define W   4*Q

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ buzz3_melody()

void buzz3_melody ( void )

◆ main()

int main ( void )