Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1186 | savelij | 1 | ifndef __reglit0xinc ; avoid multiple inclusion |
2 | __reglit0xinc equ 1 |
||
3 | |||
4 | save |
||
5 | listing off ; no listing over this file |
||
6 | |||
7 | ;**************************************************************************** |
||
8 | ;* * |
||
9 | ;* AS 1.42 - File REGLIT0X.INC * |
||
10 | ;* * |
||
11 | ;* contains SFR and Bit Definitions for ST7LITE0x * |
||
12 | ;* * |
||
13 | ;* Source: ST7LITE0xY0 Data Sheet, Rev. 6, November 2007 * |
||
14 | ;* * |
||
15 | ;**************************************************************************** |
||
16 | |||
17 | ;---------------------------------------------------------------------------- |
||
18 | ; Memory Addresses |
||
19 | |||
20 | RAMSTART label $0080 ; Start Address Internal RAM |
||
21 | RAMEND label $00ff ; End " " " |
||
22 | |||
23 | if SUBSTR(MOMCPUNAME,7,1)="S" |
||
24 | ROMSTART equ $fa00 |
||
25 | elseif |
||
26 | ROMSTART equ $fc00 |
||
27 | endif |
||
28 | |||
29 | switch SUBSTR(MOMCPUNAME,STRLEN(MOMCPUNAME)-3,1) |
||
30 | case "2" |
||
31 | __hasadc equ 0 |
||
32 | case "5" |
||
33 | __hasadc equ 1 |
||
34 | case "9" |
||
35 | __hasadc equ 1 |
||
36 | EESTART label $1000 |
||
37 | EEEND label $107f |
||
38 | elsecase |
||
39 | fatal "Huh?" |
||
40 | endcase |
||
41 | |||
42 | RCCR0 label $1000 ; RC Oscillator Calibration Values |
||
43 | RCCR1 label $1001 |
||
44 | |||
45 | ;---------------------------------------------------------------------------- |
||
46 | ; Interrupt Vectors |
||
47 | |||
48 | SPI_vect label $ffe2 ; SPI Interrupt |
||
49 | LT_RTC1vect label $ffe4 ; Lite Timer RTC1 Interrupt |
||
50 | LT_IC_vect label $ffe6 ; Lite Timer Input Capture Interrupt |
||
51 | AT_OF_vect label $ffe8 ; AT Timer Overflow 1 Interrupt |
||
52 | AT_OC_vect label $ffea ; AT Timer Output Compare Interrupt |
||
53 | SI_vect label $ffec ; AVD Interrupt |
||
54 | EI3_vect label $fff2 ; External Interrupt Vector EI3 |
||
55 | EI2_vect label $fff4 ; External Interrupt Vector EI2 |
||
56 | EI1_vect label $fff6 ; External Interrupt Vector EI1 |
||
57 | EI0_vect label $fff8 ; External Interrupt Vector EI0 |
||
58 | TRAP_vect label $fffc ; TRAP (software) Interrupt Vector |
||
59 | RESET_vect label $fffe ; RESET Vector |
||
60 | |||
61 | ;---------------------------------------------------------------------------- |
||
62 | ; GPIO |
||
63 | |||
64 | include "gpio.inc" |
||
65 | __defgpio "PA",$0000 |
||
66 | __defgpio "PB",$0003 |
||
67 | |||
68 | ;---------------------------------------------------------------------------- |
||
69 | ; Lite Timer |
||
70 | |||
71 | LTCSR label $000b ; Lite Timer Control/Status Register 2 |
||
72 | ICIE bit LTCSR,7 ; Input Capture Interrupt Enable |
||
73 | ICF bit LTCSR,6 ; Input Capture Flag |
||
74 | TB bit LTCSR,5 ; Timebase Period Selection |
||
75 | TBIE bit LTCSR,4 ; Timebase Interrupt Enable Bit |
||
76 | TBF bit LTCSR,3 ; Timebase Interrupt Flag |
||
77 | WDGR bit LTCSR,2 ; Force Reset/ Reset Status Flag |
||
78 | WDGE bit LTCSR,1 ; Watchdog Enable |
||
79 | WDGD bit LTCSR,0 ; Watchdog Reset Delay |
||
80 | LTICR label $000c ; Lite Timer Input Capture Register |
||
81 | |||
82 | ;---------------------------------------------------------------------------- |
||
83 | ; Auto-Reload Timer |
||
84 | |||
85 | ATCSR label $000d ; Timer Control/Status Register |
||
86 | CK bfield ATCSR,3,2 ; Counter Clock Selection |
||
87 | OVF bit ATCSR,2 ; Overflow Flag |
||
88 | OVFIE bit ATCSR,1 ; Overflow Interrupt Enable Bit |
||
89 | CMPIE bit ATCSR,0 ; Compare Interrupt Enable Bit |
||
90 | CNTRH label $000e ; Counter Register High |
||
91 | CNTRL label $000f ; Counter Register Low |
||
92 | ATRH label $0010 ; Auto-Reload Register 1 High |
||
93 | ATRL label $0011 ; Auto-Reload Register 1 Low |
||
94 | PWMCR label $0012 ; PWM Output Control Register |
||
95 | OE0 bit PWMCR,0 ; PWM0 Output Enable |
||
96 | PWM0CSR label $0013 ; PWM 0 Control/Status Register |
||
97 | OP0 bit PWM0CSR,1 ; PWM0 Output Polarity Bit |
||
98 | CMPF0 bit PWM0CSR,0 ; PWM0 Compare Flag |
||
99 | DCR0H label $0017 ; PWM 0 Duty Cycle Register High |
||
100 | DCR0L label $0018 ; PWM 0 Duty Cycle Register Low |
||
101 | |||
102 | ;---------------------------------------------------------------------------- |
||
103 | ; Flash |
||
104 | |||
105 | FCSR label $002f ; Flash Control/Status Register |
||
106 | OPT bit FCSR,2 |
||
107 | LAT bit FCSR,1 |
||
108 | PGM bit FCSR,0 |
||
109 | |||
110 | ;---------------------------------------------------------------------------- |
||
111 | ; EEPROM |
||
112 | |||
113 | ifdef EESTART |
||
114 | EECSR label $0030 ; Data EEPROM Control/Status Register |
||
115 | E2LAT bit EECSR,1 ; Latch Access Transfer |
||
116 | E2PGM bit EECSR,0 ; Programming Control and Status |
||
117 | endif |
||
118 | |||
119 | ;---------------------------------------------------------------------------- |
||
120 | ; SPI |
||
121 | |||
122 | include "spi2.inc" |
||
123 | __defspi $0031 |
||
124 | |||
125 | ;---------------------------------------------------------------------------- |
||
126 | ; Analog/Digital Converter |
||
127 | |||
128 | if __hasadc |
||
129 | ADCCSR label $0034 ; A/D Control Status Register |
||
130 | EOC bit ADCCSR,7 ; Conversion Complete |
||
131 | SPEED bit ADCCSR,6 ; ADC Clock Selection |
||
132 | ADON bit ADCCSR,5 ; A/D Converter and Amplifier On |
||
133 | CH bfield ADCCSR,0,3 ; Channel Selection |
||
134 | ADCDR label $0035 ; A/D Data Register |
||
135 | ADCAMP label $0036 ; A/D Amplifier Control Register |
||
136 | SLOW bit ADCAMP,3 ; Slow Mode |
||
137 | AMPSEL bit ADCAMP,2 ; Amplifier Selection Bit |
||
138 | endif |
||
139 | |||
140 | ;---------------------------------------------------------------------------- |
||
141 | ; ITC |
||
142 | |||
143 | EICR label $0037 ; External Interrupt Control Register |
||
144 | IS3 bfield EICR,6,2 ; ei3 Sensitivity |
||
145 | IS2 bfield EICR,4,2 ; ei2 Sensitivity |
||
146 | IS1 bfield EICR,2,2 ; ei1 Sensitivity |
||
147 | IS0 bfield EICR,0,2 ; ei0 Sensitivity |
||
148 | |||
149 | ;---------------------------------------------------------------------------- |
||
150 | ; CLOCKS |
||
151 | |||
152 | MCCSR label $0038 ; Main Clock Control / Status Register |
||
153 | MCO bit MCCSR,1 ; Main Clock Out Enable Bit |
||
154 | SMS bit MCCSR,0 ; Slow Mode Selection Bit |
||
155 | |||
156 | ;---------------------------------------------------------------------------- |
||
157 | ; RC Calibration |
||
158 | |||
159 | RCCR label $0039 ; RC Calibration Control/Status Register |
||
160 | CR bfield RCCR,0,8 ; RC Oscillator Frequency Adjustment Bits |
||
161 | |||
162 | ;---------------------------------------------------------------------------- |
||
163 | ; SI |
||
164 | |||
165 | SICSR label $003a ; System Integrity Control/Status Register |
||
166 | LOCKED bit SICSR,3 ; PLL Locked Flag |
||
167 | LVDRF bit SICSR,2 ; LVD Reset Flag |
||
168 | AVDF bit SICSR,1 ; Voltage Detector Flag |
||
169 | AVDIE bit SICSR,0 ; Voltage Detector Interrupt Enable |
||
170 | |||
171 | restore |
||
172 | endif ; __reglit0xinc |