aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_music.h
blob: ee027197c2e7fee56822b8dc6f63a167ae780829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Copyright 2016 Jack Humbert
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PROCESS_MUSIC_H
#define PROCESS_MUSIC_H

#include "quantum.h"

#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))

enum music_modes {
  MUSIC_MODE_CHROMATIC,
  MUSIC_MODE_GUITAR,
  MUSIC_MODE_VIOLIN,
  MUSIC_MODE_MAJOR,
  NUMBER_OF_MODES
};

bool process_music(uint16_t keycode, keyrecord_t *record);

bool is_music_on(void);
void music_toggle(void);
void music_on(void);
void music_off(void);

void music_on_user(void);
void music_scale_user(void);
void music_all_notes_off(void);
void music_mode_cycle(void);

void matrix_scan_music(void);

#ifndef SCALE
#define SCALE (int8_t []){ 0 + (12*0), 2 + (12*0), 4 + (12*0), 5 + (12*0), 7 + (12*0), 9 + (12*0), 11 + (12*0), \
                           0 + (12*1), 2 + (12*1), 4 + (12*1), 5 + (12*1), 7 + (12*1), 9 + (12*1), 11 + (12*1), \
                           0 + (12*2), 2 + (12*2), 4 + (12*2), 5 + (12*2), 7 + (12*2), 9 + (12*2), 11 + (12*2), \
                           0 + (12*3), 2 + (12*3), 4 + (12*3), 5 + (12*3), 7 + (12*3), 9 + (12*3), 11 + (12*3), \
                           0 + (12*4), 2 + (12*4), 4 + (12*4), 5 + (12*4), 7 + (12*4), 9 + (12*4), 11 + (12*4), }
#endif

#endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))

#endif
ass="gi">+ .caldata_offset = 0x7d1000, + .slot = 0, + .led_pin = -1, + }, + }, + + .has_enetsw = 1, + + .enetsw = { + .used_ports = { + [0] = { + .used = 1, + .phy_id = 1, + .name = "Port 4", + }, + [1] = { + .used = 1, + .phy_id = 2, + .name = "Port 3", + }, + [2] = { + .used = 1, + .phy_id = 3, + .name = "Port 2", + }, + [3] = { + .used = 1, + .phy_id = 4, + .name = "Port 1", + }, + }, + }, + + .leds = { + { + .name = "dsl-274xb:red:internet", + .gpio = 2, + .active_low = 1, + }, + { + .name = "dsl-274xb:green:dsl", + .gpio = 3, + .active_low = 1, + }, + { + .name = "dsl-274xb:green:power", + .gpio = 4, + .active_low = 1, + .default_trigger = "default-on", + }, + { + .name = "dsl-274xb:red:power", + .gpio = 8, + .active_low = 1, + }, + { + .name = "dsl-274xb:blue:wps", + .gpio = 9, + .active_low = 1, + }, + { + .name = "dsl-274xb:green:internet", + .gpio = 11, + .active_low = 1, + }, + }, + + .buttons = { + { + .desc = "wifi", + .gpio = 10, + .active_low = 1, + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + { + .desc = "reset", + .gpio = 23, + .active_low = 1, + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + { + .desc = "wps", + .gpio = 24, + .active_low = 1, + .code = KEY_WPS_BUTTON, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + }, +}; #endif /* @@ -2494,6 +2599,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, + &board_dsl_274xb_f1, #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw,