configintcn.c

来自「Mplab C30编译器」· C语言 代码 · 共 39 行

C
39
字号
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include<ports.h>

/******************************************************************************
Function Prototype : void ConfigIntCN(unsigned int config)
 
Include            : ports.h
 
Description        : This function configures the CN interrupts.
 
Arguments          :  config - CN interrupt priority and enable/disable information 
                     as defined below
                     CN Interrupt enable/disable
					   INT_ENABLE
					   INT_DISABLE
					 CN Interrupt priority
                       INT_PRI_0
                       INT_PRI_1
                       .....
                       INT_PRI_6
                       INT_PRI_7
 
Return Value       : None
 
Remarks            : This function clears the Interrupt Flag bit and then sets
                     the interrupt priority and enables/disables the interrupt.
********************************************************************************/
void ConfigIntCN(unsigned int config)
{ 
    IFS1bits.CNIF = 0; /* Clearing the Interrupt Flag bit */
    
    IPC4bits.CNIP = config & 0x07; /* Setting Priority */
    
    IEC1bits.CNIE = (config & 0x08)>>3; /* Setting the Interrupt enable bit */
}
/* end of function ConfigIntCN */

⌨️ 快捷键说明

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