EIE4-FYP/demo/note.cpp
Aadi Desai 79ab8cd538
Add waveform selection to demo software
Available waveforms: Sawtooth, Square, Triangle, Sine (To be completed)
2023-05-18 12:52:17 +01:00

13 lines
243 B
C++

#include <generated/csr.h>
#include <stdint.h>
void note(uint32_t frequency, unsigned int duration_ms) {
audio_targ0_write(frequency);
busy_wait(duration_ms);
audio_targ0_write(0);
}
void wave(uint32_t wave) {
audio_wave0_write(wave);
}