Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
buzzer.c File Reference

Implementation of the PWM buzzer driver. More...

#include "buzzer.h"
#include "main.h"
Include dependency graph for buzzer.c:

Go to the source code of this file.

Macros

#define TIMER_CLOCK_FREQ   240000000UL
 The input clock frequency to the timer peripheral.
 
#define TIMER_PRESCALER   2400
 A fixed prescaler to bring the timer frequency into a usable range.
 

Functions

void buzzer_init (buzzer_t *bz, TIM_HandleTypeDef *htim, uint32_t channel)
 Initializes the buzzer object and its associated timer hardware.
 
void musica_maestro (buzzer_t *bz, const note_t *partition, uint16_t melody_length)
 Plays a melody by iterating through an array of notes.
 

Variables

buzzer_t buzzer
 Global instance of the buzzer object.
 

Detailed Description

Implementation of the PWM buzzer driver.

Author
Francesco Abate
See also
buzzer.h for API documentation and usage examples.

Definition in file buzzer.c.

Macro Definition Documentation

◆ TIMER_CLOCK_FREQ

#define TIMER_CLOCK_FREQ   240000000UL

The input clock frequency to the timer peripheral.

Definition at line 13 of file buzzer.c.

◆ TIMER_PRESCALER

#define TIMER_PRESCALER   2400

A fixed prescaler to bring the timer frequency into a usable range.

Definition at line 14 of file buzzer.c.