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

📄 dm7520_library.h

📁 rt 7520采集卡 linux驱动源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*	FILE NAME: dm7520_library.h	FILE DESCRIPTION:		This file contains function prototypes for the DM7520 user		level library.	PROJECT NAME: Linux DM7520 Driver, Library, and Example Programs	PROJECT VERSION: (Defined in README.TXT)	Copyright 2004 RTD Embedded Technologies, Inc.  All Rights Reserved.*/#ifndef DM7520_LIBRARY_H#define DM7520_LIBRARY_H#include <stdint.h>	//uint16_t and friends#include "dm7520.h"#ifdef __cplusplusextern "C" {#endif  // __cplusplus/******************************************************************************ClearADFifo7520()    Purpose:        Remove all samples from a board's A/D FIFO.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case. ******************************************************************************/int ClearADFifo7520(int board);/******************************************************************************ClearAllIO7520()    Purpose:        Perform a software reset on a board.  This puts the board into the        power-up state.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case. ******************************************************************************/int ClearAllIO7520(int board);/******************************************************************************ClearCGT7520()    Purpose:        Clear the A/D channel/gain table by resetting the table's internal        read and write pointers to the beginning of the table.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case.    NOTE:        This function also clears the digital part of the channel/gain table. ******************************************************************************/int ClearCGT7520(int board);/******************************************************************************ClearDAC1Fifo7520()    Purpose:        Remove all data from the D/A converter 1 FIFO by resetting the internal        read and write pointers to the beginning of the FIFO.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case. ******************************************************************************/int ClearDAC1Fifo7520(int board);/******************************************************************************ClearDAC2Fifo7520()    Purpose:        Remove all data from the D/A converter 2 FIFO by resetting the internal        read and write pointers to the beginning of the FIFO.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case. ******************************************************************************/int ClearDAC2Fifo7520(int board);/******************************************************************************ClearDinFifo7520()    Purpose:        Remove all entries from a board's high speed digital input FIFO.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case. ******************************************************************************/int ClearDinFifo7520(int board);/******************************************************************************ClearDIO0IrqStatus7520()    Purpose:        Clear the digital interrupt status flag on a board's digital I/O port 0        circuit.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_readreg() and the description of SelectDIO0Register7520()            for information on possible values errno may have in this case.    NOTE:        Calling this function acknowledges a digital interrupt.  The digital        I/O chip will not generate any more interrupts until the interrupt        status flag is cleared. ******************************************************************************/int ClearDIO0IrqStatus7520(int board);/******************************************************************************ClearDIO7520()    Purpose:        Reset a board's digital I/O chip.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case.    NOTE:        In addition to resetting the digital I/O chip, the chip is placed in        the following state:            * Digital I/O port 1 direction is set to input.            * Digital interrupt mode is set to event mode.            * Digital interrupts are disabled.            * Digital sample clock is set to 8 MHz system clock.        This function does not clear the digital interrupt status flag. ******************************************************************************/int ClearDIO7520(int board);/******************************************************************************ClearErrorCode7520()    Purpose:        Clear the internal error code maintained by the driver.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EBUSY                    The device file referred to by board was not opened.                ENXIO                    The minor number of the device file referred to by board is                    greater than the number of DM7520 devices supported.                ENXIO                    The device referred to by board was not configured, failed                    its configuration, or is not present. ******************************************************************************/int ClearErrorCode7520(int board);/******************************************************************************DACClockFreeRun7520()    Purpose:        Select the mode that a board's D/A clock will run in.    Parameters:        board ===> File descriptor of board.        runmode => Run mode of D/A clock.  A value of zero indicates "free run"                   mode.  Any other value indicates that the clock will be                   started and stopped by the method indicated via the                   DACClockStartSelect7520() and DACClockStopSelect7520()                   functions.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case.    NOTE:        On power up, the D/A clock is in "free run" mode.        This function works only on DM7520 boards with an EPLD version of        eleven or higher. ******************************************************************************/int DACClockFreeRun7520(int board, int runmode);/******************************************************************************DACClockStart7520()    Purpose:        Issue a software start command to a board's D/A clock.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_readreg() for information on possible values errno may have            in this case.    NOTE:        This function works only on DM7520 boards with an EPLD version of        nine or higher.        This function works only if the D/A clock is set to software start. ******************************************************************************/int DACClockStart7520(int board);/******************************************************************************DACClockStartSelect7520()    Purpose:        Select the start source for a board's D/A clock.    Parameters:        board => File descriptor of board.        data ==> D/A clock start source.  Valid values are:                     0 - Pacer clock software start                     1 - External trigger input signal                     2 - Digital interrupt                     3 - User timer/counter 2 output reaches zero                     4 - SyncBus 0                     5 - SyncBus 1                     6 - SyncBus 2                     7 - D/A clock software start    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case.    NOTE:        This function works only on DM7520 boards with an EPLD version of        nine or higher. ******************************************************************************/int DACClockStartSelect7520(int board, int data);/******************************************************************************DACClockStop7520()    Purpose:        Issue a software stop command to a board's D/A clock.    Parameters:        board => File descriptor of board.    Return Value:        0            Success.        -1            Failure.  Please see the description of the internal function            dm7520_writereg() for information on possible values errno may have            in this case.    NOTE:        This function works only on DM7520 boards with an EPLD version of        nine or higher.        This function works only if the D/A clock is set to software stop. ******************************************************************************/int DACClockStop7520(int board);/******************************************************************************

⌨️ 快捷键说明

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