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

📄 dm6430lib.h

📁 rt 6430 采集卡 linux下驱动源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
    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 InitBoard6430(int descriptor);/******************************************************************************EnableIRQ6430()    Purpose:        Enable the specified interrupt circuit on a board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.        IRQChannel => Interrupt circuit to enable.  Valid values are                      DM6430HR_INT1 and DM6430HR_INT2.    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.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int EnableIRQ6430(int descriptor, enum DM6430HR_INT IRQChannel);/******************************************************************************DisableIRQ6430()    Purpose:        Disable the specified interrupt circuit on a board.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.        IRQChannel => Interrupt circuit to disable.  Valid values are                      DM6430HR_INT1 and DM6430HR_INT2.    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.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int DisableIRQ6430(int descriptor, enum DM6430HR_INT IRQChannel);/******************************************************************************GetIRQCounter6430()    Purpose:        Get the number of interrupts that have occurred on a board's specified        interrupt circuit.    Parameters:        descriptor ======> File descriptor from OpenBoard6430() call.        IRQChannel ======> Interrupt circuit to read counter value from.                           Valid values are DM6430HR_INT1 and DM6430HR_INT2.        counter_value_p => Address where counter value should be stored.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for read                    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 GetIRQCounter6430(    int descriptor,    enum DM6430HR_INT IRQChannel,    unsigned long *counter_value_p);/******************************************************************************InstallDMA6430()    Purpose:        Configure the specified DMA circuit on a board to be able to perform        DMA.    Parameters:        descriptor ======> File descriptor from OpenBoard6430() call.        DMAChannel ======> DMA circuit to configure.  Valid values are                           DM6430HR_DMA1 and DM6430HR_DMA2.    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                    DMAChannel is not valid.                EINVAL                    No DMA channel was ever allocated to DMAChannel.                ENOMEM                    DMA buffer memory allocation failed.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int InstallDMA6430(int descriptor, enum DM6430HR_DMA DMAChannel);/******************************************************************************DeInstallDMA6430()    Purpose:        Configure the specified DMA circuit on a board so that DMA can no        longer be performed.    Parameters:        descriptor ======> File descriptor from OpenBoard6430() call.        DMAChannel ======> DMA circuit to configure.  Valid values are                           DM6430HR_DMA1 and DM6430HR_DMA2.    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                    DMAChannel is not valid.                EINVAL                    No DMA channel was ever allocated to DMAChannel.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int DeInstallDMA6430(int descriptor, enum DM6430HR_DMA DMAChannel);/******************************************************************************GetDmaData6430()    Purpose:        Copy data from specified DMA circuit's DMA buffer to user buffer.    Parameters:        descriptor ==========> File descriptor from OpenBoard6430() call.        dma_buffer_p ========> Address of user buffer.        DMAChannel ==========> DMA circuit to operate on.  Valid values are                               DM6430HR_DMA1 and DM6430HR_DMA2.        length ==============> Number of bytes to transfer.        offset ==============> Offset in bytes from beginning of DMA buffer.        bytes_transferred_p => Address where actual number of bytes transferred                               will be stored.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for read                    access.                EFAULT                    dma_buffer_p is not a valid user address.                EFAULT                    dma_buffer_p is not large enough to hold the data.                EINVAL                    DMAChannel is not valid.                EINVAL                    No DMA channel was ever allocated to DMAChannel.                EINVAL                    No DMA buffer was ever allocated to DMAChannel.                EINVAL                    (length + offset) lies beyond the end of the DMA buffer.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int GetDmaData6430(    int descriptor,    void *dma_buffer_p,    enum DM6430HR_DMA DMAChannel,    size_t length,    size_t offset,    size_t *bytes_transferred_p);/******************************************************************************StartDMA6430()    Purpose:        Start DMA on a board's specified DMA circuit.    Parameters:        descriptor ====> File descriptor from OpenBoard6430() call.        DMAChannel ====> DMA circuit to operate on.  Valid values are                         DM6430HR_DMA1 and DM6430HR_DMA2.        TransferBytes => Number of bytes to transfer in a single DMA.  This                         value must be even.    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                    DMAChannel is not valid.                EINVAL                    No DMA channel was ever allocated to DMAChannel.                EINVAL                    No DMA buffer was ever allocated to DMAChannel.                EINVAL                    TransferBytes is odd.                EINVAL                    TransferBytes is greater than the DMA buffer size.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int StartDMA6430(    int descriptor,    enum DM6430HR_DMA DMAChannel,    size_t TransferBytes);/******************************************************************************StopDMA6430()    Purpose:        Stop DMA on a board's specified DMA circuit.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.        DMAChannel => DMA circuit to operate on.  Valid values are                      DM6430HR_DMA1 and DM6430HR_DMA2.    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                    DMAChannel is not valid.                EINVAL                    No DMA channel was ever allocated to DMAChannel.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int StopDMA6430(int descriptor, enum DM6430HR_DMA DMAChannel);/******************************************************************************GetAutoincData6430()    Purpose:        Initiate a streaming read from a board.  Once can specify the board        register to read from, what size data is to be transferred, and how        many data elements to transfer.    Parameters:        descriptor ====> File descriptor from OpenBoard6430() call.        from_register => Register from which the data should be read.  Valid                         values are rSTR_AD_6430 and rSTR_DIN_FIFO_6430.        type ==========> Type/size of element to be transferred.  Valid values                         are DM6430HR_STR_TYPE_BYTE and DM6430HR_STR_TYPE_WORD.        buffer_p ======> Address of buffer in which to place the data read.	element_num ===> How many data elements of type "type" should be read.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES                    descriptor refers to a file that is open but not for read                    access.                EFAULT                    buffer_p is not a valid user address.                EINVAL                    from_register is not valid.                EINVAL                    type is not valid.                EOPNOTSUPP                    from_register is rSTR_AD_6430 and type is                    DM6430HR_STR_TYPE_BYTE.                EOPNOTSUPP                    from_register is rSTR_DIN_FIFO_6430 and type is                    DM6430HR_STR_TYPE_WORD.            Please see the ioctl(2) man page for information on other possible            values errno may have in this case. ******************************************************************************/int GetAutoincData6430(    int descriptor,    enum DM6430HR_STR_Regs from_register,    enum DM6430HR_STR_TYPE type,    void *buffer_p,    size_t element_num);/******************************************************************************ReadStatus6430()    Purpose:        Read a board's Status Register.    Parameters:        descriptor => File descriptor from OpenBoard6430() call.        status_p ===> Address where status should be stored.    Return Value:        0            Success.        -1            Failure with errno set as follows:                EACCES

⌨️ 快捷键说明

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