Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
1 tk 1
;
2
; MIOS Definitions file
3
;
4
; ==========================================================================
5
;
6
;  Copyright 1998-2008 Thorsten Klose (tk@midibox.org)
7
;  Licensed for personal non-commercial use only.
8
;  All other rights reserved.
9
;
10
; ==========================================================================
11
 
12
 
13
;; ==========================================================================
14
;;  Assembler directives & device specific include file
15
;;
16
;;  Natively supported devices are listed here.
17
;;  Some basic defines are added which characterize the derivative to
18
;;  simplify dependencies within MIOS source code
19
;; ==========================================================================
20
 
21
#ifdef __18F452
22
    LIST R=DEC
23
#include <p18f452.inc>
24
#define PIC_DERIVATIVE_CODE_SIZE    0x08000
25
#define PIC_DERIVATIVE_RAM_SIZE     0x600
26
#define PIC_DERIVATIVE_EEPROM_SIZE  0x100
27
#define PIC_DERIVATIVE_IRQ_WORKAROUND   0
28
#define PIC_DERIVATIVE_NEW_ADC      0
29
#define PIC_DERIVATIVE_CMCON_INIT   0
30
#define PIC_DERIVATIVE_T08BIT_INVERTED  0
31
#define PIC_DERIVATIVE_SET_LCD_4BIT 0
32
#endif
33
 
34
#ifdef __18F4620
35
    LIST R=DEC
36
#include <p18f4620.inc>
37
#define PIC_DERIVATIVE_CODE_SIZE    0x10000
38
#define PIC_DERIVATIVE_RAM_SIZE     0xf80
39
#define PIC_DERIVATIVE_EEPROM_SIZE  0x400
40
#define PIC_DERIVATIVE_IRQ_WORKAROUND   1
41
#define PIC_DERIVATIVE_NEW_ADC      1
42
#define PIC_DERIVATIVE_CMCON_INIT   1
43
#define PIC_DERIVATIVE_T08BIT_INVERTED  1
44
#define PIC_DERIVATIVE_SET_LCD_4BIT 0
45
#endif
46
 
47
#ifdef __18F4520
48
    LIST R=DEC
49
#include <p18f4520.inc>
50
#define PIC_DERIVATIVE_CODE_SIZE    0x08000
51
#define PIC_DERIVATIVE_RAM_SIZE     0x600
52
#define PIC_DERIVATIVE_EEPROM_SIZE  0x100
53
#define PIC_DERIVATIVE_IRQ_WORKAROUND   1
54
#define PIC_DERIVATIVE_NEW_ADC      1
55
#define PIC_DERIVATIVE_CMCON_INIT   1
56
#define PIC_DERIVATIVE_T08BIT_INVERTED  0
57
#define PIC_DERIVATIVE_SET_LCD_4BIT 0
58
#endif
59
 
60
#ifdef __18F4682
61
    LIST R=DEC
62
#include <p18f4682.inc>
63
#define PIC_DERIVATIVE_CODE_SIZE    0x14000
64
#define PIC_DERIVATIVE_RAM_SIZE     0xd00
65
#define PIC_DERIVATIVE_EEPROM_SIZE  0x400
66
#define PIC_DERIVATIVE_IRQ_WORKAROUND   0
67
#define PIC_DERIVATIVE_NEW_ADC      1
68
#define PIC_DERIVATIVE_CMCON_INIT   1
69
#define PIC_DERIVATIVE_T08BIT_INVERTED  0
70
#define PIC_DERIVATIVE_SET_LCD_4BIT 1
71
#endif
72
 
73
#ifdef __18F4685
74
    LIST R=DEC
75
#include <p18f4685.inc>
76
#define PIC_DERIVATIVE_CODE_SIZE    0x18000
77
#define PIC_DERIVATIVE_RAM_SIZE     0xd00
78
#define PIC_DERIVATIVE_EEPROM_SIZE  0x400
79
#define PIC_DERIVATIVE_IRQ_WORKAROUND   0
80
#define PIC_DERIVATIVE_NEW_ADC      1
81
#define PIC_DERIVATIVE_CMCON_INIT   1
82
#define PIC_DERIVATIVE_T08BIT_INVERTED  0
83
#define PIC_DERIVATIVE_SET_LCD_4BIT 1
84
#endif
85
 
86
;; ==========================================================================
87
;;  General constants
88
;; ==========================================================================
89
 
90
;; used by MIOS_MIDI_Interface*
91
MIOS_MIDI_INTERFACE_COMMON  EQU 0x00
92
MIOS_MIDI_INTERFACE_TO_HOST EQU 0x01
93
 
94
;; used by MIOS_MIDI_Merger*
95
MIOS_MIDI_MERGER_DISABLED   EQU 0x00
96
MIOS_MIDI_MERGER_ENABLED    EQU 0x01
97
MIOS_MIDI_MERGER_MBLINK_EP  EQU 0x02
98
MIOS_MIDI_MERGER_MBLINK_FP  EQU 0x03
99
 
100
;; used by MIOS_ENC_PIN_TABLE
101
MIOS_ENC_MODE_NON_DETENTED  EQU 0x00
102
MIOS_ENC_MODE_DETENTED      EQU 0x80
103
MIOS_ENC_MODE_DETENTED1     EQU 0x80
104
MIOS_ENC_MODE_DETENTED2     EQU 0x81
105
MIOS_ENC_MODE_DETENTED3     EQU 0x82
106
 
107
;; used by MIOS_ENC_Speed*
108
MIOS_ENC_SPEED_SLOW     EQU 0
109
MIOS_ENC_SPEED_NORMAL       EQU 1
110
MIOS_ENC_SPEED_FAST     EQU 2
111
 
112
;; used by MIOS_LCD_Type*
113
MIOS_LCD_TYPE_CLCD      EQU 0x00
114
MIOS_LCD_TYPE_GLCD0     EQU 0x01
115
MIOS_LCD_TYPE_GLCD1     EQU 0x02
116
MIOS_LCD_TYPE_GLCD2     EQU 0x03
117
MIOS_LCD_TYPE_GLCD3     EQU 0x04
118
MIOS_LCD_TYPE_GLCD4     EQU 0x05
119
MIOS_LCD_TYPE_MLCD      EQU 0x06
120
MIOS_LCD_TYPE_GLCD_CUSTOM   EQU 0x07
121
 
122
;; location of default 5x8 font for graphical displays
123
MIOS_GLCD_FONT          EQU 0x7cfc
124
 
125
;; general config flags (never overwrite this flags directly!!!)
126
MIOS_BOX_CFG0_LCD_TYPE0     EQU 0   ; selects LCD type, bit 0
127
MIOS_BOX_CFG0_LCD_TYPE1     EQU 1   ; selects LCD type, bit 1
128
MIOS_BOX_CFG0_LCD_TYPE2     EQU 2   ; selects LCD type, bit 2
129
MIOS_BOX_CFG0_USE_GLCD      EQU 3   ; if 1, graphical LCD is connected
130
MIOS_BOX_CFG0_MERGER        EQU 4   ; if 1, MIDI merger is enabled
131
MIOS_BOX_CFG0_MBLINK        EQU 5   ; if 1, MIDIbox Link is enabled
132
MIOS_BOX_CFG0_TO_HOST       EQU 6   ; if 1, MIDI interface will run with 38400 baud instead of 31250
133
MIOS_BOX_CFG0_20MHz     EQU 7   ; if 1, it is assumed that box is running with 20 MHz, else with 40 MHz
134
 
135
MIOS_BOX_CFG1_BS_A0     EQU 0   ; A0 of BankStick (never change the bit position)
136
MIOS_BOX_CFG1_BS_A1     EQU 1   ; A1 of BankStick (never change the bit position)
137
MIOS_BOX_CFG1_BS_A2     EQU 2   ; A2 of BankStick (never change the bit position)
138
MIOS_BOX_CFG1_BS_DIS_VERIFY EQU 3   ; if 1, writes to the BankStick will not be verified
139
MIOS_BOX_CFG1_IIC_STRETCH_CLK   EQU 4   ; if 1, IIC clock stretching enabled
140
 
141
;; general status flags (never overwrite this flags directly!!!)
142
MIOS_BOX_STAT_BS_AVAILABLE  EQU 0   ; if 1, BankStick is available
143
MIOS_BOX_STAT_MBLINK_TUNNEL_PASS EQU 1  ; if 1, a MBLinked event will be tunnled
144
MIOS_BOX_STAT_SUSPEND_ALL       EQU 2   ; if 1, all system and user tasks are suspended
145
MIOS_BOX_STAT_SUSPEND_USER      EQU 3   ; if 1, all user tasks are suspended
146
MIOS_BOX_STAT_AUTOREPEAT    EQU 4   ; if 1, start the auto-repeat handler
147
MIOS_BOX_STAT_MLCD_TRANSFER EQU 5   ; if 1, a transfer to the MLCD has been started
148
MIOS_BOX_STAT_FERR      EQU 6   ; if 1, a frame error happened during MIDI receive
149
 
150
;; ==========================================================================
151
;;  MIOS Special Function Registers
152
;; ==========================================================================
153
 
154
MIOS_BOX_CFG0   EQU 0x000
155
MIOS_BOX_CFG1   EQU 0x001
156
MIOS_BOX_STAT   EQU 0x002
157
MIOS_PARAMETER1 EQU 0x003
158
MIOS_PARAMETER2 EQU 0x004
159
MIOS_PARAMETER3 EQU 0x005
160
 
161
;; ==========================================================================
162
;;  temporary registers for main programs
163
;; ==========================================================================
164
TMP1        EQU 0x006
165
TMP2        EQU 0x007
166
TMP3        EQU 0x008
167
TMP4        EQU 0x009
168
TMP5        EQU 0x00a
169
 
170
;; ==========================================================================
171
;;  temporary registers for IRQs
172
;; ==========================================================================
173
IRQ_TMP1    EQU 0x00b
174
IRQ_TMP2    EQU 0x00c
175
IRQ_TMP3    EQU 0x00d
176
IRQ_TMP4    EQU 0x00e
177
IRQ_TMP5    EQU 0x00f
178
 
179
;; ==========================================================================
180
;;  free memory space for user application:
181
;; ==========================================================================
182
    ;; 0x010-0x37f
183
 
184
;; ==========================================================================
185
;;  MIOS System Registers -- not defined here --
186
;;  never use these memory locations!
187
;; ==========================================================================
188
    ;; 0x380-0x6ff
189
 
190
;; ==========================================================================
191
;;  MIOS System Registers for custom LCD driver
192
;; ==========================================================================
193
MIOS_GLCD_BUFFER    EQU 0x570   ; note: the buffer must be located at ...0-...7
194
MIOS_LCD_OPTION1    EQU 0x578   ; contains the first LCD option given by MIOS_LCD_TypeSet
195
MIOS_LCD_OPTION2    EQU 0x579   ; contains the second LCD option given by MIOS_LCD_TypeSet
196
MIOS_LCD_CURSOR_POS EQU 0x57a   ; the current cursor pos of characters (GLCD: multiplied by width)
197
MIOS_GLCD_GCURSOR_X EQU 0x57b   ; for GLCDs: the current X position of graphical cursor
198
MIOS_GLCD_GCURSOR_Y EQU 0x57c   ; for GLCDs: the current Y position of graphical cursor
199
MIOS_GLCD_FONT_WIDTH    EQU 0x57d   ; for GLCDs: the fontwidth given by MIOS_GLCD_FontInit
200
MIOS_GLCD_FONT_HEIGHT   EQU 0x57e   ; for GLCDs: the fontheight given by MIOS_GLCD_FontInit
201
MIOS_GLCD_FONT_X0   EQU 0x57f   ; for GLCDs: the first byte within a char entry
202
MIOS_GLCD_FONT_OFFSET   EQU 0x580   ; for GLCDs: the byte offset between the characters
203
MIOS_GLCD_FONT_PTRL EQU 0x581   ; for GLCDs: pointer to the character table, low-byte
204
MIOS_GLCD_FONT_PTRH EQU 0x582   ; for GLCDs: pointer to the character table, high-byte
205
MIOS_LCD_TIMEOUT0   EQU 0x583   ; can be used for timeout loops
206
MIOS_LCD_TIMEOUT1   EQU 0x584   ; can be used for timeout loops
207
MIOS_GLCD_TMP1      EQU 0x585   ; can be used as temporary buffer
208
MIOS_GLCD_TMP2      EQU 0x586   ; can be used as temporary buffer
209
MIOS_GLCD_TMP3      EQU 0x587   ; can be used as temporary buffer
210
MIOS_GLCD_TMP4      EQU 0x588   ; can be used as temporary buffer
211
MIOS_LCD_Y0_OFFSET  EQU 0x589   ; Y0 offset of LCD
212
MIOS_LCD_Y1_OFFSET  EQU 0x58a   ; Y1 offset of LCD
213
MIOS_LCD_Y2_OFFSET  EQU 0x58b   ; Y2 offset of LCD
214
MIOS_LCD_Y3_OFFSET  EQU 0x58c   ; Y3 offset of LCD
215
MIOS_LCD_CURSOR_POS_REAL EQU    0x58d   ; unmapped cursor position which has been set with MIOS_LCD_CursorSet
216
MIOS_GLCD_FONT_PTRU EQU 0x58e   ; for GLCDs: pointer to the character table, upper-byte (>64k flash derivatives only)