Subversion Repositories svn.mios

Rev

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

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