-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
198 lines (149 loc) · 5.61 KB
/
config.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/**
* aggregat controller 02: MIDI based servo controller
* Copyright (C) 2020 Institute for Computer Music and Sound Technology
* (ICST), ZHdK Zurich, <https://www.zhdk.ch/forschung/icst>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "mbed.h"
/************ DEBUG / TESTING ************/
#define IOCONTROL_TEST_MODE 1
/************ FEATURES ************/
// MIDI channel (0-15) selection through 4 active high switches
#define USE_CHANNEL_SELECT 1
#if USE_CHANNEL_SELECT
#define CHANNEL_SELECT_PIN_1 PF_10 // LSB
#define CHANNEL_SELECT_PIN_2 PC_2
#define CHANNEL_SELECT_PIN_3 PB_1
#define CHANNEL_SELECT_PIN_4 PC_3 // MSB
#endif
// default value (iff USE_CHANNEL_SELECT == 0)
#define CHANNEL_SELECT_DEFAULT 0
// device id (0-15) selection (usb device name + hostname)
#define USE_DEVICE_ID_SELECT 1
#if USE_DEVICE_ID_SELECT
#define DEVICE_ID_SELECT_PIN_1 PF_1 // LSB
#define DEVICE_ID_SELECT_PIN_2 PF_2
#define DEVICE_ID_SELECT_PIN_3 PG_2
#define DEVICE_ID_SELECT_PIN_4 PG_3 // MSB
#endif
// default value (iff USE_DEVICE_ID_SELECT == 0)
#define DEVICE_ID_SELECT_DEFAULT 0
#define USE_FORWARDING_CONTROLS 1
#if USE_FORWARDING_CONTROLS
#define USB_TO_MIDI_PIN PF_0
#define USB_TO_NET_PIN PD_0
#define MIDI_TO_USB_PIN PD_1
#define MIDI_TO_NET_PIN PG_0
#define NET_TO_USB_PIN PD_7
#define NET_TO_MIDI_PIN PD_6
#endif //USE_FORWARDING_CONTROLS
#define USB_TO_MIDI_DEFAULT true
#define USB_TO_NET_DEFAULT true
#define MIDI_TO_USB_DEFAULT true
#define MIDI_TO_NET_DEFAULT true
#define NET_TO_MIDI_DEFAULT true
#define NET_TO_USB_DEFAULT true
// not used at this time
#define USE_CFG 1
#if USE_CFG
#define CFG_RSRV_1_PIN PD_5
#define CFG_RSRV_2_PIN PD_4
#endif //USE_CFG
#define USE_BUTTONS 1
#if USE_BUTTONS
#define BTN_CENTER_PIN PE_2
#define BTN_PLUS_1_PIN PE_4
#define BTN_PLUS_2_PIN PE_5
#endif //USE_BUTTONS
#define USE_STATUS_LEDS 1
#if USE_STATUS_LEDS
#define LED_PWR_PIN PC_0
#define LED_MTR_PIN PA_3
#define LED_USB_1_PIN PE_6
#define LED_USB_2_PIN PE_3
#define LED_MIDI_1_PIN PF_8
#define LED_MIDI_2_PIN PF_7
#define LED_NET_1_PIN PF_9
#define LED_NET_2_PIN PG_1
#endif //USE_STATUS_LEDS
// base offset of CC controls (if chosen badly can cause interference with standard CCs)
#define CC_CONTROLLER_OFFSET 102
// turn on/off remote core controls
#define USE_CONTROLLER_LOGIC 1
// allow system resets with MIDI reset
#define USE_SYSTEM_RESET 1
#define USE_PITCHBEND_CONTROL 1
#define USE_NRPN_CONTROL 1
/************ MOTORS ************/
#define MOTOR_REFRESH_RATE_HZ 50
#define MOTOR_PULSEWIDTH_MIN_USEC 760
#define MOTOR_PULSEWIDTH_MAX_USEC 2240
#define MOTOR_PWR_AT_STARTUP 1
#define MOTOR_COUNT 16
// PWM out pins
#define MOTOR_1_PWM_PIN PC_8
#define MOTOR_2_PWM_PIN PC_9
#define MOTOR_3_PWM_PIN PA_6
#define MOTOR_4_PWM_PIN PB_5
#define MOTOR_5_PWM_PIN PB_3
#define MOTOR_6_PWM_PIN PD_14
#define MOTOR_7_PWM_PIN PD_15
#define MOTOR_8_PWM_PIN PE_9
#define MOTOR_9_PWM_PIN PE_11
#define MOTOR_10_PWM_PIN PE_14
#define MOTOR_11_PWM_PIN PE_13
#define MOTOR_12_PWM_PIN PB_6
#define MOTOR_13_PWM_PIN PB_7
#define MOTOR_14_PWM_PIN PA_0
#define MOTOR_15_PWM_PIN PB_10
#define MOTOR_16_PWM_PIN PB_11
// GPIO power on
#define MOTOR_1_PWR_PIN PC_6
#define MOTOR_2_PWR_PIN PC_6
#define MOTOR_3_PWR_PIN PA_15
#define MOTOR_4_PWR_PIN PA_15
#define MOTOR_5_PWR_PIN PC_7
#define MOTOR_6_PWR_PIN PC_7
#define MOTOR_7_PWR_PIN PB_4
#define MOTOR_8_PWR_PIN PB_4
#define MOTOR_9_PWR_PIN PF_5
#define MOTOR_10_PWR_PIN PF_5
#define MOTOR_11_PWR_PIN PB_2
#define MOTOR_12_PWR_PIN PB_2
#define MOTOR_13_PWR_PIN PD_11
#define MOTOR_14_PWR_PIN PD_11
#define MOTOR_15_PWR_PIN PE_0
#define MOTOR_16_PWR_PIN PE_0
/************ USBMIDI ************/
#define USE_USBMIDI 1
#define USB_POWER_PIN PA_9
// #define USB_CONNECTED_LED PA_3 //A3 //LED1
/************ MIDI ************/
#define USE_MIDI 1
#define MIDI_TX_PIN PC_12// PC_10 //PC_12 //PD_5
#define MIDI_RX_PIN PD_2 //PC_11 //PD_2 //PD_6
#define MIDI_BAUD 31250
#define MIDI_BITS 8
#define MIDI_PARITY BufferedSerial::None
#define MIDI_STOP 1
/************ NETWORK BASED MIDI ************/
#define USE_NETMIDI 1
// #define NET_STATUS_LED LED2
#define NET_HOSTNAME_FMT ".%d.Aggregat.local"
// #define NET_SERVICENAME_FMT ".%d.Aggregat???.local"
// required records: A or AAAA
#define MDNS_RR_COUNT 1
// #define