⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configint3.c

📁 Mplab C30编译器
💻 C
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <ports.h>

/****************************************************************************
Function Prototype : void ConfigINT3(unsigned int config)
 
Include            : ports.h
 
Description        : This function configures the external interrupt 
 
Arguments          : config - Interrupt edge, priority and enable/disable 
                     information as defined below:
					 Interrupt edge selection					
					   RISING_EDGE_INT					
					   FALLING_EDGE_INT					
					 Interrupt enable					
					   EXT_INT_ENABLE					
					   EXT_INT_DISABLE					
					 Interrupt priority					
					   EXT_INT_PRI_0					
					   EXT_INT_PRI_1					
					   EXT_INT_PRI_2					
					   EXT_INT_PRI_3					
					   EXT_INT_PRI_4					
					   EXT_INT_PRI_5					
					   EXT_INT_PRI_6					
					   EXT_INT_PRI_7
 
Return Value       : None
 
Remarks            : This function clears the interrupt flag corresponding 
                     to the INTx pin and then selects the edge detect polarity.
                     It then sets the interrupt priority and enables/disables
                     the interrupt.
********************************************************************************/
#ifdef _INT3

void ConfigINT3(unsigned int config)
{

    IFS3bits.INT3IF = 0;                       /* clear the interrupt flag */
    IPC13bits.INT3IP = config & 0x07;           /* assign interrupt priority */
    IEC3bits.INT3IE = (config & 0x08) >> 3;    /* enable/disable interrupt */

    INTCON2bits.INT3EP = (config & 0x10) >> 4; /* assign edge selected */

    
}
/* end of function ConfigINT3 */

#else
#warning "Does not build on this target"
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -