Subversion Repositories svn.mios32

Rev

Rev 2301 | Rev 2322 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
492 tk 1
// $Id: seq_hwcfg.h 2308 2016-02-14 19:30:07Z tk $
2
/*
3
 * Header file for HW configuration routines
4
 *
5
 * ==========================================================================
6
 *
7
 *  Copyright (C) 2008 Thorsten Klose (tk@midibox.org)
8
 *  Licensed for personal non-commercial use only.
9
 *  All other rights reserved.
10
 *
11
 * ==========================================================================
12
 */
13
 
14
#ifndef _SEQ_HWCFG_H
15
#define _SEQ_HWCFG_H
16
 
17
/////////////////////////////////////////////////////////////////////////////
18
// Global definitions
19
/////////////////////////////////////////////////////////////////////////////
20
 
21
// changing these constants requires changes in seq_hwcfg.c, seq_file_hw.c and probably seq_ui.c
22
 
1341 tk 23
#define SEQ_HWCFG_NUM_ENCODERS     18
492 tk 24
 
1146 tk 25
#define SEQ_HWCFG_NUM_GP           16
26
#define SEQ_HWCFG_NUM_TRACK         4
27
#define SEQ_HWCFG_NUM_GROUP         4
28
#define SEQ_HWCFG_NUM_DIRECT_TRACK 16
29
#define SEQ_HWCFG_NUM_PAR_LAYER     3
30
#define SEQ_HWCFG_NUM_TRG_LAYER     3
1205 tk 31
#define SEQ_HWCFG_NUM_DIRECT_BOOKMARK 16
492 tk 32
 
507 tk 33
// following constants can be safely changed (therefore documented)
492 tk 34
 
2088 tk 35
// max. number of SRs which can be used for CV gates (each SR provides 8 gates)
36
#define SEQ_HWCFG_NUM_SR_CV_GATES 1
37
 
507 tk 38
// max. number of SRs which can be used for triggering gates (each SR provides 8 gates)
39
#define SEQ_HWCFG_NUM_SR_DOUT_GATES 8
40
 
41
 
492 tk 42
/////////////////////////////////////////////////////////////////////////////
43
// Global Types
44
/////////////////////////////////////////////////////////////////////////////
45
 
46
typedef struct {
47
  u8 down;
48
  u8 up;
49
  u8 left;
50
  u8 right;
51
 
52
  u8 scrub;
53
  u8 metronome;
630 tk 54
  u8 record;
1219 tk 55
  u8 live;
492 tk 56
 
57
  u8 stop;
58
  u8 pause;
59
  u8 play;
60
  u8 rew;
61
  u8 fwd;
596 tk 62
  u8 loop;
951 tk 63
  u8 follow;
492 tk 64
 
65
  u8 menu;
66
  u8 select;
67
  u8 exit;
1203 tk 68
  u8 bookmark;
492 tk 69
 
70
  u8 track[SEQ_HWCFG_NUM_TRACK];
71
 
1146 tk 72
  u8 direct_track[SEQ_HWCFG_NUM_DIRECT_TRACK];
73
 
492 tk 74
  u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
75
 
1205 tk 76
  u8 direct_bookmark[SEQ_HWCFG_NUM_DIRECT_BOOKMARK];
77
 
492 tk 78
  u8 edit;
79
  u8 mute;
80
  u8 pattern;
81
  u8 song;
82
 
83
  u8 solo;
84
  u8 fast;
1121 tk 85
  u8 fast2;
492 tk 86
  u8 all;
87
 
88
  u8 gp[SEQ_HWCFG_NUM_GP];
89
 
90
  u8 group[SEQ_HWCFG_NUM_GROUP];
91
 
92
  u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
93
 
513 tk 94
  u8 utility;
492 tk 95
  u8 step_view;
513 tk 96
  u8 trg_layer_sel;
97
  u8 par_layer_sel;
98
  u8 track_sel;
492 tk 99
 
100
  u8 tap_tempo;
513 tk 101
  u8 tempo_preset;
524 tk 102
  u8 ext_restart;
492 tk 103
 
104
  u8 copy;
105
  u8 paste;
106
  u8 clear;
1014 tk 107
  u8 undo;
2308 tk 108
  u8 move;
109
  u8 scroll;
544 tk 110
 
111
  u8 mixer;
1119 tk 112
 
1787 tk 113
  u8 save;
114
  u8 save_all;
115
 
1119 tk 116
  u8 track_mode;
117
  u8 track_groove;
118
  u8 track_length;
119
  u8 track_direction;
120
  u8 track_morph;
121
  u8 track_transpose;
2294 tk 122
  u8 fx;
1349 tk 123
 
1811 tk 124
  u8 mute_all_tracks;
125
  u8 mute_track_layers;
126
  u8 mute_all_tracks_and_layers;
127
  u8 unmute_all_tracks;
128
  u8 unmute_track_layers;
129
  u8 unmute_all_tracks_and_layers;
130
 
1349 tk 131
  u8 footswitch;
1454 midilab 132
  u8 pattern_remix;
492 tk 133
} seq_hwcfg_button_t;
134
 
524 tk 135
 
136
typedef struct {
1203 tk 137
  u32 fast:1;
138
  u32 fast2:1;
139
  u32 all:1;
140
  u32 all_with_triggers:1;
141
  u32 solo:1;
142
  u32 metronome:1;
143
  u32 loop:1;
144
  u32 follow:1;
145
  u32 scrub:1;
146
  u32 menu:1;
147
  u32 bookmark:1;
148
  u32 step_view:1;
149
  u32 trg_layer:1;
150
  u32 par_layer:1;
151
  u32 track_sel:1;
152
  u32 tempo_preset:1;
513 tk 153
} seq_hwcfg_button_beh_t;
492 tk 154
 
513 tk 155
 
492 tk 156
typedef struct {
514 tk 157
  u8 gp_dout_l_sr;
158
  u8 gp_dout_r_sr;
159
  u8 gp_dout_l2_sr;
160
  u8 gp_dout_r2_sr;
1146 tk 161
  u8 tracks_dout_l_sr;
162
  u8 tracks_dout_r_sr;
496 tk 163
 
492 tk 164
  u8 track[SEQ_HWCFG_NUM_TRACK];
165
 
166
  u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
167
 
168
  u8 beat;
2301 tk 169
  u8 measure;
492 tk 170
 
1336 tk 171
  u8 midi_in_combined;
172
  u8 midi_out_combined;
173
 
492 tk 174
  u8 edit;
175
  u8 mute;
176
  u8 pattern;
177
  u8 song;
178
 
179
  u8 solo;
180
  u8 fast;
1121 tk 181
  u8 fast2;
492 tk 182
  u8 all;
183
 
184
  u8 group[SEQ_HWCFG_NUM_GROUP];
185
 
186
  u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
187
 
188
  u8 play;
189
  u8 stop;
190
  u8 pause;
191
  u8 rew;
192
  u8 fwd;
596 tk 193
  u8 loop;
951 tk 194
  u8 follow;
492 tk 195
 
591 tk 196
  u8 exit;
197
  u8 select;
492 tk 198
  u8 menu;
1203 tk 199
  u8 bookmark;
492 tk 200
  u8 scrub;
201
  u8 metronome;
202
 
203
  u8 utility;
204
  u8 copy;
205
  u8 paste;
206
  u8 clear;
1014 tk 207
  u8 undo;
2308 tk 208
  u8 move;
209
  u8 scroll;
492 tk 210
 
630 tk 211
  u8 record;
1219 tk 212
  u8 live;
630 tk 213
 
492 tk 214
  u8 step_view;
513 tk 215
  u8 trg_layer_sel;
216
  u8 par_layer_sel;
217
  u8 track_sel;
492 tk 218
 
513 tk 219
  u8 tap_tempo;
220
  u8 tempo_preset;
524 tk 221
  u8 ext_restart;
513 tk 222
 
492 tk 223
  u8 down;
224
  u8 up;
743 tk 225
 
226
  u8 mixer;
1119 tk 227
 
228
  u8 track_mode;
229
  u8 track_groove;
230
  u8 track_length;
231
  u8 track_direction;
232
  u8 track_transpose;
233
  u8 track_morph;
2294 tk 234
  u8 fx;
1811 tk 235
 
236
  u8 mute_all_tracks;
237
  u8 mute_track_layers;
238
  u8 mute_all_tracks_and_layers;
239
  u8 unmute_all_tracks;
240
  u8 unmute_track_layers;
241
  u8 unmute_all_tracks_and_layers;
492 tk 242
} seq_hwcfg_led_t;
243
 
244
 
1070 tk 245
typedef struct {
513 tk 246
  u8 datawheel_fast_speed;
1341 tk 247
  u8 bpm_fast_speed;
513 tk 248
  u8 gp_fast_speed;
249
  u8 auto_fast;
250
} seq_hwcfg_enc_t;
251
 
252
 
496 tk 253
typedef struct {
1675 tk 254
  u8 enabled:1;
255
  u8 dout_duocolour:2;
256
  u8 buttons_enabled:1;
257
  u8 buttons_no_ui:1;
258
  u8 gp_always_select_menu_page:1;
514 tk 259
} seq_hwcfg_blm_t;
496 tk 260
 
261
 
514 tk 262
typedef struct {
1675 tk 263
  u8 enabled:1;
264
  u8 dout_gp_mapping:1;
265
  u8 din_gp_mapping:1;
514 tk 266
} seq_hwcfg_blm8x8_t;
496 tk 267
 
784 tk 268
typedef struct {
1336 tk 269
  u8 enabled;
270
  u8 segments_sr;
271
  u8 common1_pin;
272
  u8 common2_pin;
273
  u8 common3_pin;
1341 tk 274
  u8 common4_pin;
1336 tk 275
} seq_hwcfg_bpm_digits_t;
276
 
277
typedef struct {
1341 tk 278
  u8 enabled;
279
  u8 segments_sr;
280
  u8 common1_pin;
281
  u8 common2_pin;
282
  u8 common3_pin;
283
} seq_hwcfg_step_digits_t;
284
 
285
typedef struct {
1345 tk 286
  u8 enabled;
1864 tk 287
  u8 columns_sr[2];
288
  u8 rows_sr_green[2];
289
  u8 rows_sr_red[2];
1345 tk 290
} seq_hwcfg_tpd_t;
291
 
292
typedef struct {
741 tk 293
  u8 key;
294
  u8 cc;
295
} seq_hwcfg_midi_remote_t;
514 tk 296
 
1713 tk 297
typedef struct {
298
  u8 mode;
299
  mios32_midi_port_t port;
300
  u8 chn;
301
  u8 cc;
302
} seq_hwcfg_track_cc_t;
741 tk 303
 
1713 tk 304
 
492 tk 305
/////////////////////////////////////////////////////////////////////////////
306
// Prototypes
307
/////////////////////////////////////////////////////////////////////////////
308
 
309
extern s32 SEQ_HWCFG_Init(u32 mode);
310
 
311
/////////////////////////////////////////////////////////////////////////////
312
// Export global variables
313
/////////////////////////////////////////////////////////////////////////////
314
 
315
extern seq_hwcfg_button_t seq_hwcfg_button;
513 tk 316
extern seq_hwcfg_button_beh_t seq_hwcfg_button_beh;
492 tk 317
extern seq_hwcfg_led_t seq_hwcfg_led;
514 tk 318
extern seq_hwcfg_blm_t seq_hwcfg_blm;
319
extern seq_hwcfg_blm8x8_t seq_hwcfg_blm8x8;
513 tk 320
extern seq_hwcfg_enc_t seq_hwcfg_enc;
1336 tk 321
extern seq_hwcfg_bpm_digits_t seq_hwcfg_bpm_digits;
1341 tk 322
extern seq_hwcfg_step_digits_t seq_hwcfg_step_digits;
1345 tk 323
extern seq_hwcfg_tpd_t seq_hwcfg_tpd;
741 tk 324
extern seq_hwcfg_midi_remote_t seq_hwcfg_midi_remote;
1713 tk 325
extern seq_hwcfg_track_cc_t seq_hwcfg_track_cc;
492 tk 326
 
507 tk 327
extern u8 seq_hwcfg_dout_gate_sr[SEQ_HWCFG_NUM_SR_DOUT_GATES];
328
extern u8 seq_hwcfg_dout_gate_1ms;
2088 tk 329
extern u8 seq_hwcfg_cv_gate_sr[SEQ_HWCFG_NUM_SR_CV_GATES];
330
extern u8 seq_hwcfg_clk_sr;
2268 tk 331
extern u8 seq_hwcfg_j5_enabled;
492 tk 332
 
333
#endif /* _SEQ_HWCFG_H */