📄 configint4.c
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <ports.h>
/****************************************************************************
Function Prototype : void ConfigINT4(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 _INT4
void ConfigINT4(unsigned int config)
{
IFS3bits.INT4IF = 0; /* clear the interrupt flag */
IPC13bits.INT4IP = config & 0x07; /* assign interrupt priority */
IEC3bits.INT4IE = (config & 0x08) >> 3; /* enable/disable interrupt */
INTCON2bits.INT4EP = (config & 0x10) >> 4; /* assign edge selected */
}
/* end of function ConfigINT4 */
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -