comparison nuc-fw/bsp/niq32.c @ 113:3b2e941043d8

nuc-fw/bsp: niq32.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 20 Oct 2013 21:12:41 +0000
parents 4179acab05f7
children 789a9a95533f
comparison
equal deleted inserted replaced
112:4179acab05f7 113:3b2e941043d8
22 22
23 Previous delta : 12/19/00 14:24:51 23 Previous delta : 12/19/00 14:24:51
24 24
25 *******************************************************************************/ 25 *******************************************************************************/
26 26
27 #include "l1sw.cfg" 27 #include "../include/config.h"
28 28 #include "../include/sys_types.h"
29 #include "chipset.cfg" 29
30 #include "board.cfg" 30 #include "inth.h"
31 #include "rf.cfg" 31 #include "mem.h"
32 #include "swconfig.cfg" 32 #include "iq.h"
33 #include "ulpd.h"
34 #include "armio.h"
35
36 #if 0
37
38 /* original maze of includes */
33 39
34 #if(OP_L1_STANDALONE == 0) 40 #if(OP_L1_STANDALONE == 0)
35 #include "debug.cfg" 41 #include "debug.cfg"
36 #include "rv/rv_defined_swe.h" 42 #include "rv/rv_defined_swe.h"
37 #include "rtc/board/rtc_config.h" 43 #include "rtc/board/rtc_config.h"
94 #if (OP_L1_STANDALONE == 0) 100 #if (OP_L1_STANDALONE == 0)
95 #include "uart/uartfax.h" 101 #include "uart/uartfax.h"
96 #endif 102 #endif
97 #endif 103 #endif
98 104
105 /* end of original include maze */
106 #endif
107
99 /* External declaration */ 108 /* External declaration */
100 extern void GAUGING_Handler(void); 109 extern void GAUGING_Handler(void);
101 extern void TMT_Timer_Interrupt(void); 110 extern void TMT_Timer_Interrupt(void);
102 #if (OP_L1_STANDALONE == 1) 111 #if 0 //(OP_L1_STANDALONE == 1)
103 extern void TM_Timer1Handler(void); 112 extern void TM_Timer1Handler(void);
104 #endif 113 #endif
105 extern void kpd_key_handler(void); 114 extern void kpd_key_handler(void);
106 extern void TP_FrameIntHandler(void); 115 extern void TP_FrameIntHandler(void);
107 116
108 #if (OP_L1_STANDALONE == 0) 117 #if 1 //(OP_L1_STANDALONE == 0)
109 #if (defined RVM_MPM_SWE) 118 #if (defined RVM_MPM_SWE)
110 extern void MPM_InterruptHandler(void); 119 extern void MPM_InterruptHandler(void);
111 #endif 120 #endif
112 121
113 #if (TI_PROFILER == 1) 122 #if (TI_PROFILER == 1)
120 129
121 extern void RTC_GaugingHandler(void); 130 extern void RTC_GaugingHandler(void);
122 extern void RTC_ItTimerHandle(void); 131 extern void RTC_ItTimerHandle(void);
123 extern void RTC_ItAlarmHandle(void); 132 extern void RTC_ItAlarmHandle(void);
124 #endif 133 #endif
125
126
127 134
128 /* Global variables */ 135 /* Global variables */
129 unsigned IQ_TimerCount1; /* Used to check if timer is incrementing */ 136 unsigned IQ_TimerCount1; /* Used to check if timer is incrementing */
130 unsigned IQ_TimerCount2; /* Used to check if timer is incrementing */ 137 unsigned IQ_TimerCount2; /* Used to check if timer is incrementing */
131 unsigned IQ_TimerCount; /* Used to check if timer is incrementing */ 138 unsigned IQ_TimerCount; /* Used to check if timer is incrementing */
132 unsigned IQ_DummyCount; /* Used to check if dummy IT */ 139 unsigned IQ_DummyCount; /* Used to check if dummy IT */
133 unsigned IQ_FrameCount; /* Used to check if Frame IT TPU*/ 140 unsigned IQ_FrameCount; /* Used to check if Frame IT TPU*/
134 unsigned IQ_GsmTimerCount; /* Used to check if GSM Timer IT */ 141 unsigned IQ_GsmTimerCount; /* Used to check if GSM Timer IT */
135 142
136 143 /* FreeCalypso: the following interrupt handlers remain to be integrated */
137 #if (CHIPSET != 12) 144 #define SER_uart_modem_handler IQ_Dummy
145 #define SER_uart_irda_handler IQ_Dummy
146 #define SIM_IntHandler IQ_Dummy
147 #define SIM_CD_IntHandler IQ_Dummy
148
138 /*--------------------------------------------------------------*/ 149 /*--------------------------------------------------------------*/
139 /* irqHandlers */ 150 /* irqHandlers */
140 /*--------------------------------------------------------------*/ 151 /*--------------------------------------------------------------*/
141 /* Parameters :none */ 152 /* Parameters :none */
142 /* Return : none */ 153 /* Return : none */
150 IQ_TimerHandler1, /* timer 1 */ 161 IQ_TimerHandler1, /* timer 1 */
151 IQ_TimerHandler2, /* timer 2 */ 162 IQ_TimerHandler2, /* timer 2 */
152 IQ_Dummy, /* AIRQ 3 */ 163 IQ_Dummy, /* AIRQ 3 */
153 IQ_FrameHandler, /* TPU Frame It AIRQ 4 */ 164 IQ_FrameHandler, /* TPU Frame It AIRQ 4 */
154 IQ_Dummy, /* AIRQ 5 */ 165 IQ_Dummy, /* AIRQ 5 */
155 #if (OP_L1_STANDALONE == 0) 166 #if 1 //(OP_L1_STANDALONE == 0)
156 SIM_IntHandler, /* AIRQ 6 */ 167 SIM_IntHandler, /* AIRQ 6 */
157 #else 168 #else
158 IQ_Dummy, /* AIRQ 6 */ 169 IQ_Dummy, /* AIRQ 6 */
159 #endif 170 #endif
160 #if ((CHIPSET == 2) || (CHIPSET == 3)) 171 #if ((CHIPSET == 2) || (CHIPSET == 3))
161 SER_uart_handler, /* AIRQ 7 */ 172 SER_uart_handler, /* AIRQ 7 */
162 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) 173 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11))
163 SER_uart_modem_handler, /* AIRQ 7 */ 174 SER_uart_modem_handler, /* AIRQ 7 */
164 #endif 175 #endif
165 #if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41)) 176 #if 1 //((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41))
166 // CC test 0316 177 // CC test 0316
167 IQ_KeypadGPIOHandler, /* AIRQ 8 */ 178 IQ_KeypadGPIOHandler, /* AIRQ 8 */
168 // end 179 // end
169 #else 180 #else
170 IQ_KeypadHandler, /* AIRQ 8 */ 181 IQ_KeypadHandler, /* AIRQ 8 */
199 IQ_Dummy, /* Not mapped interrupt */ 210 IQ_Dummy, /* Not mapped interrupt */
200 IQ_Dummy, /* Not mapped interrupt */ 211 IQ_Dummy, /* Not mapped interrupt */
201 IQ_Dummy, /* Not mapped interrupt */ 212 IQ_Dummy, /* Not mapped interrupt */
202 IQ_Dummy /* GEA interrupt */ 213 IQ_Dummy /* GEA interrupt */
203 #elif ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11)) 214 #elif ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11))
204 #if (L1_DYN_DSP_DWNLD == 1) 215 #if 0 //(L1_DYN_DSP_DWNLD == 1)
205 IQ_ApiHandler, /* LEAD */ 216 IQ_ApiHandler, /* LEAD */
206 #else 217 #else
207 IQ_Dummy, /* LEAD */ 218 IQ_Dummy, /* LEAD */
208 #endif 219 #endif
209 IQ_Dummy, /* SIM card-detect fast interrupt */ 220 IQ_Dummy, /* SIM card-detect fast interrupt */
257 IQ_Dummy, /* AIRQ 11 ULPD GAUGING */ 268 IQ_Dummy, /* AIRQ 11 ULPD GAUGING */
258 IQ_Dummy, /* AIRQ 12 */ 269 IQ_Dummy, /* AIRQ 12 */
259 IQ_Dummy, /* AIRQ 13 Spi Tx Rx interrupt */ 270 IQ_Dummy, /* AIRQ 13 Spi Tx Rx interrupt */
260 IQ_Dummy, /* DMA interrupt */ 271 IQ_Dummy, /* DMA interrupt */
261 IQ_Dummy, /* LEAD */ 272 IQ_Dummy, /* LEAD */
262 #if (OP_L1_STANDALONE == 0) 273 #if 1 //(OP_L1_STANDALONE == 0)
263 SIM_CD_IntHandler, /* SIM card-detect fast interrupt */ 274 SIM_CD_IntHandler, /* SIM card-detect fast interrupt */
264 #else 275 #else
265 IQ_Dummy, /* SIM card-detect fast interrupt */ 276 IQ_Dummy, /* SIM card-detect fast interrupt */
266 #endif 277 #endif
267 IQ_Dummy, /* External fast interrupt */ 278 IQ_Dummy, /* External fast interrupt */
286 IQ_Dummy, /* Not mapped interrupt */ 297 IQ_Dummy, /* Not mapped interrupt */
287 IQ_Dummy /* Reserved */ 298 IQ_Dummy /* Reserved */
288 #endif 299 #endif
289 }; 300 };
290 #endif 301 #endif
291 #endif /* (CHIPSET != 12)*/
292 302
293 /*--------------------------------------------------------------*/ 303 /*--------------------------------------------------------------*/
294 /* IQ_Gauging_Handler */ 304 /* IQ_Gauging_Handler */
295 /*--------------------------------------------------------------*/ 305 /*--------------------------------------------------------------*/
296 /* Parameters :none */ 306 /* Parameters :none */
297 /* Return : none */ 307 /* Return : none */
298 /* Functionality : Handle unused interrupts */ 308 /* Functionality : Handle unused interrupts */
299 /*--------------------------------------------------------------*/ 309 /*--------------------------------------------------------------*/
300 void IQ_Gauging_Handler(void) 310 void IQ_Gauging_Handler(void)
301 { 311 {
312 #if 0
313 // FreeCalypso: code not integrated yet
302 GAUGING_Handler(); 314 GAUGING_Handler();
303 #if (OP_L1_STANDALONE == 0) 315 #if (OP_L1_STANDALONE == 0)
304 RTC_GaugingHandler(); 316 RTC_GaugingHandler();
317 #endif
305 #endif 318 #endif
306 } 319 }
307 320
308 321
309 /*--------------------------------------------------------------*/ 322 /*--------------------------------------------------------------*/
323 IQ_Mask(IQ_EXT); 336 IQ_Mask(IQ_EXT);
324 #endif 337 #endif
325 338
326 // The external IRQ is mapped on the ABB interrupt. 339 // The external IRQ is mapped on the ABB interrupt.
327 // The associated HISR ABB_Hisr is activated on reception on the external IRQ. 340 // The associated HISR ABB_Hisr is activated on reception on the external IRQ.
341 #if 0
342 // FreeCalypso: code not integrated yet
328 if(Activate_ABB_HISR()) 343 if(Activate_ABB_HISR())
329 { 344 {
330 #if (CHIPSET == 12) 345 #if (CHIPSET == 12)
331 F_INTH_ENABLE_ONE_IT(C_INTH_ABB_IRQ_IT); 346 F_INTH_ENABLE_ONE_IT(C_INTH_ABB_IRQ_IT);
332 #else 347 #else
333 // Mask external interrupt 12 348 // Mask external interrupt 12
334 IQ_Unmask(IQ_EXT); 349 IQ_Unmask(IQ_EXT);
335 #endif 350 #endif
336 } 351 }
337 } 352 #endif
338 353 }
339 #if (CHIPSET != 12) 354
340 /*--------------------------------------------------------------*/ 355 /*--------------------------------------------------------------*/
341 /* IQ_Dummy */ 356 /* IQ_Dummy */
342 /*--------------------------------------------------------------*/ 357 /*--------------------------------------------------------------*/
343 /* Parameters :none */ 358 /* Parameters :none */
344 /* Return : none */ 359 /* Return : none */
346 /*--------------------------------------------------------------*/ 361 /*--------------------------------------------------------------*/
347 void IQ_Dummy(void) 362 void IQ_Dummy(void)
348 { 363 {
349 IQ_DummyCount++; 364 IQ_DummyCount++;
350 } 365 }
351 #endif
352 366
353 /*--------------------------------------------------------------*/ 367 /*--------------------------------------------------------------*/
354 /* IQ_RTCHandler */ 368 /* IQ_RTCHandler */
355 /*--------------------------------------------------------------*/ 369 /*--------------------------------------------------------------*/
356 /* Parameters :none */ 370 /* Parameters :none */
358 /* Functionality : Handle RTC Time interrupts */ 372 /* Functionality : Handle RTC Time interrupts */
359 /*--------------------------------------------------------------*/ 373 /*--------------------------------------------------------------*/
360 374
361 void IQ_Rtc_Handler(void) 375 void IQ_Rtc_Handler(void)
362 { 376 {
363 #if (OP_L1_STANDALONE == 0) 377 #if 0 //(OP_L1_STANDALONE == 0)
364 RTC_ItTimerHandle(); 378 RTC_ItTimerHandle();
365 #endif 379 #endif
366 } 380 }
367 381
368 /*--------------------------------------------------------------*/ 382 /*--------------------------------------------------------------*/
374 /*--------------------------------------------------------------*/ 388 /*--------------------------------------------------------------*/
375 389
376 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) 390 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12))
377 void IQ_RtcA_Handler(void) 391 void IQ_RtcA_Handler(void)
378 { 392 {
379 #if (OP_L1_STANDALONE == 0) 393 #if 0 //(OP_L1_STANDALONE == 0)
380 /* INTH_DISABLEONEIT(IQ_RTC_ALARM); *//* RTC ALARM IT */ 394 /* INTH_DISABLEONEIT(IQ_RTC_ALARM); *//* RTC ALARM IT */
381 if ( (* (SYS_WORD8 *) RTC_STATUS_REG) & RTC_ALARM ) 395 if ( (* (SYS_WORD8 *) RTC_STATUS_REG) & RTC_ALARM )
382 RTC_ItAlarmHandle(); 396 RTC_ItAlarmHandle();
383 #endif 397 #endif
384 } 398 }
385 399
386 void IQ_GsmTim_Handler(void) 400 void IQ_GsmTim_Handler(void)
387 { 401 {
388 402
389 if ( (* (SYS_UWORD16 *) ULDP_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM ) 403 if ( (* (SYS_UWORD16 *) ULPD_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM )
390 { 404 {
391 // it is GSM Timer it..... 405 // it is GSM Timer it.....
392 IQ_GsmTimerCount++; 406 IQ_GsmTimerCount++;
393 } 407 }
394 } 408 }
395 #else 409 #else
396 void IQ_RtcA_GsmTim_Handler(void) 410 void IQ_RtcA_GsmTim_Handler(void)
397 { 411 {
398 #if (OP_L1_STANDALONE == 0) 412 #if (OP_L1_STANDALONE == 0)
399 if ( (* (SYS_UWORD16 *) ULDP_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM ) 413 if ( (* (SYS_UWORD16 *) ULPD_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM )
400 { 414 {
401 // it is GSM Timer it..... 415 // it is GSM Timer it.....
402 IQ_GsmTimerCount++; 416 IQ_GsmTimerCount++;
403 } 417 }
404 else 418 else
409 } 423 }
410 #endif 424 #endif
411 } 425 }
412 #endif 426 #endif
413 427
414 #if (BOARD == 34)
415 /*
416 * IQ_IcrHandler32
417 *
418 */
419 void IQ_IcrHandler32(void)
420 {
421 CSMI_InterruptHandler();
422 }
423 #endif
424
425 /*--------------------------------------------------------------*/ 428 /*--------------------------------------------------------------*/
426 /* IQ_TimerHandler */ 429 /* IQ_TimerHandler */
427 /*--------------------------------------------------------------*/ 430 /*--------------------------------------------------------------*/
428 /* Parameters :none */ 431 /* Parameters :none */
429 /* Return : none */ 432 /* Return : none */
431 /*--------------------------------------------------------------*/ 434 /*--------------------------------------------------------------*/
432 void IQ_TimerHandler(void) 435 void IQ_TimerHandler(void)
433 { 436 {
434 IQ_TimerCount++; 437 IQ_TimerCount++;
435 TMT_Timer_Interrupt(); 438 TMT_Timer_Interrupt();
436 #if (defined RVM_DAR_SWE) && (defined _GSM) 439 #if 0 //(defined RVM_DAR_SWE) && (defined _GSM)
437 dar_watchdog_reset(); 440 dar_watchdog_reset();
438 #endif 441 #endif
439 } 442 }
440 443
441 /*--------------------------------------------------------------*/ 444 /*--------------------------------------------------------------*/
447 /*--------------------------------------------------------------*/ 450 /*--------------------------------------------------------------*/
448 void IQ_FrameHandler(void) 451 void IQ_FrameHandler(void)
449 { 452 {
450 IQ_FrameCount++; 453 IQ_FrameCount++;
451 TMT_Timer_Interrupt(); 454 TMT_Timer_Interrupt();
455 #if 0
456 // FreeCalypso: that L1 or whatever code hasn't been integrated yet
452 TP_FrameIntHandler(); 457 TP_FrameIntHandler();
458 #endif
453 #if (OP_L1_STANDALONE == 0) 459 #if (OP_L1_STANDALONE == 0)
454 #if (TI_PROFILER == 1) 460 #if (TI_PROFILER == 1)
455 // TDMA treatment for profiling buffer 461 // TDMA treatment for profiling buffer
456 ti_profiler_tdma_action(); 462 ti_profiler_tdma_action();
457 #endif 463 #endif
482 /*--------------------------------------------------------------*/ 488 /*--------------------------------------------------------------*/
483 void IQ_TimerHandler2(void) 489 void IQ_TimerHandler2(void)
484 { 490 {
485 IQ_TimerCount2++; 491 IQ_TimerCount2++;
486 } 492 }
487 #if(L1_DYN_DSP_DWNLD == 1) 493
488 494 #if 0 //(L1_DYN_DSP_DWNLD == 1)
489 /*-------------------------------------------------------*/ 495 /*-------------------------------------------------------*/
490 /* IQ_ApiHandler() */ 496 /* IQ_ApiHandler() */
491 /*-------------------------------------------------------*/ 497 /*-------------------------------------------------------*/
492 /* Parameters : none */ 498 /* Parameters : none */
493 /* Return : none */ 499 /* Return : none */
498 l1_api_handler(); 504 l1_api_handler();
499 } /* IQ_ApiHandler() */ 505 } /* IQ_ApiHandler() */
500 #endif 506 #endif
501 507
502 508
503 #if (CHIPSET !=12)
504 /*--------------------------------------------------------------*/ 509 /*--------------------------------------------------------------*/
505 /* IQ_IRQ_isr */ 510 /* IQ_IRQ_isr */
506 /*--------------------------------------------------------------*/ 511 /*--------------------------------------------------------------*/
507 /* Parameters :none */ 512 /* Parameters :none */
508 /* Return : none */ 513 /* Return : none */
526 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) 531 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11))
527 fiqHandlers[((* (SYS_UWORD16 *) INTH_B_FIQ_REG) & INTH_SRC_NUM)](); /* ACK IT */ 532 fiqHandlers[((* (SYS_UWORD16 *) INTH_B_FIQ_REG) & INTH_SRC_NUM)](); /* ACK IT */
528 #endif 533 #endif
529 * (SYS_UWORD16 *) INTH_CTRL_REG |= (1 << INTH_FIQ); /* valid next FIQ */ 534 * (SYS_UWORD16 *) INTH_CTRL_REG |= (1 << INTH_FIQ); /* valid next FIQ */
530 } 535 }
531 #endif /* chipset != 12 ) */
532
533 #if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41))
534 536
535 /*--------------------------------------------------------------*/ 537 /*--------------------------------------------------------------*/
536 /* IQ_KeypadGPIOHandler */ 538 /* IQ_KeypadGPIOHandler */
537 /*--------------------------------------------------------------*/ 539 /*--------------------------------------------------------------*/
538 /* Parameters : none */ 540 /* Parameters : none */
546 // end 548 // end
547 549
548 void IQ_KeypadGPIOHandler(void) 550 void IQ_KeypadGPIOHandler(void)
549 { 551 {
550 552
551 #if (OP_L1_STANDALONE == 0) 553 #if 0 //(OP_L1_STANDALONE == 0)
552 /* 554 /*
553 * GPIO interrupt must be checked before the keypad interrupt. The GPIO 555 * GPIO interrupt must be checked before the keypad interrupt. The GPIO
554 * status bit is reset when the register is read. 556 * status bit is reset when the register is read.
555 */ 557 */
556 558
573 #else 575 #else
574 UAF_DTRInterruptHandler (); 576 UAF_DTRInterruptHandler ();
575 #endif 577 #endif
576 */ 578 */
577 } 579 }
578 if (AI_CheckITSource (ARMIO_KEYPDAD_INT)) 580 if (AI_CheckITSource (ARMIO_KEYPAD_INT))
579 { 581 {
580 // CC test 0316 582 // CC test 0316
581 //sprintf(debug_buffer, "Key_Interrupt"); 583 //sprintf(debug_buffer, "Key_Interrupt");
582 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID); 584 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID);
583 // end 585 // end
584 kpd_key_handler (); 586 kpd_key_handler ();
585 } 587 }
586 588
587 #endif 589 #endif
588 } 590 }
589
590 #elif ((BOARD == 34) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45))
591
592 /*--------------------------------------------------------------*/
593 /* IQ_KeypadHandler */
594 /*--------------------------------------------------------------*/
595 /* Parameters :none */
596 /* Return : none */
597 /* Functionality : Handle keypad interrupts */
598 /*--------------------------------------------------------------*/
599 void IQ_KeypadHandler(void)
600 {
601 #if (OP_L1_STANDALONE == 0)
602 #if (BOARD == 34)
603 IQ_Mask (IQ_ARMIO);
604 #else
605 kpd_key_handler ();
606 #endif
607 #endif
608 }
609
610 #endif