?? net_isr.c
字號:
/*
*********************************************************************************************************
* uC/TCP-IP
* The Embedded TCP/IP Suite
*
* (c) Copyright 2003-2007; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
*
* uC/TCP-IP is provided in source form for FREE evaluation, for educational
* use or peaceful research. If you plan on using uC/TCP-IP in a commercial
* product you need to contact Micrium to properly license its use in your
* product. We provide ALL the source code for your convenience and to help
* you experience uC/TCP-IP. The fact that the source code is provided does
* NOT mean that you can use it without paying a licensing fee.
*
* Knowledge of the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE (BSP) FUNCTIONS
*
* TCP/IP STACK ISR SUPPORT FUNCTIONS
*
* Filename : net_isr.c
* Version : V1.89
* Programmer(s) : Jean-Denis Hatier
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
#include <net.h>
#include <reg_AT91RM9200.h>
/*
*********************************************************************************************************
* NETWORK INTERRUPT INITIALIZATION
*
* Description : This function is called to initialize the interrupt controller associated with the NIC.
*
* Arguments : None.
*********************************************************************************************************
*/
void NetNIC_IntInit (void)
{
/* AT91RM9200 is on interrupt #24. */
AIC_SVR_REG(24 * 4) = (CPU_INT32U)NetNIC_ISR_Handler; /* Setup the interrupt vector for the ethernet ISR. */
AIC_SMR_REG(24 * 4) = AT91C_AIC_PRIOR_HIGHEST | /* Level sensitive, low priority. */
AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE;
*AT91C_AIC_IECR = DEF_BIT_24; /* Enable ethernet interrupts at AIC level. */
}
/*
*********************************************************************************************************
* NETWORK INTERRUPT CLEAR
*
* Description : This function is called to clear the interrupt controller associated with the NIC.
*
* Arguments : None.
*********************************************************************************************************
*/
void NetNIC_IntClr (void)
{
/* AT91RM9200 is on interrupt #24. */
*AT91C_AIC_ICCR = DEF_BIT_24; /* Clear interrupt. */
}
/*
*********************************************************************************************************
* NETWORK INTERRUPT INITIALIZATION
*
* Description : This function is called to initialize the interrupt controller associated with the phyter.
*
* Arguments : None.
*********************************************************************************************************
*/
void NetNIC_PhyIntInit (void)
{
*AT91C_PMC_PCER = DEF_BIT_04; /* Enable PIO C Peripheral Clock. */
*AT91C_PIOC_PER = DEF_BIT_00; /* Controlled by PIO. */
*AT91C_PIOC_ODR = DEF_BIT_00; /* Input signal. */
*AT91C_PIOC_IFDR = DEF_BIT_00; /* Input unfiltered. */
*AT91C_PIOC_CODR = DEF_BIT_00; /* No output data. */
*AT91C_PIOC_MDDR = DEF_BIT_00; /* No multi-drive. */
*AT91C_PIOC_PPUER = DEF_BIT_00; /* Pull-up enable. */
*AT91C_PIOC_OWDR = DEF_BIT_00; /* No output to this line. */
*AT91C_PIOC_IER = DEF_BIT_00; /* Enable interrupt. */
/* BCM5221 is on PC0, which is on interrupt #4. */
/* Touch screen, CF card and SD card are also on the */
/* PIOC. The NetNIC_PhyISR_Handler() will need to */
/* demultiplex which PC pin triggered the interrupt */
/* Setup the interrupt vector for the phyter ISR. */
AIC_SVR_REG(4 * 4) = (CPU_INT32U)NetNIC_PhyISR_Handler;
AIC_SMR_REG(4 * 4) = AT91C_AIC_PRIOR_LOWEST; /* Low priority interrupt. */
*AT91C_AIC_IECR = DEF_BIT_04; /* Enable phyter interrupts at AIC level. */
}
/*
*********************************************************************************************************
* NETWORK INTERRUPT CLEAR
*
* Description : This function is called to clear the interrupt controller associated with the phyter.
*
* Arguments : None.
*********************************************************************************************************
*/
void NetNIC_PhyIntClr (void)
{
CPU_DATA dummy;
(void) &dummy;
dummy = *AT91C_PIOC_ISR; /* Clear PIO C interrupt. */
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -