IoctlDriver
Sends an ioctl command to the device driver.
Syntax
long IoctlDriver( command, arg );
Parameters
long command
The ioctl command to send to the device driver. See below for the list of available commands.

ASTROPCI_GET_HCTRRead the PCI board HCTR ( control ) register.
ASTROPCI_GET_PROGRESSRead the current readout pixel count.
ASTROPCI_GET_DMA_ADDRRead the DMA address set on the PCI board.
ASTROPCI_GET_HSTRRead the PCI board HSTR ( status ) register.
ASTROPCI_MEM_MAPMap the kernel image buffer to the user application.
ASTROPCI_GET_DMA_SIZERead the DMA image buffer size from the PCI board.
ASTROPCI_GET_FRAMES_READRead the current number of continuous readout frames that have been read out.
ASTROPCI_HCVR_DATAPut data into the PCI HCVR data queue. Generally used to pass command and argument values to PCI board for transmission to destination board. i.e. Generally used with ASTROPCI_COMMAND.
ASTROPCI_SET_HCTRSet the PCI board HCTR ( control ) register.
ASTROPCI_SET_HCVRSet the PCI board vector register.
ASTROPCI_PCI_DOWNLOADInform the PCI board that new DSP code will be uploaded into its EEPROM.
ASTROPCI_PCI_DOWNLOAD_WAITWaits for PCI DSP to finish initialization after new DSP code has been uploaded.
ASTROPCI_COMMANDSend a command to the PCI, timing or utility board. The command and its arguments should be previously set using ASTROPCI_SET_HCVR.
ASTROPCI_MEM_UNMAPUnmaps the kernel image buffer from the user application.
ASTROPCI_GET_CR_PROGRESSReturns the cumulative pixel count as when doing continuous readout. This is used by user applications when reading super large images (greater than 4K x 4K). This value increases across all frames being readout.
long arg
[optional] Any argument that may be required by the command. Default value: -1.
Returns
long - A command specific reply value.
Required Headers
CController.h, Ioctl.h
Namespace
arc
Throws
std::runtime_error
Remarks
User applications will generally NOT use this method, as the other methods in the CController class make use of this method on behalf of the user. Exceptions can be caught using a try/catch block.
Example
        // This code demonstrates how to use IoctlDriver to read
        // the DMA address from the PCI board.

        #include <iostream.h>
        #include "CController.h"
        using namespace std;
        using namespace arc;

        CController cController;
        long lRetVal = 0;

        // .... open driver, initialize, etc ....


        try {
            lRetVal = cController.IoctlDriver( ASTROPCI_GET_DMA_ADDR );
            cout << "DMA Address: 0x" << hex << lRetVal << endl;
        }
        catch ( std::exception &e )
        {
            cerr << "Exception Occurred: " << e.what() << endl;
        }

© Astronomical Research Cameras, Inc.