Subversion Repositories svn.mios

Rev

Rev 196 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
111 tk 1
; $Id: setup_mbfm_tk.asm 285 2008-04-23 20:31:07Z tk $
194 tk 2
    LIST R=DEC
111 tk 3
;
4
; Prepared Setup File for TK's MIDIbox FM setup
5
; In difference to the setup_mbfm_v1.asm configuration it uses a different 
6
; rotary encoder type and an enabled AOUT interface
7
;
8
 
9
    ;; set this to '0' to disable the control surface - this is especially usefull for
10
    ;; people who want to program their own CS handler in order to free
11
    ;; some memory
12
#define CS_ENABLED 1
13
 
14
    ;; number of visible menu items on LCD
15
    ;; use:  3 for 2x16 displays
16
    ;;       4 for 2x20 displays
17
    ;;       8 for 2x40 displays
18
#define CS_MENU_DISPLAYED_ITEMS 8
19
    ;; NOTE: if CS_MENU_DISPLAYED_ITEMS < 8, you have to adapt the DIN settings
20
    ;; in cs_menu_io_tables.inc
21
 
22
    ;; OLD_STYLE == 1: page scrolls with the cursor
23
    ;; OLD_STYLE == 0: page scrolls directly with the datawheel
24
#define CS_MENU_OLD_STYLE 0
25
 
26
    ;; Inc/Dec buttons or rotary encoder of data entry?
27
    ;; use:  0 if rotary encoder should be used 
28
    ;;         (pins of encoder are defined in mios_tables.inc)
29
    ;;       1 if buttons should be used instead
30
#define CS_MENU_USE_INCDEC_BUTTONS 0
31
 
32
    ;; use:  0 if a non-detented encoder is used to select the menu items
33
    ;;       1 if a detented encoder is used to select the menu items
34
    ;; the CS_MENU_EncSpeedSet function in "cs_menu.inc" sets the speed
35
    ;; depending on this value
36
#define CS_MENU_USE_DETENTED_ENCODER 1
37
 
38
    ;; the speed value for the additional encoders (#2-#5) is defined here
39
    ;; Hint: for non-detented encoders try the following: in mios_tables.inc
40
    ;; set the type of all encoders to "MIOS_ENC_MODE_DETENTED2" in order to
41
    ;; reduce the resolution (e.g. 24 ticks per revolution for a ALPS STEC16B),
42
    ;; set the speed value to 3 --- result: so long as the encoder is moved
43
    ;; slow, the parameter can be changed very precisely. By moving the encoder
44
    ;; faster, it is possible to sweep over the whole value range with a single turn
45
    ;; ("Progressive Mode")
46
#define CS_MENU_ENC_SPEED_VALUE 1
47
 
48
    ;; select the default mode of the main display after startup:
49
    ;; 0: show all 4 instruments, names are cropped to 9 characters
50
    ;; 1: show only the selected instrument, full name is displayed
51
    ;; the display mode can also be changed in the CFG menu (press CFG button)
52
#define CS_MENU_DEFAULT_VIEW_MODE 1
53
 
139 tk 54
    ;; define the AOUT interface which is used here:
55
    ;;   1: one MBHP_AOUT module
56
    ;;   2: up to 4 (chained) MBHP_AOUT_LC modules
57
    ;;   3: one MBHP_AOUT_NG module
58
    ;; all other values invalid!
59
#define AOUT_INTERFACE_TYPE 2
111 tk 60
 
139 tk 61
    ;; only relevant if one or more AOUT_LC modules are used:
62
    ;; define the resolution configuration here
63
    ;;   0: first channel 12bit, second channel 4bit
64
    ;;   1: first channel 8bit, second channel 8bit
285 tk 65
    ;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
139 tk 66
    ;; all other values invalid!
67
#define AOUT_LC_RESOLUTION_OPTION_M1 0
68
#define AOUT_LC_RESOLUTION_OPTION_M2 0
69
#define AOUT_LC_RESOLUTION_OPTION_M3 0
70
#define AOUT_LC_RESOLUTION_OPTION_M4 0
71
 
111 tk 72
    ;; only for debugging: prints the MBFM load at the right upper edge of the 2x40 LCD
73
#define DISPLAY_PERFORMANCE 0
74
 
75
 
76
    ;; experimental superpoly mode (currently hard-coded to save programming effort)
77
#define SUPERPOLY_EXPERIMENT 0
78
 
79
 
80
;; --------------------------------------------------------------------------
81
;; In this table DIN pins have to be assigned to rotary encoders for the
82
;; MIOS_ENC driver 
83
;; 
84
;; up to 64 entries are provided
85
;; 
86
;; The table must be terminated with an ENC_EOT entry. Unused entries should
87
;; be filled with ENC_EOT
88
;; 
89
;; ENC_ENTRY provides following parameters
90
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
91
;;    o second parameter: number of pin; since two pins are necessary
92
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
93
;;    o the third parameter contains the encoder mode:
94
;;      either MIOS_ENC_MODE_NON_DETENTED
95
;;          or MIOS_ENC_MODE_DETENTED
96
;;          or MIOS_ENC_MODE_DETENTED2
97
;;          or MIOS_ENC_MODE_DETENTED3
98
;;      see also http://www.midibox.org/dokuwiki/doku.php?id=encoder_types
99
;;
100
;; Configuration Examples:
101
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
102
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
103
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
104
;; --------------------------------------------------------------------------
105
 
106
    org 0x3280      ; never change the origin!
107
 
108
    ;; encoder entry structure
109
ENC_ENTRY MACRO sr, din_0, mode
110
    dw  (mode << 8) | (din_0 + 8*(sr-1))
111
    ENDM   
112
ENC_EOT MACRO
113
    dw  0xffff
114
    ENDM
115
 
116
MIOS_ENC_PIN_TABLE
117
    ;; encoders 1-16
118
    ;;        SR  Pin  Mode
119
#if CS_MENU_USE_INCDEC_BUTTONS
120
    ENC_EOT
121
#else
122
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED   ; menu encoder
123
#endif
124
 
125
    ;; additional CS encoders
126
    ;;        SR  Pin  Mode
127
    ENC_ENTRY  3,  2,  MIOS_ENC_MODE_DETENTED   ; Multipurpose Enc #1
128
    ENC_ENTRY  3,  4,  MIOS_ENC_MODE_DETENTED   ; Multipurpose Enc #2
129
    ENC_ENTRY  3,  6,  MIOS_ENC_MODE_DETENTED   ; Multipurpose Enc #3
130
    ENC_ENTRY  4,  0,  MIOS_ENC_MODE_DETENTED   ; Multipurpose Enc #4
131
 
132
    ENC_EOT
133
 
134
    ;; encoders 17-32
135
    ENC_EOT
136
    ENC_EOT
137
    ENC_EOT
138
    ENC_EOT
139
    ENC_EOT
140
    ENC_EOT
141
    ENC_EOT
142
    ENC_EOT
143
    ENC_EOT
144
    ENC_EOT
145
    ENC_EOT
146
    ENC_EOT
147
    ENC_EOT
148
    ENC_EOT
149
    ENC_EOT
150
    ENC_EOT
151
 
152
    ;; encoders 33-48
153
    ENC_EOT
154
    ENC_EOT
155
    ENC_EOT
156
    ENC_EOT
157
    ENC_EOT
158
    ENC_EOT
159
    ENC_EOT
160
    ENC_EOT
161
    ENC_EOT
162
    ENC_EOT
163
    ENC_EOT
164
    ENC_EOT
165
    ENC_EOT
166
    ENC_EOT
167
    ENC_EOT
168
    ENC_EOT
169
 
170
    ;; encoders 49-64
171
    ENC_EOT
172
    ENC_EOT
173
    ENC_EOT
174
    ENC_EOT
175
    ENC_EOT
176
    ENC_EOT
177
    ENC_EOT
178
    ENC_EOT
179
    ENC_EOT
180
    ENC_EOT
181
    ENC_EOT
182
    ENC_EOT
183
    ENC_EOT
184
    ENC_EOT
185
    ENC_EOT
186
    ENC_EOT
187
 
188
 
189
#include "src/main.inc"