ukkonooa and frequency slider
This commit is contained in:
6
main/headers/arraylen.h
Normal file
6
main/headers/arraylen.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef ARRAY_LEN_H_
|
||||
#define ARRAY_LEN_H_
|
||||
|
||||
#define ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#endif // ARRAY_LEN_H_
|
||||
14
main/headers/buzzer.h
Normal file
14
main/headers/buzzer.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef BUZZER_H_
|
||||
#define BUZZER_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void buzzer_init(const uint32_t frequency);
|
||||
uint32_t modify_frequency(int amount);
|
||||
uint32_t reset_frequency();
|
||||
void set_frequency(const uint32_t freq);
|
||||
void buzzer_pause();
|
||||
void buzzer_reset();
|
||||
void buzzer_resume();
|
||||
|
||||
#endif // BUZZER_H_
|
||||
6
main/headers/freq_slider.h
Normal file
6
main/headers/freq_slider.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef FREQ_SLIDER_H_
|
||||
#define FREQ_SLIDER_H_
|
||||
|
||||
void freq_slider_task(void* param);
|
||||
|
||||
#endif // FREQ_SLIDER_H_
|
||||
23
main/headers/un.h
Normal file
23
main/headers/un.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef UN_H_
|
||||
#define UN_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// https://mixbutton.com/music-tools/frequency-and-pitch/music-note-to-frequency-chart
|
||||
|
||||
// Octave 2
|
||||
// typedef enum { P = -1, C = 65, D = 73, E = 82, F = 87, G = 98 } NoteFreq;
|
||||
|
||||
// Octave 4
|
||||
typedef enum { P = -1, C = 262, D = 294, E = 330, F = 349, G = 392 } NoteFreq;
|
||||
|
||||
typedef struct {
|
||||
NoteFreq note;
|
||||
uint32_t length;
|
||||
} Note;
|
||||
|
||||
const char* NoteFreqToStr(NoteFreq note);
|
||||
void play_note(Note* note);
|
||||
void un_task(void* param);
|
||||
|
||||
#endif // UN_H_
|
||||
Reference in New Issue
Block a user