Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
dac.h
Go to the documentation of this file.
1#ifndef __DAC_H
2#define __DAC_H
3
4#include "dac_types.h"
5#include "types.h"
6
7#include <stdbool.h>
8
9#ifdef DAC_USE_DMA // DMA is not currently working due to "write permission error 65"
10
13void DAC_InitDMA(u32 sample_rate_hz);
14
16void DAC_DeinitDMA(void);
17
21void DAC_PlayDMA(const u16 *const pcm_samples, u32 sample_count);
22
23void DAC_StopDMA(void);
24
25#else
26
33void DAC_BUZInit(u8 timer_a, u8 timer_b, u8 int_priority);
34
35// TODO: Instead of using standard timers, use RIT for seconds, and SYSTICK for sample feeding
36
37void DAC_BUZDeinit(void);
38
42void DAC_BUZPlay(DAC_Tone tone, u16 bpm);
43
44// TODO: Add multiple tone playback using RIT
45
48void DAC_BUZSetVolume(u8 volume);
49
50bool DAC_BUZIsPlaying(void);
51
52void DAC_BUZStop(void);
53
54#endif
55
56#endif
bool DAC_BUZIsPlaying(void)
Definition dac.c:114
void DAC_BUZSetVolume(u8 volume)
Sets the volume of the buzzer.
Definition dac.c:86
void DAC_BUZInit(u8 timer_a, u8 timer_b, u8 int_priority)
Initializes the DAC peripheral.
Definition dac.c:66
void DAC_BUZDeinit(void)
Definition dac.c:76
void DAC_BUZStop(void)
Definition dac.c:119
void DAC_BUZPlay(DAC_Tone tone, u16 bpm)
Plays the given note for the given duration.
Definition dac.c:91
uint8_t u8
Definition types.h:8
uint16_t u16
Definition types.h:7
uint32_t u32
Definition types.h:6