?? f281xcap.c
字號:
/* ==================================================================================
File name: F281XCAP.C
Originator: Digital Control Systems Group
Texas Instruments
Description: This file contains source for the Capture drivers for the F281X using EVA
Target: TMS320F281x family
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20: Using DSP281x v. 1.00 or higher
------------------------------------------------------------------------------------*/
#include "DSP281x_Device.h"
#include "f281xcap.h"
void F281X_EV1_CAP_Init(CAPTURE *p)
{
EvaRegs.CAPCONA.all = CAP_INIT_STATE; // Set up capture units
EvaRegs.T2CON.all = TIMER_INIT_STATE; // Set up capture timer
EvaRegs.T2PR = 0x7FFF; // Set up timer period
EALLOW; // Enable EALLOW
GpioMuxRegs.GPAMUX.all |= 0x0700; // Set up the capture pins to primary functions
EDIS; // Disable EALLOW
}
Uint16 F281X_EV1_CAP_Read(CAPTURE *p)
{
if((EvaRegs.CAPFIFOA.all&0x0100) != 0) // Check status of one entry of CAP1
{
p->TimeStamp = EvaRegs.CAP1FIFO; // Stamp the timer counter when an edge is detected
return(0); // Then, return zero
}
else
{
return(1); // Else, return one
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -