Subversion Repositories svn.mios32

Rev

Rev 2308 | Rev 2399 | 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 2322 2016-03-15 19:08:38Z 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;
2322 tk 55
  u8 jam_live;
56
  u8 jam_step;
1219 tk 57
  u8 live;
492 tk 58
 
59
  u8 stop;
60
  u8 pause;
61
  u8 play;
62
  u8 rew;
63
  u8 fwd;
596 tk 64
  u8 loop;
951 tk 65
  u8 follow;
492 tk 66
 
67
  u8 menu;
68
  u8 select;
69
  u8 exit;
1203 tk 70
  u8 bookmark;
492 tk 71
 
72
  u8 track[SEQ_HWCFG_NUM_TRACK];
73
 
1146 tk 74
  u8 direct_track[SEQ_HWCFG_NUM_DIRECT_TRACK];
75
 
492 tk 76
  u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
77
 
1205 tk 78
  u8 direct_bookmark[SEQ_HWCFG_NUM_DIRECT_BOOKMARK];
79
 
492 tk 80
  u8 edit;
81
  u8 mute;
82
  u8 pattern;
83
  u8 song;
84
 
85
  u8 solo;
86
  u8 fast;
1121 tk 87
  u8 fast2;
492 tk 88
  u8 all;
89
 
90
  u8 gp[SEQ_HWCFG_NUM_GP];
91
 
92
  u8 group[SEQ_HWCFG_NUM_GROUP];
93
 
94
  u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
95
 
513 tk 96
  u8 utility;
492 tk 97
  u8 step_view;
513 tk 98
  u8 trg_layer_sel;
99
  u8 par_layer_sel;
100
  u8 track_sel;
492 tk 101
 
102
  u8 tap_tempo;
513 tk 103
  u8 tempo_preset;
524 tk 104
  u8 ext_restart;
492 tk 105
 
106
  u8 copy;
107
  u8 paste;
108
  u8 clear;
1014 tk 109
  u8 undo;
2308 tk 110
  u8 move;
111
  u8 scroll;
544 tk 112
 
113
  u8 mixer;
1119 tk 114
 
1787 tk 115
  u8 save;
116
  u8 save_all;
117
 
1119 tk 118
  u8 track_mode;
119
  u8 track_groove;
120
  u8 track_length;
121
  u8 track_direction;
122
  u8 track_morph;
123
  u8 track_transpose;
2294 tk 124
  u8 fx;
1349 tk 125
 
1811 tk 126
  u8 mute_all_tracks;
127
  u8 mute_track_layers;
128
  u8 mute_all_tracks_and_layers;
129
  u8 unmute_all_tracks;
130
  u8 unmute_track_layers;
131
  u8 unmute_all_tracks_and_layers;
132
 
1349 tk 133
  u8 footswitch;
1454 midilab 134
  u8 pattern_remix;
492 tk 135
} seq_hwcfg_button_t;
136
 
524 tk 137
 
138
typedef struct {
1203 tk 139
  u32 fast:1;
140
  u32 fast2:1;
141
  u32 all:1;
142
  u32 all_with_triggers:1;
143
  u32 solo:1;
144
  u32 metronome:1;
145
  u32 loop:1;
146
  u32 follow:1;
147
  u32 scrub:1;
148
  u32 menu:1;
149
  u32 bookmark:1;
150
  u32 step_view:1;
151
  u32 trg_layer:1;
152
  u32 par_layer:1;
153
  u32 track_sel:1;
154
  u32 tempo_preset:1;
513 tk 155
} seq_hwcfg_button_beh_t;
492 tk 156
 
513 tk 157
 
492 tk 158
typedef struct {
514 tk 159
  u8 gp_dout_l_sr;
160
  u8 gp_dout_r_sr;
161
  u8 gp_dout_l2_sr;
162
  u8 gp_dout_r2_sr;
1146 tk 163
  u8 tracks_dout_l_sr;
164
  u8 tracks_dout_r_sr;
496 tk 165
 
492 tk 166
  u8 track[SEQ_HWCFG_NUM_TRACK];
167
 
168
  u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
169
 
170
  u8 beat;
2301 tk 171
  u8 measure;
492 tk 172
 
1336 tk 173
  u8 midi_in_combined;
174
  u8 midi_out_combined;
175
 
492 tk 176
  u8 edit;
177
  u8 mute;
178
  u8 pattern;
179
  u8 song;
180
 
181
  u8 solo;
182
  u8 fast;
1121 tk 183
  u8 fast2;
492 tk 184
  u8 all;
185
 
186
  u8 group[SEQ_HWCFG_NUM_GROUP];
187
 
188
  u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
189
 
190
  u8 play;
191
  u8 stop;
192
  u8 pause;
193
  u8 rew;
194
  u8 fwd;
596 tk 195
  u8 loop;
951 tk 196
  u8 follow;
492 tk 197
 
591 tk 198
  u8 exit;
199
  u8 select;
492 tk 200
  u8 menu;
1203 tk 201
  u8 bookmark;
492 tk 202
  u8 scrub;
203
  u8 metronome;
204
 
205
  u8 utility;
206
  u8 copy;
207
  u8 paste;
208
  u8 clear;
1014 tk 209
  u8 undo;
2308 tk 210
  u8 move;
211
  u8 scroll;
492 tk 212
 
630 tk 213
  u8 record;
1219 tk 214
  u8 live;
2322 tk 215
  u8 jam_live;
216
  u8 jam_step;
630 tk 217
 
492 tk 218
  u8 step_view;
513 tk 219
  u8 trg_layer_sel;
220
  u8 par_layer_sel;
221
  u8 track_sel;
492 tk 222
 
513 tk 223
  u8 tap_tempo;
224
  u8 tempo_preset;
524 tk 225
  u8 ext_restart;
513 tk 226
 
492 tk 227
  u8 down;
228
  u8 up;
743 tk 229
 
230
  u8 mixer;
1119 tk 231
 
232
  u8 track_mode;
233
  u8 track_groove;
234
  u8 track_length;
235
  u8 track_direction;
236
  u8 track_transpose;
237
  u8 track_morph;
2294 tk 238
  u8 fx;
1811 tk 239
 
240
  u8 mute_all_tracks;
241
  u8 mute_track_layers;
242
  u8 mute_all_tracks_and_layers;
243
  u8 unmute_all_tracks;
244
  u8 unmute_track_layers;
245
  u8 unmute_all_tracks_and_layers;
492 tk 246
} seq_hwcfg_led_t;
247
 
248
 
1070 tk 249
typedef struct {
513 tk 250
  u8 datawheel_fast_speed;
1341 tk 251
  u8 bpm_fast_speed;
513 tk 252
  u8 gp_fast_speed;
253
  u8 auto_fast;
254
} seq_hwcfg_enc_t;
255
 
256
 
496 tk 257
typedef struct {
1675 tk 258
  u8 enabled:1;
259
  u8 dout_duocolour:2;
260
  u8 buttons_enabled:1;
261
  u8 buttons_no_ui:1;
262
  u8 gp_always_select_menu_page:1;
514 tk 263
} seq_hwcfg_blm_t;
496 tk 264
 
265
 
514 tk 266
typedef struct {
1675 tk 267
  u8 enabled:1;
268
  u8 dout_gp_mapping:1;
269
  u8 din_gp_mapping:1;
514 tk 270
} seq_hwcfg_blm8x8_t;
496 tk 271
 
784 tk 272
typedef struct {
1336 tk 273
  u8 enabled;
274
  u8 segments_sr;
275
  u8 common1_pin;
276
  u8 common2_pin;
277
  u8 common3_pin;
1341 tk 278
  u8 common4_pin;
1336 tk 279
} seq_hwcfg_bpm_digits_t;
280
 
281
typedef struct {
1341 tk 282
  u8 enabled;
283
  u8 segments_sr;
284
  u8 common1_pin;
285
  u8 common2_pin;
286
  u8 common3_pin;
287
} seq_hwcfg_step_digits_t;
288
 
289
typedef struct {
1345 tk 290
  u8 enabled;
1864 tk 291
  u8 columns_sr[2];
292
  u8 rows_sr_green[2];
293
  u8 rows_sr_red[2];
1345 tk 294
} seq_hwcfg_tpd_t;
295
 
296
typedef struct {
741 tk 297
  u8 key;
298
  u8 cc;
299
} seq_hwcfg_midi_remote_t;
514 tk 300
 
1713 tk 301
typedef struct {
302
  u8 mode;
303
  mios32_midi_port_t port;
304
  u8 chn;
305
  u8 cc;
306
} seq_hwcfg_track_cc_t;
741 tk 307
 
1713 tk 308
 
492 tk 309
/////////////////////////////////////////////////////////////////////////////
310
// Prototypes
311
/////////////////////////////////////////////////////////////////////////////
312
 
313
extern s32 SEQ_HWCFG_Init(u32 mode);
314
 
315
/////////////////////////////////////////////////////////////////////////////
316
// Export global variables
317
/////////////////////////////////////////////////////////////////////////////
318
 
319
extern seq_hwcfg_button_t seq_hwcfg_button;
513 tk 320
extern seq_hwcfg_button_beh_t seq_hwcfg_button_beh;
492 tk 321
extern seq_hwcfg_led_t seq_hwcfg_led;
514 tk 322
extern seq_hwcfg_blm_t seq_hwcfg_blm;
323
extern seq_hwcfg_blm8x8_t seq_hwcfg_blm8x8;
513 tk 324
extern seq_hwcfg_enc_t seq_hwcfg_enc;
1336 tk 325
extern seq_hwcfg_bpm_digits_t seq_hwcfg_bpm_digits;
1341 tk 326
extern seq_hwcfg_step_digits_t seq_hwcfg_step_digits;
1345 tk 327
extern seq_hwcfg_tpd_t seq_hwcfg_tpd;
741 tk 328
extern seq_hwcfg_midi_remote_t seq_hwcfg_midi_remote;
1713 tk 329
extern seq_hwcfg_track_cc_t seq_hwcfg_track_cc;
492 tk 330
 
507 tk 331
extern u8 seq_hwcfg_dout_gate_sr[SEQ_HWCFG_NUM_SR_DOUT_GATES];
332
extern u8 seq_hwcfg_dout_gate_1ms;
2088 tk 333
extern u8 seq_hwcfg_cv_gate_sr[SEQ_HWCFG_NUM_SR_CV_GATES];
334
extern u8 seq_hwcfg_clk_sr;
2268 tk 335
extern u8 seq_hwcfg_j5_enabled;
492 tk 336
 
337
#endif /* _SEQ_HWCFG_H */