configintcapture2.c
来自「Mplab C30编译器」· C语言 代码 · 共 46 行
C
46 行
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <incap.h>
#ifdef _ICAP2
/*********************************************************************************
Function Prototype : void ConfigIntCapture2(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 ConfigIntCapture2(unsigned int config)
{
IFS0bits.IC2IF = 0; /* Clear IF bit */
IPC1bits.IC2IP = (config &0x0007); /* assigning Interrupt Priority
to IPC Control REgister */
IEC0bits.IC2IE = (config &0x0008) >> 3; /* assiging InputCapture Enable/
Disable bit of IEC Register*/
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?