EDT PCD SDK Documentation 6.1.0
Open / Close
Collaboration diagram for Open / Close:

Functions

int edt_close (EdtDev edt_p)
 Shut down all pending I/O operations, closes the device or channel and frees all resources associated with the device handle. More...
 
EDT_CHECK_RETURN EdtDev edt_open (const char *device_name, int unit)
 Open the specified EDT board and sets up the device handle. Equivalent to edt_open_device(device_name, unit, channel: 0, verbose: 1). More...
 
EDT_CHECK_RETURN EdtDev edt_open_quiet (const char *device_name, int unit)
 Same as edt_open(), but with fewer log messages. Equivalent to edt_open_device(device_name, unit, channel: 0, verbose: 0). More...
 
EDT_CHECK_RETURN EdtDev edt_open_channel (const char *device_name, int unit, int channel)
 Open a specific DMA channel on the specified EDT board. Equivalent to edt_open_device(device_name, unit, channel, verbose: 1). More...
 
EDT_CHECK_RETURN EdtDev edt_open_device (const char *device_name, int unit, int channel, int verbose)
 Open a specific EDT board and DMA channel. More...
 
void edt_set_port (EdtDev edt_p, EdtIOPort port)
 Set the port number, as distinct from the DMA channel. More...
 
EdtIOPort edt_get_port (EdtDev edt_p)
 Get the port number set by edt_set_port(). More...
 

Detailed Description

These functions are used to open and close the EDT device.

Function Documentation

◆ edt_close()

int edt_close ( EdtDev  edt_p)

Shut down all pending I/O operations, closes the device or channel and frees all resources associated with the device handle.

Parameters
edt_pThe open EDT device handle.
Returns
0 on success, -1 on failure. If an error occurs, call edt_perror() to get the system error message.
See also
edt_open_device()
Here is the caller graph for this function:

◆ edt_open()

EDT_CHECK_RETURN EdtDev edt_open ( const char *  device_name,
int  unit 
)

Open the specified EDT board and sets up the device handle. Equivalent to edt_open_device(device_name, unit, channel: 0, verbose: 1).

Parameters
device_namePass EDT_INTERFACE. Open a dummy device for testing by passing "dmy".
unitUnit number of the device. Unit numbers start at 0.
Returns
The opened EDT device handle if successful, or NULL if unsuccessful. Use edt_perror() to print an error message.

Once opened, the device handle may be used to perform I/O using edt_read(), edt_write(), edt_configure_ring_buffers(), and other input-output library calls. When finished, use edt_close() to release allocated resources.

See also
edt_open_channel(), edt_open_quiet(), edt_close()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ edt_open_quiet()

EDT_CHECK_RETURN EdtDev edt_open_quiet ( const char *  device_name,
int  unit 
)

Same as edt_open(), but with fewer log messages. Equivalent to edt_open_device(device_name, unit, channel: 0, verbose: 0).

Parameters
device_namePass EDT_INTERFACE. Open a dummy device for testing by passing "dmy".
unitUnit number of the device. Unit numbers start at 0.
Returns
The opened EDT device handle if successful, or NULL if unsuccessful. Use edt_perror() to print an error message.

Once opened, the device handle may be used to perform I/O using edt_read(), edt_write(), edt_configure_ring_buffers(), and other input-output library calls. When finished, use edt_close() to release allocated resources.

See also
edt_open_channel(), edt_open_quiet(), edt_close()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ edt_open_channel()

EDT_CHECK_RETURN EdtDev edt_open_channel ( const char *  device_name,
int  unit,
int  channel 
)

Open a specific DMA channel on the specified EDT board. Equivalent to edt_open_device(device_name, unit, channel, verbose: 1).

Parameters
device_namePass EDT_INTERFACE. Open a dummy device for testing by passing "dmy".
unitUnit number of the device. Unit numbers start at 0.
channelDMA channel number, starting from 0.
Returns
The opened EDT device handle if successful, or NULL if unsuccessful. Use edt_perror() to print an error message.

Once opened, the device handle may be used to perform I/O using edt_read(), edt_write(), edt_configure_ring_buffers(), and other input-output library calls. When finished, use edt_close() to release allocated resources.

See also
edt_open_channel(), edt_open_quiet(), edt_close()
Here is the call graph for this function:

◆ edt_open_device()

EDT_CHECK_RETURN EdtDev edt_open_device ( const char *  device_name,
int  unit,
int  channel,
int  verbose 
)

Open a specific EDT board and DMA channel.

Parameters
device_namePass EDT_INTERFACE. Open a dummy device for testing by passing "dmy".
unitUnit number of the device. Unit numbers start at 0.
channelDMA channel number, starting from 0.
verboseEnable (true / non-zero) messages on successful open, or error messages on failure. Pass false or 0 to disable.
Returns
The opened EDT device handle if successful, or NULL if unsuccessful. Use edt_perror() to print an error message.

Once opened, the device handle may be used to perform I/O using edt_read(), edt_write(), edt_configure_ring_buffers(), and other input-output library calls. When finished, use edt_close() to release allocated resources.

See also
edt_open_channel(), edt_open_quiet(), edt_close()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ edt_set_port()

void edt_set_port ( EdtDev  edt_p,
EdtIOPort  port 
)

Set the port number, as distinct from the DMA channel.

Parameters
edt_pThe open EDT device handle.
portPort number enum.
See also
edt_get_port(), edt_device_channel()

◆ edt_get_port()

EdtIOPort edt_get_port ( EdtDev  edt_p)

Get the port number set by edt_set_port().

Parameters
edt_pThe open EDT device handle.
Returns
Port number enum.

Routine to get the "port" number, as distinct from the dma channel