Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
73 tk 1
;$Id: setup_mbseq_v3.asm 285 2008-04-23 20:31:07Z tk $
194 tk 2
    LIST R=DEC
73 tk 3
;
4
; Default setup File for MIDIbox SEQ V3
5
;
6
; Detailed infos for customization can be found at http://www.ucapps.de/midibox_seq_options.html
7
;
8
; BankStick Mode & Allocation Map
9
; Each BankStick (CS0..CS7) has an own entry
10
; Set the value to:
11
;     0: ignore BankStick which could be (or is) connected to the CS address
12
;     1: if a 32k BankStick (24LC256) is connected and should be used as Pattern Storage (64 patterns)
13
;     2: if a 64k BankStick (24LC512) is connected and should be used as Pattern Storage (128 patterns)
14
;     3: if a 32k BankStick is connected and should be used as Song Storage (16 Songs)
15
;     4: if a 64k BankStick is connected and should be used as Song Storage (32 Songs)
16
;     5: if a 32k or 64k BankStick is connected and should be used as Mixer Map Storage
17
;        only the first 32k are used, so there is no advantage on using a 24LC512 here.
18
; NOTE: only one BankStick can be used as Song Storage, only one for Mixer Maps
19
;       If no entry with "mode 3" or "mode 4" is defined, Song mode will be disabled.
20
;       If no entry with "mode 5" is defined, there will only be one Mixer Map which cannot be stored
21
; If a BankStick is not connected to the MBSEQ, the appr. entry will have no effect
96 tk 22
#define DEFAULT_BANKSTICK_MODE_CS0  2   ; 64k
23
#define DEFAULT_BANKSTICK_MODE_CS1  2   ; 64k
73 tk 24
#define DEFAULT_BANKSTICK_MODE_CS2  5   ; Mixer Map (using CS2 to ensure compatibility with Atmel EEPROMs which only provide 4 CS addresses)
96 tk 25
#define DEFAULT_BANKSTICK_MODE_CS3  4   ; Song mode (using CS3 to ensure compatibility with Atmel EEPROMs which only provide 4 CS addresses)
26
#define DEFAULT_BANKSTICK_MODE_CS4  2   ; 64k
27
#define DEFAULT_BANKSTICK_MODE_CS5  2   ; 64k
28
#define DEFAULT_BANKSTICK_MODE_CS6  2   ; 64k
29
#define DEFAULT_BANKSTICK_MODE_CS7  2   ; 64k
73 tk 30
;
31
;
32
; Max. length of the DIN/DOUT shift register chain (1-16)
33
#define DEFAULT_NUMBER_SR   13
34
;
35
; debounce counter (see the function description of MIOS_SRIO_DebounceSet)
36
; Use 0 for high-quality buttons, use higher values for low-quality buttons
37
#define DEFAULT_SRIO_DEBOUNCE_CTR 32
38
;
39
; For MIDI activity monitor: define the DOUT pins for the Rx and Tx LED
40
#define DEFAULT_MIDI_MONITOR_ENABLED 1  ; if 1, the Tx/Rx LEDs are enabled
96 tk 41
;                                    SR            Pin#
42
#define DEFAULT_MIDI_RX_LED        (((2 - 1)<<3)+7- 0)  ; DOUT SR#2, pin D0
43
#define DEFAULT_MIDI_TX_LED        0xff         ; not used
44
;                                       ^^^^^^^^^^^ignore!
73 tk 45
;
46
; The beat indicator LED has to be assigned to a DOUT pin here:
96 tk 47
;                                    SR            Pin#
48
#define DEFAULT_BEAT_INDICATOR_LED (((1 - 1)<<3)+7- 0) ; DOUT SR#1, pin D0
49
;                                       ^^^^^^^^^^^ignore!
73 tk 50
;
51
; Some menus are provide the possibility to use 16 "general purpose" buttons
52
; Define the two shift registers which are assigned to this function here:
53
; (valid numbers: 1-16)
54
#define DEFAULT_GP_DIN_SR_L 7   ; first GP DIN shift register assigned to SR#7
55
#define DEFAULT_GP_DIN_SR_R 10  ; second GP DIN shift register assigned to SR#10
56
;
57
; above these buttons LEDs should be mounted to visualize the played MIDI events,
58
; but also the current sequencer position, the selected pattern, the menu, etc.
59
; Define the two shift registers which are assigned to this function here:  
60
; (valid numbers: 1-16)
61
#define DEFAULT_GP_DOUT_SR_L    3   ; first GP DOUT shift register assigned to SR#3
62
#define DEFAULT_GP_DOUT_SR_R    4   ; second GP DOUT shift register assigned to SR#4
63
;
64
;
65
; === Shift Register Matrix ===
66
;
67
; set this value to 1 if each track has its own set of 16 LEDs to display unmuted steps and current sequencer position
68
#define DEFAULT_SRM_ENABLED     0
69
;
70
; define the shift registers to which the anodes of these LEDs are connected
71
; Note: they can be equal to DEFAULT_GP_DOUT_SR_[LH], this saves two shift registers, but doesn't allow a seperate view of UI selections
72
#define DEFAULT_SRM_DOUT_L1 6
73
#define DEFAULT_SRM_DOUT_R1 9
74
;
75
; define the shift register to which the cathodes of these LEDs are connected
76
; Note that the whole shift register (8 pins) will be allocated! The 4 select lines are duplicated (4 for LED matrix, 4 for button matrix)
77
; The second DOUT_CATHODES2 selection is optional if LEDs with high power consumption are used - set this to 0 if not used
78
#define DEFAULT_SRM_DOUT_CATHODES1  5
79
#define DEFAULT_SRM_DOUT_CATHODES2  8
80
;
81
; set this to 1, if DUO colour LEDs are connected to the LED matrix
82
#define DEFAULT_SRM_DOUT_DUOCOLOUR  1
83
;
84
; define the shift registers to which the anodes of the "second colour" (red) LEDs are connected
85
#define DEFAULT_SRM_DOUT_L2 7
86
#define DEFAULT_SRM_DOUT_R2 10
87
;
88
; set this to 1 if a button matrix is connected
89
#define DEFAULT_SRM_BUTTONS_ENABLED 0
90
; set this to 1 if these buttons should only control the "step triggers" (gate, and other assigned triggers) - and no UI functions
91
#define DEFAULT_SRM_BUTTONS_NO_UI   1
92
; define the DIN shift registers to which the button matrix is connected
93
#define DEFAULT_SRM_DIN_L   11
94
#define DEFAULT_SRM_DIN_R   12
95
;
96
;
97
; === BPM digits ===
98
;
99
; set to 1 or 2 to enable the 3 optional BPM digits
100
;    0: BPM digits disabled
101
;    1: digits with common cathode
102
;    2: digits with common anode
103
#define DEFAULT_BPM_DIGITS_ENABLED 0
104
;
105
; define the shift register to which the segments are connected (0=disabled)
106
#define DEFAULT_BPM_DIGITS_SEGMENTS 5
107
; define the shift register to which the common pins (cathodes or anodes) are connected (0=disabled)
108
#define DEFAULT_BPM_DIGITS_COMMON   6
109
;
110
;
111
; Datawheel for menu navigation/data entry connected or not?
112
; A datawheel can replace the left/right buttons!
113
; if -1: datawheel not connected
114
; if 0: encoder #0 assigned to datawheel function
115
; values > 0 not allowed in the MIDIboxSEQ application
116
; don't forget to define the pins of the datawheel in MIOS_ENC_PIN_TABLE
117
; (-> mios_tables.inc or setup_*.asm, first entry)
118
#define DEFAULT_ENC_DATAWHEEL   0
119
;
120
; the speed value for the datawheel (#0) which is used when the "FAST" button is activated:
121
#define DEFAULT_DATAWHEEL_SPEED_VALUE   3
122
;
123
; the speed value for the additional encoders (#1-#16) which is used when the "FAST" button is activated:
124
#define DEFAULT_ENC_SPEED_VALUE     3
125
 
126
;; Auto FAST mode: if a layer is assigned to velocity or CC, the fast button will be automatically
127
;; enabled - in other cases (e.g. Note or Length), the fast button will be automatically disabled
128
#define DEFAULT_AUTO_FAST_BUTTON        1
129
 
130
;; Behaviour of FAST button:
131
;; 0: button pressed: fast encoders, button depressed: slow encoders
132
;; 1: fast mode toggled when button pressed
133
#define DEFAULT_BEHAVIOUR_BUTTON_FAST   1
134
;; The same for the "ALL" button (if flag set, all step parameters will be changed with a single encoder)
135
#define DEFAULT_BEHAVIOUR_BUTTON_ALL    1
136
;; the same for the solo button (if flag set, the current selected track will be played solo)
137
#define DEFAULT_BEHAVIOUR_BUTTON_SOLO   1
138
;; the same for the metronome button
139
#define DEFAULT_BEHAVIOUR_BUTTON_METRON 1
140
;; the same for the scrub button
141
#define DEFAULT_BEHAVIOUR_BUTTON_SCRUB  0
142
 
143
; MIDI IN Channel which is used for the transpose/arpeggiator/remote function
144
; Allowed values: 1-16, select 0 to disable
145
#define DEFAULT_SEQUENCER_CHANNEL   1
146
;
147
; The Note number which activates the remote function (examples: 0x24 == C-2, 0x60 == C-7)
148
#define DEFAULT_MIDI_REMOTE_KEY     0x60    ; C-7
149
;
150
; Optional channels for configuration via CC (1-16, select 0 to disable)
151
#define DEFAULT_MIDI_CHANNEL_LAYER_A    0
152
#define DEFAULT_MIDI_CHANNEL_LAYER_B    0
153
#define DEFAULT_MIDI_CHANNEL_LAYER_C    0
154
#define DEFAULT_MIDI_CHANNEL_CFG    0
155
 
156
;; if enabled (1), patterns can be changed via CC#112-CC#115
157
;; if disabled (0), these CCs are ignored
158
#define DEFAULT_MIDI_PATTERN_CHANGE_CC  1
159
 
160
;; if enabled (1), song can be changed via program change
161
;; if disabled (0), program changes are ignored
162
#define DEFAULT_MIDI_SONG_CHANGE_VIA_PC 1
163
 
164
 
165
;; define the pin which should be used as external 24ppqn clock output here
166
;; DEFAULT_EXT_CLK_LAT can be LATC (Pin 0, 1, 2, 4, 5) or LATD (Pin 4)
167
;; Note that this should be an exclusive pin. E.g., if an AOUT module is
168
;; be connected, LATC.5 and LATD.4 are already allocated.
169
;; if a second LCD is connected, LATC.4 is already allocated
170
;; The external pin is disabled with DEFAULT_EXT_CLK_LAT == 0
171
;; default setting: RC0 (available at J6:RC of the core module)
172
#define DEFAULT_EXT_CLK_LAT LATC
173
#define DEFAULT_EXT_CLK_PIN 0
174
 
175
;; define the pin which should be used as external Start/Stop output here
176
;; default setting: RC1 (available at J6:SC of the core module)
177
#define DEFAULT_EXT_START_LAT   LATC
178
#define DEFAULT_EXT_START_PIN   1
179
 
180
 
181
;; define the pin to which the RI_N line of the IIC1 module is connected
182
;; this connections is required for the second MIDI IN port
183
;; Note: MIDI In is only supported for one MBHP_IIC_MIDI module,
184
;; and it must be the first one (IIC address 10, both jumpers stuffed)
185
;; By default, RC3 is used (available at J6:SI of the core module)
186
;; if RI_N_PORT == 0, the second MIDI Input will be disabled.
187
#define DEFAULT_IIC1_RI_N_PORT  PORTC
188
#define DEFAULT_IIC1_RI_N_TRIS  TRISC
189
#define DEFAULT_IIC1_RI_N_PIN   3
190
 
191
 
145 tk 192
;; define the AOUT interface which is used here:
193
;;   1: one MBHP_AOUT module
194
;;   2: up to 4 (chained) MBHP_AOUT_LC modules
195
;;   3: one MBHP_AOUT_NG module
196
;; all other values invalid!
197
#define AOUT_INTERFACE_TYPE 1
73 tk 198
 
145 tk 199
;; only relevant if one or more AOUT_LC modules are used:
200
;; define the resolution configuration here
201
;;   0: first channel 12bit, second channel 4bit
202
;;   1: first channel 8bit, second channel 8bit
285 tk 203
;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
145 tk 204
;; all other values invalid!
205
#define AOUT_LC_RESOLUTION_OPTION_M1 1
206
#define AOUT_LC_RESOLUTION_OPTION_M2 1
207
#define AOUT_LC_RESOLUTION_OPTION_M3 1
208
#define AOUT_LC_RESOLUTION_OPTION_M4 1
209
 
210
 
73 tk 211
;; use PORTA and PORTE (J5 of the core module) as trigger output
212
;; NEVER USE THIS TOGETHER WITH ANALOG POTS - IT WILL CAUSE A SHORT CIRCUIT!
213
#define DEFAULT_ENABLE_J5_GATES 0
214
 
215
;; additional gate triggers are available on common digital output pins of the
216
;; DOUT shift register chain - they are assigned to AOUT channel #16 (Note C-1, C#1, D-1, ...)
217
;; define the shift registers which should be used here (each provides 8 gates)
218
;; Note that SRs assigned to this function cannot be used as LED outputs (exclusive function)
219
;; Allowed values: 1-16, 0 disables the function, all other values invalid and not allowed
220
;; Note: depending on the shift registers you are using, you have to adjust
221
;; the DEFAULT_NUMBER_SR value at the top of this configuration
222
#define DEFAULT_ENABLE_DOUT_GATE_09_16   0
223
#define DEFAULT_ENABLE_DOUT_GATE_17_24   0
224
#define DEFAULT_ENABLE_DOUT_GATE_25_31   0
225
#define DEFAULT_ENABLE_DOUT_GATE_32_39   0
226
#define DEFAULT_ENABLE_DOUT_GATE_40_47   0
227
#define DEFAULT_ENABLE_DOUT_GATE_48_55   0
228
 
229
;; if set to 1, the DOUT "gates" will send 1mS pulses
230
;; useful for analog drums
231
#define DEFAULT_DOUT_1MS_TRIGGER    0
232
 
233
 
234
    org 0x3082      ; never change the origin!
235
; ==========================================================================
236
;  In this table all button functions are mapped to the DIN pins
237
;
238
;  The function name can be found on the left, the shift register and pin
239
;  number on the right side.
240
;
241
;  SR/pin numbers:
242
;     SR =  1 for the first DIN shift register
243
;     SR =  2 for the second DIN shift register
244
;     ...
245
;     SR = 16 for the last DIN shift register
246
;
247
;     Pin = 0 for the D0 input pin of the shift register
248
;     Pin = 1 for the D1 input pin of the shift register
249
;     ...
250
;     Pin = 7 for the last input pin (D7) of the shift register
251
;
252
;  Set the SR and pin number to 0 if a button function should not be used
253
;
254
;  The table must end with DIN_ENTRY_EOT!
255
; ==========================================================================
256
 
257
DIN_ENTRY MACRO function, sr, pin
96 tk 258
    dw  function, (pin + 8*((sr-1)&0xff))
73 tk 259
    ENDM
260
 
261
DIN_ENTRY_EOT MACRO
262
    dw  0x0000, 0x0000
263
    ENDM
264
 
265
SEQ_IO_TABLE_DIN
266
    ;;      Function name       SR# Pin#
267
    ;; NOTE: the pins of the 16 general purpose buttons are assigned above, search for DEFAULT_GP_DIN_SR_L (and _R)
268
#if DEFAULT_ENC_DATAWHEEL < 0
269
    DIN_ENTRY   CS_MENU_BUTTON_Left,     1,  0
270
    DIN_ENTRY   CS_MENU_BUTTON_Right,    1,  1
271
#endif
272
    DIN_ENTRY   SEQ_BUTTON_Scrub,    1,  2
273
    DIN_ENTRY   SEQ_BUTTON_Metronome,    1,  3
274
 
275
    DIN_ENTRY   SEQ_BUTTON_Stop,     1,  4
276
    DIN_ENTRY   SEQ_BUTTON_Pause,    1,  5
277
    DIN_ENTRY   SEQ_BUTTON_Play,     1,  6
278
    DIN_ENTRY   SEQ_BUTTON_Rew,      1,  7
279
    DIN_ENTRY   SEQ_BUTTON_Fwd,      2,  0
280
 
281
    DIN_ENTRY   SEQ_BUTTON_F1,       2,  1
282
    DIN_ENTRY   SEQ_BUTTON_F2,       2,  2
283
    DIN_ENTRY   SEQ_BUTTON_F3,       2,  3
284
    DIN_ENTRY   SEQ_BUTTON_F4,       2,  4
285
 
286
    DIN_ENTRY   SEQ_BUTTON_Menu,     2,  5
287
    DIN_ENTRY   SEQ_BUTTON_Select,   2,  6
288
    DIN_ENTRY   SEQ_BUTTON_Exit,     2,  7
289
 
290
    DIN_ENTRY   SEQ_BUTTON_Track1,   3,  0
291
    DIN_ENTRY   SEQ_BUTTON_Track2,   3,  1
292
    DIN_ENTRY   SEQ_BUTTON_Track3,   3,  2
293
    DIN_ENTRY   SEQ_BUTTON_Track4,   3,  3
294
 
295
    DIN_ENTRY   SEQ_BUTTON_LayerA,   3,  4
296
    DIN_ENTRY   SEQ_BUTTON_LayerB,   3,  5
297
    DIN_ENTRY   SEQ_BUTTON_LayerC,   3,  6
298
 
299
    DIN_ENTRY   SEQ_BUTTON_Edit,     4,  0
300
    DIN_ENTRY   SEQ_BUTTON_Mute,     4,  1
301
    DIN_ENTRY   SEQ_BUTTON_Pattern,  4,  2
302
    DIN_ENTRY   SEQ_BUTTON_Song,     4,  3
303
 
304
    DIN_ENTRY   SEQ_BUTTON_Solo,     4,  4
305
    DIN_ENTRY   SEQ_BUTTON_Fast,     4,  5
306
    DIN_ENTRY   SEQ_BUTTON_All,      4,  6
307
 
308
    ;; OPTIONAL! see CHANGELOG.txt
309
    DIN_ENTRY   SEQ_BUTTON_Group1,  13,  0
310
    DIN_ENTRY   SEQ_BUTTON_Group2,  13,  1
311
    DIN_ENTRY   SEQ_BUTTON_Group3,  13,  2
312
    DIN_ENTRY   SEQ_BUTTON_Group4,  13,  3
313
 
314
    ;; OPTIONAL! see CHANGELOG.txt
315
    DIN_ENTRY   SEQ_BUTTON_TrgLayerA,   13,  4
316
    DIN_ENTRY   SEQ_BUTTON_TrgLayerB,   13,  5
317
    DIN_ENTRY   SEQ_BUTTON_TrgLayerC,   13,  6
318
 
319
    ;; OPTIONAL! see CHANGELOG.txt
320
    DIN_ENTRY   SEQ_BUTTON_ToggleStepView, 13,   7
321
 
322
    DIN_ENTRY_EOT
323
 
324
 
325
; ==========================================================================
326
;  The following table defines all available DOUT pins with the appr.
327
;  register and bit which is assigned to the pin
328
;  CS_MENU_LED_Update uses this table to update all LEDs
329
; 
330
;  The register name and bit number can be found on the left, 
331
;  the shift register and pin number on the right side.
332
;
333
;  SR/pin numbers:
334
;     SR =  1 for the first DOUT shift register
335
;     SR =  2 for the second DOUT shift register
336
;     ...
337
;     SR = 16 for the last DOUT shift register
338
;
339
;     Pin = 0 for the D7 output pin of the shift register
340
;     Pin = 1 for the D6 output pin of the shift register
341
;     ...
342
;     Pin = 7 for the last input pin (D0) of the shift register
343
;
344
;  Set the SR and pin number to 0 if a LED function should not be used
345
;
346
;  The table must end with DOUT_ENTRY_EOT!
347
; ==========================================================================
348
 
349
DOUT_ENTRY MACRO reg, bit, sr, pin
350
        if sr == 0      ; J5 selected
351
        dw  reg, bit | ((pin | 0x80) << 8)
352
    else            ; SR selected
353
        dw  reg, bit | ((pin + 8*(sr-1)) << 8)
354
    endif
355
    ENDM
356
 
357
DOUT_ENTRY_EOT MACRO
358
    dw  0x0000, 0x0000
359
    ENDM
360
 
361
SEQ_IO_TABLE_DOUT
362
    ;;      Register and bit            SR# Pin#      Description
363
    DOUT_ENTRY  TMP1, 0,                1,  0   ; Track #1 selected (Note: Pin #0 is the D7 output of first SR)
364
    DOUT_ENTRY  TMP1, 1,                1,  1   ; Track #2 selected
365
    DOUT_ENTRY  TMP1, 2,                1,  2   ; Track #3 selected
366
    DOUT_ENTRY  TMP1, 3,                1,  3   ; Track #4 selected
367
 
368
    DOUT_ENTRY  TMP1, 4,                1,  4   ; Layer A selected
369
    DOUT_ENTRY  TMP1, 5,                1,  5   ; Layer B selected
370
    DOUT_ENTRY  TMP1, 6,                1,  6   ; Layer C selected
371
 
372
    ;; NOTE: the pin of the beat indicator LED has to be assigned above, search for DEFAULT_BEAT_INDICATOR_LED
373
 
374
    DOUT_ENTRY  TMP2, 0,                2,  0   ; Edit Step LED
375
    DOUT_ENTRY  TMP2, 1,                2,  1   ; Mute LED
376
    DOUT_ENTRY  TMP2, 2,                2,  2   ; Pattern LED
377
    DOUT_ENTRY  TMP2, 3,                2,  3   ; Song LED
378
    DOUT_ENTRY  TMP2, 7,                2,  4   ; Solo LED
379
    DOUT_ENTRY  TMP2, 5,                2,  5   ; Fast Encoder LED
380
    DOUT_ENTRY  TMP2, 6,                2,  6   ; Change All Steps LED
381
 
382
    ;; OPTIONAL! see CHANGELOG.txt
383
    DOUT_ENTRY  TMP4, 0,                11, 0   ; Group 1 LED
384
    DOUT_ENTRY  TMP4, 1,                11, 2   ; Group 2 LED (assigned to pin 2 due to DUO LED)
385
    DOUT_ENTRY  TMP4, 2,                11, 4   ; Group 3 LED (assigned to pin 4 due to DUO LED)
386
    DOUT_ENTRY  TMP4, 3,                11, 6   ; Group 4 LED (assigned to pin 6 due to DUO LED)
387
 
388
    ;; OPTIONAL! see CHANGELOG.txt
96 tk 389
    DOUT_ENTRY  TMP4, 5,                12, 0   ; Trigger Layer A LED
390
    DOUT_ENTRY  TMP4, 6,                12, 1   ; Trigger Layer B LED
391
    DOUT_ENTRY  TMP4, 7,                12, 2   ; Trigger Layer C LED
73 tk 392
 
393
    ;; OPTIONAL! see CHANGELOG.txt
394
    DOUT_ENTRY  TMP5, 0,                12, 3   ; Play LED
395
    DOUT_ENTRY  TMP5, 1,                12, 4   ; Stop LED
396
    DOUT_ENTRY  TMP5, 2,                12, 5   ; Pause LED
397
 
398
    ;; OPTIONAL! see CHANGELOG.txt
399
    DOUT_ENTRY  TMP5, 3,                12, 6   ; Step 1-16 displayed
400
    DOUT_ENTRY  TMP5, 4,                12, 7   ; Step 17-31 displayed
401
 
402
    ;; NOTE: the pins of the MIDI Rx/Tx LEDs are assigned above, search for DEFAULT_MIDI_RX_LED and TX_LED
403
    ;; NOTE: the pins of the 16 general purpose LEDs are assigned above, search for DEFAULT_GP_DOUT_SR_L and _R
404
    DOUT_ENTRY_EOT
405
 
406
 
407
;; --------------------------------------------------------------------------
408
;; In this table DIN pins have to be assigned to rotary encoders for the
409
;; MIOS_ENC driver 
410
;; 
411
;; up to 64 entries are provided, for MIDIbox SEQ 17 entries are expected
412
;; 
413
;; The table must be terminated with an ENC_EOT entry. Unused entries should
414
;; be filled with ENC_EOT
415
;; 
416
;; ENC_ENTRY provides following parameters
417
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
418
;;    o second parameter: number of pin; since two pins are necessary
419
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
420
;;    o the third parameter contains the encoder mode:
421
;;      either MIOS_ENC_MODE_NON_DETENTED
422
;;          or MIOS_ENC_MODE_DETENTED
423
;;          or MIOS_ENC_MODE_DETENTED2 (prefered for Encoders from Voti and SmashTV!)
424
;;          or MIOS_ENC_MODE_DETENTED3
425
;;      see also http://www.midibox.org/dokuwiki/doku.php?id=encoder_types
426
;;
427
;; Configuration Examples:
428
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
429
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
430
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
431
;; --------------------------------------------------------------------------
432
    org 0x3280      ; never change the origin!
433
    ;; encoder entry structure
434
ENC_ENTRY MACRO sr, din_0, mode
435
    dw  (mode << 8) | (din_0 + 8*(sr-1))
436
    ENDM   
437
ENC_EOT MACRO
438
    dw  0xffff
439
    ENDM
440
 
441
MIOS_ENC_PIN_TABLE
442
    ;;        SR  Pin  Mode
443
#if DEFAULT_ENC_DATAWHEEL >= 0
444
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED2  ; Data Wheel
445
#endif
446
 
447
    ENC_ENTRY  5,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 1
448
    ENC_ENTRY  5,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 2
449
    ENC_ENTRY  5,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 3
450
    ENC_ENTRY  5,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 4
451
    ENC_ENTRY  6,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 5
452
    ENC_ENTRY  6,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 6
453
    ENC_ENTRY  6,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 7
454
    ENC_ENTRY  6,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 8
455
    ENC_ENTRY  8,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 9
456
    ENC_ENTRY  8,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 10
457
    ENC_ENTRY  8,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 11
458
    ENC_ENTRY  8,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 12
459
    ENC_ENTRY  9,  0,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 13
460
    ENC_ENTRY  9,  2,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 14
461
    ENC_ENTRY  9,  4,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 15
462
    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_DETENTED2  ; V-Pot 16
463
 
464
    ;; don't remove this "end-of-table" entry!
465
    ENC_EOT        
466
 
467
 
468
;; include the rest of the application
469
#include "main.inc"