📄 opencapture2.c
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <incap.h>
#ifdef _ICAP2
/*******************************************************************************
* Function Name: OpenCapture2 *
* Description: This routine include configuring clock , *
* number of capture per interrupt ,capture mode *
* Parameters: unsigned int config *
* bit[15:14] Unused *
* bit[13] ICSIDL : Input Capture x Stop in Idle Control bit *
* bit[12:8] Unused *
* bit[7] ICTMR: Input Capture x Timer Select bit(1) *
* 1 = TMR2 contents are captured on capture event *
* 0 = TMR3 contents are captured on capture event *
* bit[6:5] ICI<1:0>: Select Number of Captures per Interrupt *
* 11 = Interrupt on every fourth capture event *
* 10 = Interrupt on every third capture event *
* 01 = Interrupt on every second capture event *
* 00 = Interrupt on every capture event *
* bit[4] ICOV: Input Capture x Overflow Status Flag bit *
* (read-only) *
* 1 = Input capture overflow occurred *
* 0 = No input capture overflow occurred *
* bit[3] ICBNE: Input Capture x Buffer Empty Status bit *
* (read-only) *
* 1 = Input capture buffer is not empty, at least *
* one more capture value can be read *
* 0 = Input capture buffer is empty *
* bit[2:0] ICM<2:0>: Input Capture x Mode Select bits *
* 111 = Input capture functions as interrupt pin *
* only when device is in Sleep or Idle mode *
* 110 = Unused (module disabled) *
* 101 = Capture mode, every 16th rising edge *
* 100 = Capture mode, every 4th rising edge *
* 011 = Capture mode, every rising edge *
* 010 = Capture mode, every falling edge *
* 001 = Capture mode, every edge
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -