buzz 2.0.0.0
main.c File Reference

BUZZ Click example. More...

#include "board.h"
#include "log.h"
#include "buzz.h"

Macros

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

Functions

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

Detailed Description

BUZZ Click example.

Description

This example demonstrates the use of Buzz click boards.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

Application Task

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

Additional Functions

imperial_march( void ) - this function plays the Imperial March melody.

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
Stefan Ilic

Macro Definition Documentation

◆ E

#define E   Q/2

◆ H

#define H   2*Q

◆ Q

#define Q   250

◆ S

#define S   Q/4

◆ VOLUME

#define VOLUME   100

◆ 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 )

◆ main()

int main ( void )