-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSound.h
More file actions
62 lines (50 loc) · 1.8 KB
/
Sound.h
File metadata and controls
62 lines (50 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Sound.h
// This module contains the SysTick ISR that plays sound
// Runs on TM4C123
// Program written by: Devin Chaky
// Date Created: 1/2/23
// Last Modified: 2/20/23
// Lab number: 6
// Hardware connections
// Input switches on PA5-2, 6-bit DAC output pins PB5-0
#ifndef SOUND_H
#define SOUND_H
#include <stdint.h>
// Header files contain the prototypes for public functions
// this file explains what the module does
// **************Sound_Init*********************
// Initialize digital outputs and SysTick timer
// Called once, with sound/interrupts initially off
// Input: none
// Output: none
void Sound_Init(void);
// **************Sound_Start*********************
// Start sound output, and set Systick interrupt period
// Sound continues until Sound_Start called again, or Sound_Off is called
// This function returns right away and sound is produced using a periodic interrupt
// Input: interrupt period
// Units of period to be determined by YOU
// Maximum period to be determined by YOU
// Minimum period to be determined by YOU
// if period equals zero, disable sound output
// Output: none
void Sound_Start(uint32_t period);
// **************Sound_Voice*********************
// Change voice
// ECE319K optional
// Input: voice specifies which waveform to play
// Pointer to wave table
// Output: none
void Sound_Voice(const uint8_t *voice);
// **************Sound_Off*********************
// stop outputing to DAC
// Output: none
void Sound_Off(void);
// **************Sound_GetVoice*********************
// Read the current voice
// ECE319K optional
// Input:
// Output: voice specifies which waveform to play
// Pointer to current wave table
const uint8_t *Sound_GetVoice(void);
#endif