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

philip's avatar
philip committed
3
4
5
6
/************ DEBUG / TESTING ************/

#define IOCONTROL_TEST_MODE 1

philip's avatar
philip committed
7
8
/************ FEATURES ************/

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

#if USE_CHANNEL_SELECT
philip's avatar
philip committed
13
14
15
16
#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
philip's avatar
philip committed
17
#endif
philip's avatar
philip committed
18

philip's avatar
philip committed
19
20
// default value (iff USE_CHANNEL_SELECT == 0)
#define CHANNEL_SELECT_DEFAULT  0
philip's avatar
philip committed
21
22


philip's avatar
..    
philip committed
23
// device id (0-15) selection (usb device name + hostname)
philip's avatar
philip committed
24
#define USE_DEVICE_ID_SELECT           1
philip's avatar
philip committed
25
26
27
28
29
30
31

#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
32
33

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

philip's avatar
philip committed
36
#define USE_FORWARDING_CONTROLS      1
philip's avatar
philip committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

#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
55
#define USE_CFG 1
philip's avatar
philip committed
56
57
58
59
60
61

#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
62
#define USE_BUTTONS 1
philip's avatar
philip committed
63
64
65
66
67
68
69
70
71
72
73
74

#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
75
76
#define LED_USB_1_PIN       PE_6
#define LED_USB_2_PIN       PE_3
philip's avatar
philip committed
77
78
79
80
81
#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
82
83
84
85
86
87

// 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
88
#define USE_CONTROLLER_LOGIC         1
philip's avatar
philip committed
89
90

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

philip's avatar
..    
philip committed
93
94
#define USE_PITCHBEND_CONTROL        1
#define USE_NRPN_CONTROL             1
philip's avatar
philip committed
95

philip's avatar
philip committed
96
97
/************ MOTORS ************/

philip's avatar
philip committed
98
#define MOTOR_REFRESH_RATE_HZ       50
99

philip's avatar
philip committed
100
101
#define MOTOR_PULSEWIDTH_MIN_USEC   760
#define MOTOR_PULSEWIDTH_MAX_USEC   2240
102

philip's avatar
..    
philip committed
103
104
#define MOTOR_PWR_AT_STARTUP 1

philip's avatar
philip committed
105
#define MOTOR_COUNT         16
philip's avatar
..    
philip committed
106
107
108
109
110
111
112
113
114
115


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


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

philip's avatar
..    
philip committed
147
#define USE_USBMIDI         1
philip's avatar
philip committed
148

philip's avatar
..    
philip committed
149
#define USB_POWER_PIN       PA_9
philip's avatar
philip committed
150
// #define USB_CONNECTED_LED   PA_3 //A3 //LED1
philip's avatar
philip committed
151

philip's avatar
philip committed
152
153
/************ MIDI ************/

philip's avatar
philip committed
154
#define USE_MIDI    1
philip's avatar
philip committed
155

philip's avatar
philip committed
156
157
#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
158

159
#define MIDI_BAUD   31250
philip's avatar
philip committed
160
161
162
163

#define MIDI_BITS   8
#define MIDI_PARITY BufferedSerial::None
#define MIDI_STOP   1
philip's avatar
philip committed
164
165
166

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

philip's avatar
..    
philip committed
167
#define USE_NETMIDI             1
philip's avatar
philip committed
168

philip's avatar
philip committed
169
// #define NET_STATUS_LED          LED2
philip's avatar
philip committed
170

philip's avatar
..    
philip committed
171
172
#define NET_HOSTNAME_FMT        ".%d.Aggregat.local"
// #define NET_SERVICENAME_FMT     ".%d.Aggregat???.local"
philip's avatar
philip committed
173

philip's avatar
philip committed
174
// required records: A or AAAA
philip's avatar
..    
philip committed
175
#define MDNS_RR_COUNT           1
philip's avatar
philip committed
176

philip's avatar
philip committed
177
178

// #define