config.h 4.6 KB
Newer Older
philip's avatar
philip committed
1
2
3
4
#include "mbed.h"

/************ FEATURES ************/

philip's avatar
..    
philip committed
5
// MIDI channel (0-15) selection through 4 active high switches
philip's avatar
philip committed
6
#define USE_CHANNEL_SELECT      1
philip's avatar
philip committed
7
8
9
10
11
12
13

#if USE_CHANNEL_SELECT
#define CHANNEL_SELECT_PIN_1    PC_3   // LSB
#define CHANNEL_SELECT_PIN_2    PB_1
#define CHANNEL_SELECT_PIN_3    PC_2
#define CHANNEL_SELECT_PIN_4    PF_10    // MSB
#endif
philip's avatar
philip committed
14

philip's avatar
philip committed
15
16
// default value (iff USE_CHANNEL_SELECT == 0)
#define CHANNEL_SELECT_DEFAULT  0
philip's avatar
philip committed
17
18


philip's avatar
..    
philip committed
19
// device id (0-15) selection (usb device name + hostname)
philip's avatar
philip committed
20
#define USE_DEVICE_ID_SELECT           1
philip's avatar
philip committed
21
22
23
24
25
26
27

#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
philip's avatar
philip committed
28
29

// default value (iff USE_DEVICE_ID_SELECT == 0)
philip's avatar
..    
philip committed
30
#define DEVICE_ID_SELECT_DEFAULT       0
philip's avatar
philip committed
31

philip's avatar
philip committed
32
#define USE_FORWARDING_CONTROLS      1
philip's avatar
philip committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#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
philip's avatar
philip committed
51
#define USE_CFG 1
philip's avatar
philip committed
52
53
54
55
56
57

#if USE_CFG
#define CFG_RSRV_1_PIN                  PD_5
#define CFG_RSRV_2_PIN                  PD_4
#endif //USE_CFG

philip's avatar
philip committed
58
#define USE_BUTTONS 1
philip's avatar
philip committed
59
60
61
62
63
64
65
66
67
68
69
70

#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
philip's avatar
philip committed
71
72
#define LED_USB_1_PIN       PE_6
#define LED_USB_2_PIN       PE_3
philip's avatar
philip committed
73
74
75
76
77
#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
philip's avatar
philip committed
78
79
80
81
82
83

// 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 
philip's avatar
..    
philip committed
84
#define USE_CONTROLLER_LOGIC         1
philip's avatar
philip committed
85
86

// allow system resets with MIDI reset
philip's avatar
..    
philip committed
87
#define USE_SYSTEM_RESET             1
philip's avatar
philip committed
88

philip's avatar
..    
philip committed
89
90
#define USE_PITCHBEND_CONTROL        1
#define USE_NRPN_CONTROL             1
philip's avatar
philip committed
91

philip's avatar
philip committed
92
93
/************ MOTORS ************/

philip's avatar
philip committed
94
#define MOTOR_REFRESH_RATE_HZ       50
95

philip's avatar
philip committed
96
97
#define MOTOR_PULSEWIDTH_MIN_USEC   760
#define MOTOR_PULSEWIDTH_MAX_USEC   2240
98

philip's avatar
..    
philip committed
99
100
#define MOTOR_PWR_AT_STARTUP 1

philip's avatar
philip committed
101
#define MOTOR_COUNT         16
philip's avatar
..    
philip committed
102
103
104
105
106
107
108
109
110
111


// 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
philip's avatar
philip committed
112
#define MOTOR_8_PWM_PIN         PE_9
philip's avatar
..    
philip committed
113
114
115
116
117
118
119
120
121
122
123
124
#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
philip's avatar
philip committed
125
126
127
128
#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
philip's avatar
..    
philip committed
129
130
131
132
#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
philip's avatar
philip committed
133
134
135
136
#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
philip's avatar
..    
philip committed
137
138
#define MOTOR_15_PWR_PIN        PE_0
#define MOTOR_16_PWR_PIN        PE_0
philip's avatar
philip committed
139
140
141
142


/************ USBMIDI ************/

philip's avatar
..    
philip committed
143
#define USE_USBMIDI         1
philip's avatar
philip committed
144

philip's avatar
..    
philip committed
145
#define USB_POWER_PIN       PA_9
philip's avatar
philip committed
146
// #define USB_CONNECTED_LED   PA_3 //A3 //LED1
philip's avatar
philip committed
147

philip's avatar
philip committed
148
149
/************ MIDI ************/

philip's avatar
philip committed
150
#define USE_MIDI    1
philip's avatar
philip committed
151

philip's avatar
philip committed
152
153
#define MIDI_TX_PIN PC_12// PC_10 //PC_12 //PD_5
#define MIDI_RX_PIN PD_2 //PC_11 //PD_2 //PD_6
philip's avatar
philip committed
154

155
#define MIDI_BAUD   31250
philip's avatar
philip committed
156
157
158
159

#define MIDI_BITS   8
#define MIDI_PARITY BufferedSerial::None
#define MIDI_STOP   1
philip's avatar
philip committed
160
161
162

/************ NETWORK BASED MIDI ************/

philip's avatar
..    
philip committed
163
#define USE_NETMIDI             1
philip's avatar
philip committed
164

philip's avatar
philip committed
165
// #define NET_STATUS_LED          LED2
philip's avatar
philip committed
166

philip's avatar
..    
philip committed
167
168
#define NET_HOSTNAME_FMT        ".%d.Aggregat.local"
// #define NET_SERVICENAME_FMT     ".%d.Aggregat???.local"
philip's avatar
philip committed
169

philip's avatar
philip committed
170
// required records: A or AAAA
philip's avatar
..    
philip committed
171
#define MDNS_RR_COUNT           1
philip's avatar
philip committed
172

philip's avatar
philip committed
173
174

// #define