AT91SAM9261的LINUX2.6 GPIO与GPIO中断

关于LINUX对926X中断的实现(LINUX2.6.24中试用)
一,926X中断的描述
对于926X有先进中断控制器控制中断具体对应的中断有0~310为FIQ,1为系统,2~31对应设备.见DATASHEET
二,926X中断的LINUX实现
1,PIO的输入中断问题,手册描述了
PIOA         2
PIOB         3
PIOC         4
LINUX中AT91SAM926X.H定义了所有的中断分配号:
*
* Peripheral identifiers/interrupts.
*/
#define AT91_ID_FIQ             0       /* Advanced Interrupt Controller (FIQ) */
#define AT91_ID_SYS             1       /* System Peripherals */
#define AT91SAM9260_ID_PIOA     2       /* Parallel IO Controller A */
#define AT91SAM9260_ID_PIOB     3       /* Parallel IO Controller B */
#define AT91SAM9260_ID_PIOC     4       /* Parallel IO Controller C */
#define AT91SAM9260_ID_ADC      5       /* Analog-to-Digital Converter */
#define AT91SAM9260_ID_US0      6       /* USART 0 */
#define AT91SAM9260_ID_US1      7       /* USART 1 */
#define AT91SAM9260_ID_US2      8       /* USART 2 */
#define AT91SAM9260_ID_MCI      9       /* Multimedia Card Interface */
#define AT91SAM9260_ID_UDP      10      /* USB Device Port */
#define AT91SAM9260_ID_TWI      11      /* Two-Wire Interface */
#define AT91SAM9260_ID_SPI0     12      /* Serial Peripheral Interface 0 */
#define AT91SAM9260_ID_SPI1     13      /* Serial Peripheral Interface 1 */
#define AT91SAM9260_ID_SSC      14      /* Serial Synchronous Controller */
#define AT91SAM9260_ID_TC0      17      /* Timer Counter 0 */
#define AT91SAM9260_ID_TC1      18      /* Timer Counter 1 */
#define AT91SAM9260_ID_TC2      19      /* Timer Counter 2 */
#define AT91SAM9260_ID_UHP      20      /* USB Host port */
#define AT91SAM9260_ID_EMAC     21      /* Ethernet */
#define AT91SAM9260_ID_ISI      22      /* Image Sensor Interface */
#define AT91SAM9260_ID_US3      23      /* USART 3 */
#define AT91SAM9260_ID_US4      24      /* USART 4 */
#define AT91SAM9260_ID_US5      25      /* USART 5 */
#define AT91SAM9260_ID_TC3      26      /* Timer Counter 3 */
#define AT91SAM9260_ID_TC4      27      /* Timer Counter 4 */
#define AT91SAM9260_ID_TC5      28      /* Timer Counter 5 */
#define AT91SAM9260_ID_IRQ0     29      /* Advanced Interrupt Controller (IRQ0) */
#define AT91SAM9260_ID_IRQ1     30      /* Advanced Interrupt Controller (IRQ1) */

LINUX中AT91SAM926X.C分配中断分配号到PIOA,PIOB,PIOC中:

static struct at91_gpio_bank at91sam9260_gpio[] = {
      {
            .id             = AT91SAM9260_ID_PIOA,
            .offset         = AT91_PIOA,
             .clock          = &pioA_clk,
},
      {
  .id             = AT91SAM9260_ID_PIOB,
               .offset         = AT91_PIOB,
               .clock          = &pioB_clk,
       },
{
               .id             = AT91SAM9260_ID_PIOC,
               .offset         = AT91_PIOC,
               .clock          = &pioC_clk,
       }
};

这里调用允许中断函数

At91_gpio_irq_setup();他的定义在gpio.c:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyjgyz.html