/*! ******************************************************************************* ** ** \file gd_int.h ** ** \brief INT (interrupt) driver ** ** This driver provides functions and structures required to ** access the GK6202 interrupt engine. ** ** Copyright: 2012 - 2013 (C) GoKe Microelectronics ShangHai Branch ** ** \attention THIS SAMPLE CODE IS PROVIDED AS IS. GOKE MICROELECTRONICS ** ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR ** OMMISSIONS. ** ** \version ** ******************************************************************************/ #ifndef GD_INT_H #define GD_INT_H #include #include #define GD_VIC_INSTANCES 2 #define GD_INT_VEC_OFFSET 32 /*---------------------------------------------------------------------------*/ /* constants and macros */ /*---------------------------------------------------------------------------*/ #define GD_INT_ERR_BASE (GD_INT_MODULE_ID<<16) //!< The INT base error code. /*! ******************************************************************************* ** ** \anchor int_defines ** \name interrupt driver specific macros ** ** This section defines various macros required to control interrupts. ** ******************************************************************************/ /*@{*/ #define GD_INT_NO_INVERT_IRQ 0 //!< The IRQ signal is not inverted. #define GD_INT_INVERT_IRQ 1 //!< The IRQ signal is inverted. #define GD_INT_LOW_PRIORITY 0 //!< Fast Interrupt Request (FIQ) for fast, low latency interrupt handling #define GD_INT_MID_PRIORITY 1 //!< Interrupt Request (IRQ) for more general interrupts #define GD_INT_DISABLED 0 //!< Interrupts are disabled. #define GD_INT_ENABLED 1 //!< Interrupts are enabled. /*@}*/ #define GD_INT_RISING_EDGE 0 #define GD_INT_FALLING_EDGE 1 #define GD_INT_BOTH_EDGES 2 #define GD_INT_LEVEL_LOW 3 #define GD_INT_LEVEL_HIGH 4 /*! ******************************************************************************* ** ** \brief Interrupt vectors ** ** The list below describes all available interrupt sources, ** a table containing the real interrupt service routines can ** be stored in the ARC aux. register 0x0203. ** ** The first three interrupt vectors are non-maskable, their ** priorty is high. ** All other interrupts are maskable and the priority can be set ** either to medium (1) or low (2). ** ******************************************************************************/ enum { GD_INT_RESERVED1_00_IRQ = 0, //!< GD_INT_ETH_IRQ = 1, //!< level, Ethernet 1 GD_INT_IDSP_ERROR_IRQ = 2, //!< edge, iDSP error GD_INT_XIU_TIMEOUT_IRQ = 3, //!< edge GD_INT_RESERVED1_04_IRQ = 4, //!< GD_INT_RESERVED1_05_IRQ = 5, //!< GD_INT_RESERVED1_06_IRQ = 6, //!< GD_INT_CODING_ORC_VOUT1_IRQ =7, //!< edge, Coding Orc VOUT1 GD_INT_SD_CONTROLLER_IRQ = 8, //!< level, SD controller GD_INT_IDC_IRQ = 9, //!< level, i2c read/write, I2C0 GD_INT_SSI_SPI_IRQ = 10, //!< level, Synchronous Serial Interface (SSI, SPI) GD_INT_WDT_IRQ = 11, //!< edge, Watchdog (WDT) GD_INT_RESERVED1_12_IRQ = 12, //!< GD_INT_SD2_CARD_DETECT_IRQ = 13, //!< GD_INT_SD_CARD_DETECT_IRQ = 14, //!< Both edges, SD card detect (state of SMIO5 pin) GD_INT_UART1_IRQ = 15, //!< level, uart read/write, UART1 GD_INT_GPIO0_IRQ = 16, //!< level, GPIO0 GD_INT_RESERVED1_17_IRQ = 17, //!< level, UART2 GD_INT_TIMER1_IRQ = 18, //!< edge, timer#1 GD_INT_TIMER2_IRQ = 19, //!< edge, timer#2 GD_INT_TIMER3_IRQ = 20, //!< edge, timer#3 GD_INT_DMA_IRQ = 21, //!< level, DMA GD_INT_SD2_CONTROLLER_IRQ = 22, //!< level, SD2 controller GD_INT_RESERVED1_23_IRQ = 23, //!< GD_INT_CODING_ORC_VIN_IRQ = 24, //!< edge, Coding Orc VIN GD_INT_CORDING_ORC_VDSP_IRQ = 25, //!< edge, Cording Orc vDSP GD_INT_USB_IRQ = 26, //!< level, USB GD_INT_UART2_IRQ = 27, //!< GD_INT_RESERVED1_28_IRQ = 28, //!< GD_INT_AUDIO_I2S_TX_IRQ = 29, //!< level, Audio (I2S) TX GD_INT_AUDIO_I2S_RX_IRQ = 30, //!< level, Audio (I2S) RX GD_INT_UART_IRQ = 31, //!< level, UART0 #if (GD_VIC_INSTANCES >= 2) GD_INT_RESERVED2_00_IRQ = ( 0 + 32), //!< GD_INT_RESERVED2_01_IRQ = ( 1 + 32), //!< GD_INT_RESERVED2_02_IRQ = ( 2 + 32), //!< GD_INT_RESERVED2_03_IRQ = ( 3 + 32), //!< GD_INT_RESERVED2_04_IRQ = ( 4 + 32), //!< GD_INT_RESERVED2_05_IRQ = ( 5 + 32), //!< GD_INT_RESERVED2_06_IRQ = ( 6 + 32), //!< GD_INT_RESERVED2_07_IRQ = ( 7 + 32), //!< GD_INT_AUDIO_PHY_TX_IRQ = ( 8 + 32), //!