opencapture3.c

来自「基於 c51/8051 的 nand Flash Memory HY27US08」· C语言 代码 · 共 41 行

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

/* These devices support Input Capture 3 thru Input Capture 6 */
#ifdef _ICAP3
/*******************************************************************************
* Function Name:  OpenCapture3                                                 *
* 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 + =
减小字号Ctrl + -
显示快捷键?