Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1186 | savelij | 1 | ifndef __reglit2xinc ; avoid multiple inclusion |
2 | __reglit2xinc equ 1 |
||
3 | |||
4 | save |
||
5 | listing off ; no listing over this file |
||
6 | |||
7 | ;**************************************************************************** |
||
8 | ;* * |
||
9 | ;* AS 1.42 - File REGLIT2X.INC * |
||
10 | ;* * |
||
11 | ;* contains SFR and Bit Definitions for ST7LITE2x * |
||
12 | ;* * |
||
13 | ;* Source: ST7LITE20 Data Sheet, Rev. 7, DocID8349, January 2014 * |
||
14 | ;* * |
||
15 | ;**************************************************************************** |
||
16 | |||
17 | ;---------------------------------------------------------------------------- |
||
18 | ; Memory Addresses |
||
19 | |||
20 | RAMSTART label $0080 ; Start Address Internal RAM |
||
21 | RAMEND label $01ff ; End " " " |
||
22 | |||
23 | switch SUBSTR(MOMCPUNAME,STRLEN(MOMCPUNAME)-3,1) |
||
24 | case "0","5" |
||
25 | case "9" |
||
26 | EESTART label $1000 ; Start Address Internal EEPROM |
||
27 | EEEND label $10ff ; End " " " |
||
28 | endcase |
||
29 | |||
30 | RCCR0 label $1000 ; RC Oscillator Calibration Values |
||
31 | RCCR1 label $1001 |
||
32 | |||
33 | ;---------------------------------------------------------------------------- |
||
34 | ; Interrupt Vectors |
||
35 | |||
36 | SPI_vect label $ffe2 ; SPI Interrupt |
||
37 | LT_RTC1_vect label $ffe4 ; Lite Timer RTC1 Interrupt |
||
38 | LT_IC_vect label $ffe6 ; Lite Timer Input Capture Interrupt |
||
39 | AT_OF1_vect label $ffe8 ; AT Timer Overflow 1 Interrupt |
||
40 | AT_OC_vect label $ffea ; AT Timer Output Compare Interrupt, shared with... |
||
41 | AT_IC_vect label $ffea ; AT Timer Input Capture Interrupt |
||
42 | SI_vect label $ffec ; AVD Interrupt |
||
43 | LT_RTC2_vect label $fff0 ; LITE TIMER RTC2 interrupt |
||
44 | EI3_vect label $fff2 ; External Interrupt Vector EI3 |
||
45 | EI2_vect label $fff4 ; External Interrupt Vector EI2 |
||
46 | EI1_vect label $fff6 ; External Interrupt Vector EI1 |
||
47 | EI0_vect label $fff8 ; External Interrupt Vector EI0 |
||
48 | AWU_vect label $fffa ; Auto Wakeup Interrupt Vector |
||
49 | TRAP_vect label $fffc ; TRAP (software) Interrupt Vector |
||
50 | RESET_vect label $fffe ; RESET Vector |
||
51 | |||
52 | ;---------------------------------------------------------------------------- |
||
53 | ; GPIO |
||
54 | |||
55 | include "gpio.inc" |
||
56 | __defgpio "PA",$0000 |
||
57 | __defgpio "PB",$0003 |
||
58 | |||
59 | ;---------------------------------------------------------------------------- |
||
60 | ; Lite Timer |
||
61 | |||
62 | LTCSR2 label $0008 ; Lite Timer Control/Status Register 2 |
||
63 | TB2IE bit LTCSR2,1 ; Timebase 2 Interrupt Enable Bit |
||
64 | TB2F bit LTCSR2,0 ; Timebase 2 Interrupt Flag |
||
65 | LTARR label $0009 ; Lite Timer Auto-reload Register |
||
66 | LTCNTR label $000a ; Lite Timer Counter Register |
||
67 | LTCSR1 label $000b ; Lite Timer Control/Status Register 1 |
||
68 | TBICIE bit LTCSR1,7 ; Interrupt Enable Bit |
||
69 | TBICF bit LTCSR1,6 ; Input Capture Flag |
||
70 | TB bit LTCSR1,5 ; Timebase Period Selection Bit |
||
71 | TB1IE bit LTCSR1,4 ; Timebase Interrupt Enable Bit |
||
72 | TB1F bit LTCSR1,3 ; Timebase Interrupt Flag |
||
73 | LTICR label $000c ; Lite Timer Input Capture Register |
||
74 | |||
75 | ;---------------------------------------------------------------------------- |
||
76 | ; Auto-Reload Timer |
||
77 | |||
78 | ATCSR label $000d ; Timer Control/Status Register |
||
79 | ICF bit ATCSR,6 ; Input Capture flag |
||
80 | ICIE bit ATCSR,5 ; IC Interrupt Enable bit |
||
81 | CK bfield ATCSR,3,2 ; Counter Clock Selection |
||
82 | OVF1 bit ATCSR,2 ; Overflow flag |
||
83 | OVFIE1 bit ATCSR,1 ; Overflow Interrupt Enable bit |
||
84 | ATCMPIE bit ATCSR,0 ; Compare Interrupt Enable bit |
||
85 | CNTRH label $000e ; Counter Register High |
||
86 | CNTRL label $000f ; Counter Register Low |
||
87 | ATRH label $0010 ; Auto-Reload Register 1 High |
||
88 | ATRL label $0011 ; Auto-Reload Register 1 Low |
||
89 | PWMCR label $0012 ; PWM Output Control Register |
||
90 | OE3 bit PWMCR,6 ; PWM3 Output Enable |
||
91 | OE2 bit PWMCR,4 ; PWM2 Output Enable |
||
92 | OE1 bit PWMCR,2 ; PWM1 Output Enable |
||
93 | OE0 bit PWMCR,0 ; PWM0 Output Enable |
||
94 | PWM0CSR label $0013 ; PWM 0 Control/Status Register |
||
95 | OP0 bit PWM0CSR,1 ; PWM0 Output Polarity Bit |
||
96 | CMPF0 bit PWM0CSR,0 ; PWM0 Compare Flag |
||
97 | PWM1CSR label $0014 ; PWM 1 Control/Status Register |
||
98 | OP1 bit PWM1CSR,1 ; PWM1 Output Polarity Bit |
||
99 | CMPF1 bit PWM1CSR,0 ; PWM1 Compare Flag |
||
100 | PWM2CSR label $0015 ; PWM 2 Control/Status Register |
||
101 | OP2 bit PWM2CSR,1 ; PWM2 Output Polarity Bit |
||
102 | CMPF2 bit PWM2CSR,0 ; PWM2 Compare Flag |
||
103 | PWM3CSR label $0016 ; PWM 3 Control/Status Register |
||
104 | OP_EN bit PWM3CSR,3 ; One Pulse Mode Enable Bit |
||
105 | OPEDGE bit PWM3CSR,2 ; One Pulse Edge Selection Bit |
||
106 | OP3 bit PWM3CSR,1 ; PWM3 Output Polarity Bit |
||
107 | CMPF3 bit PWM3CSR,0 ; PWM3 Compare Flag |
||
108 | DCR0H label $0017 ; PWM 0 Duty Cycle Register High |
||
109 | DCR0L label $0018 ; PWM 0 Duty Cycle Register Low |
||
110 | DCR1H label $0019 ; PWM 1 Duty Cycle Register High |
||
111 | DCR1L label $001a ; PWM 1 Duty Cycle Register Low |
||
112 | DCR2H label $001b ; PWM 2 Duty Cycle Register High |
||
113 | DCR2L label $001c ; PWM 2 Duty Cycle Register Low |
||
114 | DCR3H label $001d ; PWM 3 Duty Cycle Register High |
||
115 | DCR3L label $001e ; PWM 3 Duty Cycle Register Low |
||
116 | ATICRH label $001f ; Input Capture Register High |
||
117 | ATICRL label $0020 ; Input Capture Register Low |
||
118 | TRANCR label $0021 ; Transfer Control Register |
||
119 | TRAN bit TRANCR,0 ; Transfer enable |
||
120 | BREAKCR label $0022 ; Break Control Register |
||
121 | PWM bfield BREAKCR,0,4 ; Break Pattern bits |
||
122 | BA bit BREAKCR,5 ; Break Active |
||
123 | BPEN bit BREAKCR,4 ; Break Pin Enable |
||
124 | |||
125 | ;---------------------------------------------------------------------------- |
||
126 | ; Watchdog |
||
127 | |||
128 | WDGCR label $002e ; Watchdog Control Register |
||
129 | WDGA bit WDGCR,7 ; Activation bit |
||
130 | |||
131 | ;---------------------------------------------------------------------------- |
||
132 | ; Flash |
||
133 | |||
134 | FCSR label $002f ; Flash Control/Status Register |
||
135 | |||
136 | ;---------------------------------------------------------------------------- |
||
137 | ; EEPROM |
||
138 | |||
139 | ifdef EESTART |
||
140 | EECSR label $0030 ; Data EEPROM Control/Status Register |
||
141 | E2LAT bit EECSR,1 ; Latch Access Transfer |
||
142 | E2PGM bit EECSR,0 ; Programming control and status |
||
143 | endif |
||
144 | |||
145 | ;---------------------------------------------------------------------------- |
||
146 | ; SPI |
||
147 | |||
148 | include "spi2.inc" |
||
149 | __defspi $0031 |
||
150 | |||
151 | ;---------------------------------------------------------------------------- |
||
152 | ; Analog/Digital Converter |
||
153 | |||
154 | include "adc10.inc" |
||
155 | __defadc10 $0034 |
||
156 | |||
157 | ;---------------------------------------------------------------------------- |
||
158 | ; ITC |
||
159 | |||
160 | EICR label $0037 ; External Interrupt Control Register |
||
161 | IS3 bfield EICR,6,2 ; ei3 Sensitivity |
||
162 | IS2 bfield EICR,4,2 ; ei2 Sensitivity |
||
163 | IS1 bfield EICR,2,2 ; ei1 Sensitivity |
||
164 | IS0 bfield EICR,0,2 ; ei0 Sensitivity |
||
165 | EISR label $003c ; External Interrupt Selection Register |
||
166 | EI3 bfield EISR,6,2 ; ei3 Pin Selection |
||
167 | EI2 bfield EISR,4,2 ; ei2 Pin Selection |
||
168 | EI1 bfield EISR,2,2 ; ei1 Pin Selection |
||
169 | EI0 bfield EISR,0,2 ; ei0 Pin Selection |
||
170 | |||
171 | ;---------------------------------------------------------------------------- |
||
172 | ; MCC |
||
173 | |||
174 | MCCSR label $0038 ; Main Clock Control / Status Register |
||
175 | MCO bit MCCSR,1 ; Main Clock Out Enable Bit |
||
176 | SMS bit MCCSR,0 ; Slow Mode Selection Bit |
||
177 | |||
178 | ;---------------------------------------------------------------------------- |
||
179 | ; RC Calibration |
||
180 | |||
181 | RCCR label $0039 ; RC Calibration Control/Status Register |
||
182 | SICSR label $003a ; System Integrity Control/Status Register |
||
183 | LOCK32 bit SICSR,7 ; PLL 32Mhz Locked Flag |
||
184 | WDGRF bit SICSR,4 ; Watchdog Reset Flag |
||
185 | LOCKED bit SICSR,3 ; PLL Locked Flag |
||
186 | LVDRF bit SICSR,2 ; LVD Reset Flag |
||
187 | AVDF bit SICSR,1 ; Voltage Detector Flag |
||
188 | AVDIE bit SICSR,0 ; Voltage Detector Interrupt Enable |
||
189 | |||
190 | ;---------------------------------------------------------------------------- |
||
191 | ; Auto Wakeup Unit |
||
192 | |||
193 | AWUPR label $0049 ; AWU Preload Register |
||
194 | AWUCSR label $004a ; AWU Control/Status Register |
||
195 | AWUF bit AWUCSR,2 ; Auto Wakeup Flag |
||
196 | AWUM bit AWUCSR,1 ; Auto Wakeup Measurement Bit |
||
197 | AWUEN bit AWUCSR,0 ; Auto Wakeup From Halt Enabled Bit |
||
198 | |||
199 | ;---------------------------------------------------------------------------- |
||
200 | ; Debug Module |
||
201 | |||
202 | include "dm.inc" |
||
203 | __defdm $004b |
||
204 | |||
205 | restore |
||
206 | endif ; __reglit2xinc |