mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-28 13:19:41 +00:00
sound fine
This commit is contained in:
@ -14,6 +14,8 @@
|
||||
#define SOUND_TIMER TIM4
|
||||
#define SOUND_TIMER_RCC RCC_APB1ENR_TIM4EN
|
||||
|
||||
extern uint32_t bpm;
|
||||
|
||||
// Define the Note structure
|
||||
typedef struct {
|
||||
uint32_t frequency; // Frequency in Hz
|
||||
@ -158,7 +160,13 @@ void sound_init(void);
|
||||
void sound_set_bpm(uint32_t bpm);
|
||||
void sound_play_note(Note_t note, uint8_t channel);
|
||||
void sound_play_melody(Note_t* melody, uint32_t size, uint8_t channel, uint32_t repeat_count);
|
||||
void sound_play_melody(Note_t* melody, uint32_t size, uint8_t channel, uint32_t repeat_count);
|
||||
void sound_tick(void);
|
||||
|
||||
uint16_t get_array_size(Note_t *array);
|
||||
|
||||
Note_t sound_create_note(MusicalNote_t note, NoteDuration_t duration, uint8_t duty_cycle);
|
||||
#define CREATE_NOTE(note, dur, duty) \
|
||||
((Note_t){ .frequency = note, .duration = dur, .duty_cycle = duty })
|
||||
|
||||
#endif /* INC_SOUND_H_ */
|
||||
|
Reference in New Issue
Block a user