📄 lld_eic.c
字号:
/*____________________________________________________________________________| FILE: lld_eic.c| PROJECT: OS20_ACCORDO+| SW-COMPONENT: |_____________________________________________________________________________| DESCRIPTION: Eic functions|_____________________________________________________________________________| COPYRIGHT: (c) 2005 STMicroelectronics, Arzano (ITALY)| HISTORY:| Date | Modification | Author|_____________________________________________________________________________| $Date: 2007/05/02 12:32:16 $ | Initial revision | $Author: belardi $|____________________________________________________________________________*/#include "lld_eic.h"#include "interrup.h"#include "os_task_profiling.h"#ifdef __cplusplusextern "C" {#endif/************************************************************************|defines and macros (scope: module-local)|-----------------------------------------------------------------------*/#define INT_EN 1#define EIC_CHANNEL_NUM 32#define DEFAULT_ISR &DefaultISRRoutine#define CHANNEL_00 0 // IRQ_EXT0/IRQ_EXT1/IRQ_EXT2/IRQ_EXT3#define CHANNEL_01 1 // IRQ_EXT4/IRQ_EXT5/IRQ_EXT6/IRQ_EXT7#define CHANNEL_02 2 // IRQ_EXT8#define CHANNEL_03 3 // GND#define CHANNEL_04 4 // IRQ_WAKEUP#define CHANNEL_05 5 // IRQ_RCCU#define CHANNEL_06 6 // IRQ_BSPI#define CHANNEL_07 7 // IRQ_UART0#define CHANNEL_08 8 // IRQ_UART1#define CHANNEL_09 9 // IRQ_I2C0_ITDDC#define CHANNEL_10 10 // IRQ_I2C0_ITERR#define CHANNEL_11 11 // IRQ_I2C1_ITDDC#define CHANNEL_12 12 // IRQ_I2C1_ITERR#define CHANNEL_13 13 // GND#define CHANNEL_14 14 // GND#define CHANNEL_15 15 // IRQ_SRC_OFL or IRQ_SRC_UFL#define CHANNEL_16 16 // IRQ_SRC_DRF#define CHANNEL_17 17 // IRQ_SRC_DRE#define CHANNEL_18 18 // IRQ_DMA_INTR#define CHANNEL_19 19 // IRQ_DMA_INTR0#define CHANNEL_20 20 // IRQ_DMA_INTR1#define CHANNEL_21 21 // GND#define CHANNEL_22 22 // GND#define CHANNEL_23 23 // GND#define CHANNEL_24 24 // GND#define CHANNEL_25 25 // GND#define CHANNEL_26 26 // GND#define CHANNEL_27 27 // GND#define CHANNEL_28 28 // GND#define CHANNEL_29 29 // IRQ_EFT0#define CHANNEL_30 30 // IRQ_EFT1#define CHANNEL_31 31 // IRQ_WDGextern tVoid REENT_CONTEXT_RESTORE(void);//#define INT_INTERRUPT_RESTORE() REENT_CONTEXT_RESTORE()/************************************************************************|typedefs (scope: module-local)|-----------------------------------------------------------------------*/typedef struct { tU32 SIPL:4; tU32 RESERVED:12; tU32 SIV:16;} trSir;typedef struct{ tU32 IER_00:1; tU32 IER_01:1; tU32 IER_02:1; tU32 IER_03:1; tU32 IER_04:1; tU32 IER_05:1; tU32 IER_06:1; tU32 IER_07:1; tU32 IER_08:1; tU32 IER_09:1; tU32 IER_10:1; tU32 IER_11:1; tU32 IER_12:1; tU32 IER_13:1; tU32 IER_14:1; tU32 IER_15:1; tU32 IER_16:1; tU32 IER_17:1; tU32 IER_18:1; tU32 IER_19:1; tU32 IER_20:1; tU32 IER_21:1; tU32 IER_22:1; tU32 IER_23:1; tU32 IER_24:1; tU32 IER_25:1; tU32 IER_26:1; tU32 IER_27:1; tU32 IER_28:1; tU32 IER_29:1; tU32 IER_30:1; tU32 IER_31:1;} IER0Ty;/* WORD(32) access */typedef struct rEic{ struct { tU32 IRQ_EN:1; tU32 FIQ_EN:1; tU32 RESERVED:30; } ICR; /* addr offset = 0x0 */ struct { tU32 CIC:5; tU32 RESERVED:27; } CICR; /* addr offset = 0x4 */ struct { tU32 CIP:4; tU32 RESERVED:28; } CIPR; /* addr offset = 0x8 */ gap(6); struct { tU32 JUMP_OFFSET:16; tU32 JUMP_INSTR:16; } IVR; /* addr offset = 0x18 */ struct { tU32 FIE:2; tU32 FIP:2; tU32 RESERVED:28; } FIR; /* addr offset = 0x1C*/ IER0Ty IER0; /* addr offset = 0x20 */ gap(14); struct { tU32 IPR_00:1; tU32 IPR_01:1; tU32 IPR_02:1; tU32 IPR_03:1; tU32 IPR_04:1; tU32 IPR_05:1; tU32 IPR_06:1; tU32 IPR_07:1; tU32 IPR_08:1; tU32 IPR_09:1; tU32 IPR_10:1; tU32 IPR_11:1; tU32 IPR_12:1; tU32 IPR_13:1; tU32 IPR_14:1; tU32 IPR_15:1; tU32 IPR_16:1; tU32 IPR_17:1; tU32 IPR_18:1; tU32 IPR_19:1; tU32 IPR_20:1; tU32 IPR_21:1; tU32 IPR_22:1; tU32 IPR_23:1; tU32 IPR_24:1; tU32 IPR_25:1; tU32 IPR_26:1; tU32 IPR_27:1; tU32 IPR_28:1; tU32 IPR_29:1; tU32 IPR_30:1; tU32 IPR_31:1; } IPR0; /* addr offset = 0x40 */ gap(14); trSir rSIR[32]; /* addr offset = 0x60 + 4*(0<=k<=31) */} rEic;typedef struct { unsigned int R0; unsigned int R1; unsigned int R2; unsigned int R3; unsigned int R4; unsigned int R5; unsigned int R6; unsigned int R7; unsigned int R8; unsigned int R9; unsigned int R10; unsigned int R11; unsigned int R12; unsigned int StackPointer; unsigned int InstrAddress; unsigned int ExceptedModePSR; unsigned int ExceptionModePSR; } Exception_t;tVoid DefaultISRRoutine (void);/************************************************************************| variable definition (scope: global)|-----------------------------------------------------------------------*//************************************************************************| variable definition (scope: module-local)|-----------------------------------------------------------------------*//* Place Eic pheripheral according to scatter file */#pragma arm section zidata = "Eic_map" volatile rEic Eic; #pragma arm section zidata/* here the temporary already sorted Exception Information is stored by Assembler Handler */Exception_t ExceptionData = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};DevISRInfo ISRInfoVect[EIC_CHANNEL_NUM]={ DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR, DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR,DEFAULT_ISR};void DefaultISRRoutine (void) {}/************************************************************************|function prototype (scope: module-local)|-----------------------------------------------------------------------*///static void NotUsedChannel (void);/************************************************************************|function implementation (scope: module-local)|-----------------------------------------------------------------------*//************************************************************************* ** FUNCTION ** ** NotUsedChannel ** ** DESCRIPTION ** Stub function to init interrupt handler pointer ** ** CALLS ** ** None ** ** INPUTS ** ** None ** ** OUTPUTS ** ** None *************************************************************************///static void NotUsedChannel (void) {}/************************************************************************|function prototype (scope: IRQ)|-----------------------------------------------------------------------*//************************************************************************* ** FUNCTIONS ** ISR_HandlerServe ** ** DESCRIPTION ** ISR routines simply calling interrupt handler pointer ** ** CALLS ** None ** ** INPUTS ** None ** ** OUTPUTS ** None ** *************************************************************************/// [RB] this function contains __asm instructions which cannot// be compiled in Thumb mode#pragma PUSH#pragma ARM
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -