music.h (1173B)
1 /* 2 * avr pomodoro timer 3 * © 2022 Anton Konyahin <me@konyahin.xyz> 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <https://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef MUSIC_H_ 20 #define MUSIC_H_ 21 22 #define SOUND PB0 23 24 #define TONE_A 42 25 #define TONE_AS 39 26 #define TONE_B 37 27 #define TONE_C 71 28 #define TONE_CS 67 29 #define TONE_D 63 30 #define TONE_DS 59 31 #define TONE_E 56 32 #define TONE_F 53 33 #define TONE_FS 50 34 #define TONE_G 47 35 #define TONE_GS 44 36 37 #define DELAY 250 38 39 typedef struct melody_s { 40 uint8_t length; 41 uint8_t tones[]; 42 } melody_t; 43 44 void 45 init_music(void); 46 47 void 48 play_melody(const melody_t *melody); 49 50 51 #endif