summaryrefslogtreecommitdiff
path: root/project/Core/Inc/Project
diff options
context:
space:
mode:
Diffstat (limited to 'project/Core/Inc/Project')
-rw-r--r--project/Core/Inc/Project/project.h13
-rw-r--r--project/Core/Inc/Project/song.h23
-rw-r--r--project/Core/Inc/Project/tone.h49
3 files changed, 85 insertions, 0 deletions
diff --git a/project/Core/Inc/Project/project.h b/project/Core/Inc/Project/project.h
new file mode 100644
index 0000000..bf37141
--- /dev/null
+++ b/project/Core/Inc/Project/project.h
@@ -0,0 +1,13 @@
+/*
+ * project.h
+ *
+ * Created on: Jan 8, 2023
+ * Author: bruce
+ */
+
+#ifndef INC_PROJECT_H_
+#define INC_PROJECT_H_
+
+void run_project ();
+
+#endif /* INC_PROJECT_H_ */
diff --git a/project/Core/Inc/Project/song.h b/project/Core/Inc/Project/song.h
new file mode 100644
index 0000000..3b99388
--- /dev/null
+++ b/project/Core/Inc/Project/song.h
@@ -0,0 +1,23 @@
+/*
+ * song.h
+ *
+ * Created on: May 14, 2022
+ * Author: Bruce Herring
+ *
+ * DO NOT MODIFY
+ */
+
+#ifndef INC_SONG_H_
+#define INC_SONG_H_
+
+#include <stdint.h>
+
+// A little struct to help make tracking songs easier.
+typedef struct {
+ unsigned char* p_song;
+ unsigned int size;
+}song;
+
+song get_song (uint8_t);
+
+#endif /* INC_SONG_H_ */
diff --git a/project/Core/Inc/Project/tone.h b/project/Core/Inc/Project/tone.h
new file mode 100644
index 0000000..b30e252
--- /dev/null
+++ b/project/Core/Inc/Project/tone.h
@@ -0,0 +1,49 @@
+/*
+ * tone.h
+ *
+ * Created on: May 14, 2022
+ * Author: bruce
+ */
+
+#ifndef INC_TONE_H_
+#define INC_TONE_H_
+
+#include "dac.h"
+
+/**
+ * SysTick handler. Since tones are controlled by software, the SysTick timer
+ * must be used accurately manage the times.
+ */
+void SysTick_Handler();
+
+/**
+ * Accessor for the counter. Useful for knowing what the current "time" is
+ * in the system.
+ */
+uint32_t get_counter ();
+
+void reset_counter ();
+
+/**
+ * Utility function that converts a frequency into a Systick timer ticks.
+ */
+uint32_t hertz_to_systicks (float hertz);
+
+/**
+ * Adds a tone to be played.
+ */
+uint8_t add_tone (uint8_t note, uint8_t velocity);
+
+/**
+ * Removes a tone from the current group of tones that can be played.
+ */
+uint8_t remove_tone (uint8_t note);
+
+
+/**
+ * Starts playing any tones that have been added.
+ */
+void play_tones ();
+
+
+#endif /* INC_TONE_H_ */