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

📄 configintcapture56_v4.c

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

#if defined(_ICAP_V4_5) && defined(_ICAP_V4_6)
/*********************************************************************************
Function Prototype : void ConfigIntCapture56(unsigned int config)
 
Include            : incap.h
 
Description        : This function configures the Input Capture interrupt.
 
Arguments          : config - Input Capture interrupt priority and enable/disable
                     information as defined below
					 Interrupt enable/disable					
					   IC_INT_ON					
					   IC_INT_OFF					
					 Interrupt Priority					
					   IC_INT_PRIOR_0					
					   IC_INT_PRIOR_1					
					   IC_INT_PRIOR_2					
					   IC_INT_PRIOR_3					
					   IC_INT_PRIOR_4					
					   IC_INT_PRIOR_5					
					   IC_INT_PRIOR_6					
					   IC_INT_PRIOR_7
 
Return Value       : None
 
Remarks            : This function clears the Interrupt Flag bit and then sets 
                     the interrupt priority and enables/disables the interrupt.
**********************************************************************************/
void ConfigIntCapture56(unsigned int config )
{
    IFS2bits.IC5IF = 0;                    /* Clear IF bit */
    IFS2bits.IC6IF = 0; 
    
    IPC9bits.IC5IP = (config &0x0007);     /*assigning Interrupt Priority to IPC Register */
    IPC10bits.IC6IP = (config &0x0007);
                                                    
    IEC2bits.IC5IE = (config &0x0008) >> 3;/*assiging Interrupt Enable/ Disable.  */
    IEC2bits.IC6IE = (config &0x0008) >> 3;
}

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

⌨️ 快捷键说明

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