FreeCalypso > hg > freecalypso-sw
comparison nuc-fw/bsp/inth.h @ 109:91460c8957f0
nuc-fw/bsp: beginning of reconciliation with the Leonardo semi-src version
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 19 Oct 2013 18:59:34 +0000 |
parents | 45911ad957fd |
children |
comparison
equal
deleted
inserted
replaced
108:3b9cc76f2073 | 109:91460c8957f0 |
---|---|
14 | 14 |
15 Project : drivers | 15 Project : drivers |
16 | 16 |
17 Author : pmonteil@tif.ti.com Patrice Monteil. | 17 Author : pmonteil@tif.ti.com Patrice Monteil. |
18 | 18 |
19 Version number : 1.10 | 19 Version number : 1.17 |
20 | 20 |
21 Date and time : 01/30/01 10:22:23 | 21 Date : 09/02/03 |
22 | 22 |
23 Previous delta : 01/22/01 10:32:33 | 23 Previous delta : 01/22/01 10:32:33 |
24 | 24 |
25 SCCS file : /db/gsm_asp/db_ht96/dsp_0/gsw/rel_0/mcu_l1/release_gprs/RELEASE_GPRS/drivers1/common/SCCS/s.inth.h | 25 SCCS file : /db/gsm_asp/db_ht96/dsp_0/gsw/rel_0/mcu_l1/release_gprs/RELEASE_GPRS/drivers1/common/SCCS/s.inth.h |
26 | 26 |
30 *****************************************************************************/ | 30 *****************************************************************************/ |
31 | 31 |
32 #include "../include/config.h" | 32 #include "../include/config.h" |
33 #include "../include/sys_types.h" | 33 #include "../include/sys_types.h" |
34 | 34 |
35 #if (CHIPSET != 12) | |
36 | |
35 /* Adress of the registers */ | 37 /* Adress of the registers */ |
36 | 38 |
37 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9)|| (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 39 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9)|| (CHIPSET == 10) || (CHIPSET == 11)) |
38 #define INTH_IT_REG1 MEM_INTH_ADDR /* INTH IT register 1 */ | 40 #define INTH_IT_REG1 MEM_INTH_ADDR /* INTH IT register 1 */ |
39 #define INTH_IT_REG2 (MEM_INTH_ADDR + 0x02) /* INTH IT register 2 */ | 41 #define INTH_IT_REG2 (MEM_INTH_ADDR + 0x02) /* INTH IT register 2 */ |
40 #define INTH_MASK_REG1 (MEM_INTH_ADDR + 0x08) /* INTH mask register 1 */ | 42 #define INTH_MASK_REG1 (MEM_INTH_ADDR + 0x08) /* INTH mask register 1 */ |
41 #define INTH_MASK_REG2 (MEM_INTH_ADDR + 0x0a) /* INTH mask register 2 */ | 43 #define INTH_MASK_REG2 (MEM_INTH_ADDR + 0x0a) /* INTH mask register 2 */ |
42 #define INTH_B_IRQ_REG (MEM_INTH_ADDR + 0x10) /* INTH source binary IRQ reg. */ | 44 #define INTH_B_IRQ_REG (MEM_INTH_ADDR + 0x10) /* INTH source binary IRQ reg. */ |
63 #define INTH_LEAD 15 /* number of the LEAD int. */ | 65 #define INTH_LEAD 15 /* number of the LEAD int. */ |
64 | 66 |
65 /* Bit definition of INTH interrupt level registers */ | 67 /* Bit definition of INTH interrupt level registers */ |
66 | 68 |
67 #define INTH_FIQ_NIRQ 0x0001 | 69 #define INTH_FIQ_NIRQ 0x0001 |
68 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 70 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
69 #define INTH_PRIORITY 0x007c | 71 #define INTH_PRIORITY 0x007c |
70 #define INTH_EDGE_NLVL 0x0002 | 72 #define INTH_EDGE_NLVL 0x0002 |
71 #else | 73 #else |
72 #define INTH_PRIORITY 0x001e | 74 #define INTH_PRIORITY 0x001e |
73 #define INTH_EDGE_NLVL 0x0020 | 75 #define INTH_EDGE_NLVL 0x0020 |
74 #endif | 76 #endif |
75 | 77 |
76 | 78 |
77 /* Bit definition of INTH source binary registers */ | 79 /* Bit definition of INTH source binary registers */ |
78 | 80 |
79 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 81 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
80 #define INTH_SRC_NUM 0x001f | 82 #define INTH_SRC_NUM 0x001f |
81 #else | 83 #else |
82 #define INTH_SRC_NUM 0x000f | 84 #define INTH_SRC_NUM 0x000f |
83 #endif | 85 #endif |
84 | 86 |
107 /*--------------------------------------------------------------*/ | 109 /*--------------------------------------------------------------*/ |
108 /* Parameters : num of the IT to enable */ | 110 /* Parameters : num of the IT to enable */ |
109 /* Return : none */ | 111 /* Return : none */ |
110 /* Functionality : Unmask one it */ | 112 /* Functionality : Unmask one it */ |
111 /*--------------------------------------------------------------*/ | 113 /*--------------------------------------------------------------*/ |
112 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 114 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
113 #define INTH_ENABLEONEIT(it)( \ | 115 #define INTH_ENABLEONEIT(it)( \ |
114 (it < 16) ? (* (volatile unsigned short *) INTH_MASK_REG1 &= ~(1 << it)) : \ | 116 (it < 16) ? (* (volatile unsigned short *) INTH_MASK_REG1 &= ~(1 << it)) : \ |
115 (* (volatile unsigned short *) INTH_MASK_REG2 &= ~(1 << (it-16))) \ | 117 (* (volatile unsigned short *) INTH_MASK_REG2 &= ~(1 << (it-16))) \ |
116 ) | 118 ) |
117 #else | 119 #else |
123 /*--------------------------------------------------------------*/ | 125 /*--------------------------------------------------------------*/ |
124 /* Parameters : num of the IT to disable */ | 126 /* Parameters : num of the IT to disable */ |
125 /* Return : none */ | 127 /* Return : none */ |
126 /* Functionality : mask one it */ | 128 /* Functionality : mask one it */ |
127 /*--------------------------------------------------------------*/ | 129 /*--------------------------------------------------------------*/ |
128 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 130 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
129 #define INTH_DISABLEONEIT(it)( \ | 131 #define INTH_DISABLEONEIT(it)( \ |
130 (it < 16) ? (* (volatile unsigned short *) INTH_MASK_REG1 |= (1 << it)) : \ | 132 (it < 16) ? (* (volatile unsigned short *) INTH_MASK_REG1 |= (1 << it)) : \ |
131 (* (volatile unsigned short *) INTH_MASK_REG2 |= (1 << (it-16))) \ | 133 (* (volatile unsigned short *) INTH_MASK_REG2 |= (1 << (it-16))) \ |
132 ) | 134 ) |
133 #else | 135 #else |
140 /* Parameters : none */ | 142 /* Parameters : none */ |
141 /* Return : none */ | 143 /* Return : none */ |
142 /* Functionality : Enable all it */ | 144 /* Functionality : Enable all it */ |
143 /*--------------------------------------------------------------*/ | 145 /*--------------------------------------------------------------*/ |
144 | 146 |
145 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 147 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
146 #define INTH_ENABLEALLIT { \ | 148 #define INTH_ENABLEALLIT { \ |
147 * (volatile unsigned short *) INTH_MASK_REG1 = 0x0000; \ | 149 * (volatile unsigned short *) INTH_MASK_REG1 = 0x0000; \ |
148 * (volatile unsigned short *) INTH_MASK_REG2 = 0x0000; \ | 150 * (volatile unsigned short *) INTH_MASK_REG2 = 0x0000; \ |
149 } | 151 } |
150 #else | 152 #else |
172 #elif (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) | 174 #elif (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) |
173 #define INTH_DISABLEALLIT { \ | 175 #define INTH_DISABLEALLIT { \ |
174 * (volatile unsigned short *) INTH_MASK_REG1 = 0xffff; \ | 176 * (volatile unsigned short *) INTH_MASK_REG1 = 0xffff; \ |
175 * (volatile unsigned short *) INTH_MASK_REG2 = 0xffff; \ | 177 * (volatile unsigned short *) INTH_MASK_REG2 = 0xffff; \ |
176 } | 178 } |
177 #elif (CHIPSET == 12) | |
178 #define INTH_DISABLEALLIT { \ | |
179 * (volatile unsigned short *) INTH_MASK_REG1 = 0xffff; \ | |
180 * (volatile unsigned short *) INTH_MASK_REG2 = 0xffff; \ | |
181 } | |
182 #else | 179 #else |
183 #define INTH_DISABLEALLIT (* (volatile unsigned short *) INTH_MASK_REG = 0xffff) | 180 #define INTH_DISABLEALLIT (* (volatile unsigned short *) INTH_MASK_REG = 0xffff) |
184 #endif | 181 #endif |
185 | 182 |
183 | |
186 /*--------------------------------------------------------------*/ | 184 /*--------------------------------------------------------------*/ |
187 /* INTH_CLEAR() */ | 185 /* INTH_CLEAR() */ |
188 /*--------------------------------------------------------------*/ | 186 /*--------------------------------------------------------------*/ |
189 /* Parameters : value to write */ | 187 /* Parameters : value to write */ |
190 /* Return : none */ | 188 /* Return : none */ |
191 /* Functionality :valid next it */ | 189 /* Functionality :valid next it */ |
192 /*--------------------------------------------------------------*/ | 190 /*--------------------------------------------------------------*/ |
193 | 191 |
192 | |
194 #define INTH_CLEAR (* (volatile SYS_UWORD16 *) INTH_CTRL_REG = 0x0003) | 193 #define INTH_CLEAR (* (volatile SYS_UWORD16 *) INTH_CTRL_REG = 0x0003) |
195 | 194 |
196 | 195 |
197 /*--------------------------------------------------------------*/ | 196 /*--------------------------------------------------------------*/ |
198 /* INTH_VALIDNEXT() */ | 197 /* INTH_VALIDNEXT() */ |
202 /* Functionality :valid next it */ | 201 /* Functionality :valid next it */ |
203 /*--------------------------------------------------------------*/ | 202 /*--------------------------------------------------------------*/ |
204 | 203 |
205 #define INTH_VALIDNEXT (intARM)( * (volatile SYS_UWORD16 *) INTH_CTRL_REG |= (1 << intARM)) | 204 #define INTH_VALIDNEXT (intARM)( * (volatile SYS_UWORD16 *) INTH_CTRL_REG |= (1 << intARM)) |
206 | 205 |
207 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 206 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
208 /*--------------------------------------------------------------*/ | 207 /*--------------------------------------------------------------*/ |
209 /* INTH_RESETALLIT() */ | 208 /* INTH_RESETALLIT() */ |
210 /*--------------------------------------------------------------*/ | 209 /*--------------------------------------------------------------*/ |
211 /* Parameters : None */ | 210 /* Parameters : None */ |
212 /* Return : none */ | 211 /* Return : None */ |
213 /* Functionality :Reset the inth it register */ | 212 /* Functionality :Reset the inth it register */ |
214 /*--------------------------------------------------------------*/ | 213 /*--------------------------------------------------------------*/ |
215 | 214 |
216 #define INTH_RESETALLIT { \ | 215 #define INTH_RESETALLIT { \ |
217 * (volatile unsigned short *) INTH_IT_REG1 &= 0x0000; \ | 216 * (volatile unsigned short *) INTH_IT_REG1 &= 0x0000; \ |
218 * (volatile unsigned short *) INTH_IT_REG2 &= 0x0000; \ | 217 * (volatile unsigned short *) INTH_IT_REG2 &= 0x0000; \ |
219 } | 218 } |
220 #endif | 219 #endif |
221 | 220 |
221 | |
222 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) | |
223 /*-------------------------------------------------------------*/ | |
224 /* INTH_RESETONEIT() */ | |
225 /*-------------------------------------------------------------*/ | |
226 /* Parameters : Num of the IT to reset */ | |
227 /* Return : None */ | |
228 /* Functionality : Reset one IT of the inth IT register */ | |
229 /*-------------------------------------------------------------*/ | |
230 #define INTH_RESETONEIT(it) ( \ | |
231 (it<16) ? (* (volatile unsigned short *) INTH_IT_REG1 &= ~(1 << it)) : \ | |
232 (* (volatile unsigned short *) INTH_IT_REG2 &= ~(1 << (it-16))) \ | |
233 ) | |
234 #else // CHIPSET == 2,3 | |
235 #define INTH_RESETONEIT(it) (* (volatile unsigned short *) INTH_IT_REG &= ~(1 << it)) | |
236 #endif // CHIPSET | |
237 | |
222 /* Prototypes */ | 238 /* Prototypes */ |
223 | 239 |
224 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 240 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
225 unsigned long INTH_GetPending (void); | 241 unsigned long INTH_GetPending (void); |
226 unsigned long INTH_ResetIT (void); | 242 unsigned long INTH_ResetIT (void); |
227 #else | 243 #else |
228 unsigned short INTH_GetPending (void); | 244 unsigned short INTH_GetPending (void); |
229 unsigned short INTH_ResetIT (void); | 245 unsigned short INTH_ResetIT (void); |
230 #endif | 246 #endif |
231 | 247 |
232 unsigned short INTH_Ack (int); | 248 unsigned short INTH_Ack (int); |
233 void INTH_InitLevel (int, int, int, int); | 249 void INTH_InitLevel (int, int, int, int); |
250 | |
251 | |
252 #endif /* endif chipset != 12 */ | |
253 |