audio.h 509 B

1234567891011121314151617181920212223
  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include <avr/io.h>
  4. #include <util/delay.h>
  5. typedef union {
  6. uint8_t raw;
  7. struct {
  8. bool enable :1;
  9. uint8_t level :7;
  10. };
  11. } audio_config_t;
  12. void audio_toggle(void);
  13. void audio_on(void);
  14. void audio_off(void);
  15. void play_sample(uint8_t * s, uint16_t l, bool r);
  16. void play_note(double freq, int vol);
  17. void stop_note(double freq);
  18. void stop_all_notes();
  19. void init_notes();
  20. void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat);