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

📄 dm6430lib.h

📁 rt 6430 采集卡 linux下驱动源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*	FILE NAME: dm6430lib.h	FILE DESCRIPTION:	This file contains structure definitions and				function prototypes for the user level library				and application programs.	PROJECT NAME: Linux DM6430 Driver, Library, and Example Programs	PROJECT VERSION: (Defined in README.TXT)	Copyright 2004 RTD Embedded Technologies, Inc.  All Rights Reserved.*/#ifndef __dm6430lib__h#define __dm6430lib__h#include <sys/types.h>#include <sys/ioctl.h>#include <dm6430ioctl.h>#ifdef __cplusplusextern "C" {#endif/* Structure for A/D Table */typedef struct _ADTableRow {    enum DM6430HR_AIN	Channel;    enum DM6430HR_GAIN	Gain;    enum DM6430HR_SE	Se_Diff;    int			Pause;    int			Skip;} ADTableRow;/******************************************************************************OpenBoard6430()    Purpose:        Open a DM6430 device file.    Parameters:        DeviceNumber => Minor number of board device file.    Return Value:        >=0            Success.  The integer returned is the file descriptor from open()            system call.        -1            Failure.  Please see the open(2) man page for information on            possible values errno may have in this case. ******************************************************************************/int OpenBoard6430(int DeviceNumber);/******************************************************************************CloseBoard6430()    Purpose:        Close a DM6430 device file opened previously with OpenBoard6430().    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure.  Please see the close(2) man page for information on            possible values errno may have in this case. ******************************************************************************/int CloseBoard6430(int descriptor);/******************************************************************************InstallCallbackIRQHandler6430()    Purpose:        Install a function which will be called whenever an interrupt occurs        and the driver sends a signal to the process to indicate that the        interrupt happened.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.	callback ===> Address of callback function.	IRQChannel => Board interrupt circuit that signal should be attached to.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.                EINVAL                    callback is NULL.                EINVAL                    IRQChannel is not valid.                ENOMEM                    Library callback descriptor memory could not be allocated.            Please see the sigaction(2) man page, the sigprocmask(2) man page,            or the ioctl(2) man page for information on other possible values            errno may have in this case. ******************************************************************************/int InstallCallbackIRQHandler6430(    int descriptor,    void (*callback)(void),    enum DM6430HR_INT IRQChannel);/******************************************************************************RemoveIRQHandler6430()    Purpose:        Uninstall the function which was previously registered as an interrupt        callback by InstallCallbackIRQHandler6430().    Parameters:        descriptor => File descriptor from OpenBoard6430() call.	IRQChannel => Board interrupt circuit that signal should be detached                      from.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.                EINVAL                    IRQChannel is not valid.                EINVAL                    No IRQ was ever allocated to IRQChannel.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int RemoveIRQHandler6430(int descriptor, enum DM6430HR_INT IRQChannel);/******************************************************************************ClearRegister6430()    Purpose:        Write a bit mask into a board's Program Clear Register and then read        from the Clear Register to clear some part(s) of the board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.	ClearValue => Bit mask to write into Program Clear Register before                      reading Clear Register.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearRegister6430(int descriptor, u_int16_t ClearValue);/******************************************************************************ClearBoard6430()    Purpose:        Reset a board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearBoard6430(int descriptor);/******************************************************************************ClearADFIFO6430()    Purpose:        Clear a board's A/D sample FIFO.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearADFIFO6430(int descriptor);/******************************************************************************ClearADDMADone6430()    Purpose:        Clear a board's A/D DMA done flag.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearADDMADone6430(int descriptor);/******************************************************************************ClearChannelGainTable6430()    Purpose:        Clear the contents of a board's channel/gain table.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearChannelGainTable6430(int descriptor);/******************************************************************************ResetChannelGainTable6430()    Purpose:        Reset a board's channel/gain table starting point to the beginning of        the table.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ResetChannelGainTable6430(int descriptor);/******************************************************************************ClearDINFIFO6430()    Purpose:        Clear a board's digital input FIFO.     Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearDINFIFO6430(int descriptor);/******************************************************************************ClearIRQ06430()    Purpose:        Clear the first interrupt circuit on a board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearIRQ06430(int descriptor);/******************************************************************************ClearIRQ16430()    Purpose:        Clear the second interrupt circuit on a board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for write                    access.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int ClearIRQ16430(int descriptor);/******************************************************************************InitBoard6430()    Purpose:        Initialize a board.  This will 1) clear the board, 2) clear the A/D        DMA done flag, 3) clear the channel/gain table, and 4) clear the A/D        input FIFO.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.

⌨️ 快捷键说明

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