libpdv.c File Reference


Detailed Description

PDV Library, most subroutines.

Definition in file libpdv.c.

#include "edtinc.h"
#include <math.h>
#include <assert.h>
#include "libedt_timing.h"

Go to the source code of this file.

Defines

#define DBG1   PDVLIB_MSG_INFO_1
#define DBG2   PDVLIB_MSG_INFO_2
#define PDV_DEPENDENT(pdv_p)   ((pdv_p)->dd_p)
#define PDVFATAL   PDVLIB_MSG_FATAL
#define PDVWARN   PDVLIB_MSG_WARNING
 libpdv.c
#define SERIAL_ENABLED_FLAGS   (PDV_EN_TX | PDV_EN_RX | PDV_EN_RX_INT | PDV_EN_DEV_INT)

Functions

int check_register_wrap (EdtDev *edt_p)
void checkfpga_dep_wait (pdv_p)
int edt_get_rtimeout (PdvDev *pdv_p)
 Gets the current read timeout value: the number of milliseconds to wait for DMA reads to complete before returning.
int pdv_access (char *fname, int perm)
 Determines file access independent of operating system.
uchar_t * pdv_alloc (int size)
 Convenience routine to allocate memory in a system-independent way.
void pdv_alloc_tmpbuf (PdvDev *pdv_p)
int pdv_auto_set_roi (PdvDev *pdv_p)
 set ROI to camera width/height; adjust ROI width to be a multiple of 4, and enable ROI
int pdv_auto_set_timeout (PdvDev *pdv_p)
 Sets a reasonable image timeout value based on image size and exposure time (if set) and pixel clock speed (also if set).
u_char ** pdv_buffer_addresses (PdvDev *pdv_p)
 Returns the addresses of the buffers allocated by the last call to pdv_multibuf or pdv_set_buffers.
int pdv_bytes_per_line (int width, int depth)
 Returns bytes per line based on width and bit depth, including depth < 8.
char * pdv_camera_type (PdvDev *pdv_p)
 Alias of pdv_get_cameratype.
void pdv_check (PdvDev *pdv_p)
void pdv_check_fpga_rev (PdvDev *pdv_p)
int pdv_check_framesync (PdvDev *pdv_p, u_char *image_p, u_int *framecnt)
 Checks for frame sync and frame count.
void pdv_checkfrm (PdvDev *pdv_p, u_short *imagebuf, u_int imagesize, int verbose)
int pdv_cl_camera_connected (PdvDev *pdv_p)
 Checks whether a camera is connected and turned on.
int pdv_cl_get_fv_counter (PdvDev *pdv_p)
 Gets the number of frame valid transitions that have been seen by the board since the last time the board/channel was initialized or the last time pdv_cl_reset_fv_counter was called.
void pdv_cl_reset_fv_counter (PdvDev *pdv_p)
 Resets the frame valid counter to zero.
void pdv_cl_set_base_channels (PdvDev *pdv_p, int htaps, int vtaps)
 Set the number of channels (taps) and horizontal and vertical alignment of the taps.
int pdv_close (PdvDev *pdv_p)
 Closes the specified device and frees the device struct and image memory.
int pdv_dalsa_ls_set_expose (PdvDev *pdv_p, int hskip, int hactv)
int pdv_debug (int flag)
 Sets the debug level of the PDV library.
int pdv_debug_level ()
 Gets the debug level, as set by pdv_debug or outside environment variables.
void pdv_dmy_data (void *buf, int width, int height, int depth)
 Fills buffer buf with software generated data.
void pdv_enable_external_trigger (PdvDev *pdv_p, int flag)
 Enables external triggering.
int pdv_enable_framesync (PdvDev *pdv_p, int mode)
 Enables frame sync footer and frame out-of-synch detection.
int pdv_enable_lock (PdvDev *pdv_p, int flag)
 Convenience routine to enable/disable shutter lock on/off on certain cameras.
int pdv_enable_roi (PdvDev *pdv_p, int flag)
 Enables on-board region of interest.
int pdv_enable_strobe (PdvDev *pdv_p, int ena)
 enable/disable lh strobe.
int pdv_extra_headersize (PdvDev *pdv_p)
 Return the header space allocated but not used for DMA.
void pdv_flush_channel_fifo (PdvDev *pdv_p)
 OBSOLETE: just use pdv_flush_fifo(pdv_p) now.
void pdv_flush_fifo (PdvDev *pdv_p)
 FIX !!! Write brief comment for pdv_flush_fifo here.
int pdv_force_single (PdvDev *pdv_p)
 Returns the value of the force_single flag.
int pdv_framesync_mode (PdvDev *pdv_p)
 Returns the framesync mode.
void pdv_free (uchar_t *ptr)
 Convenience routine to free the memory allocated with pdv_alloc.
int pdv_get_allocated_size (PdvDev *pdv_p)
 Returns the allocated size of the image, including any header and pad for page alignment.
int pdv_get_aperture (PdvDev *pdv_p)
 This method is obsolete and should not be used.
int pdv_get_baud (PdvDev *pdv_p)
 Get the baud rate, typically initialized by the serial_baud directive in the config file (default 9600).
int pdv_get_blacklevel (PdvDev *pdv_p)
 Gets the black level (offset) on the imaging device.
int pdv_get_bytes_per_image (PdvDev *pdv_p)
 Gets the number of bytes per image, based on the set width, height, and depth.
int pdv_get_cam_height (PdvDev *pdv_p)
 Returns the camera image height, in pixels, as set by the configuration file directive height, unaffected by changes made by setting a region of interest.
int pdv_get_cam_width (PdvDev *pdv_p)
 Returns the camera image width, in pixels, as set by the configuration file directive width.
char * pdv_get_camera_class (PdvDev *pdv_p)
 Gets the class of the camera (usually the manufacturer name), as set by initcam from the camera_config file camera_class directive.
char * pdv_get_camera_info (PdvDev *pdv_p)
 Gets the string set by the camera_info configuration file directive.
char * pdv_get_camera_model (PdvDev *pdv_p)
 Gets the model of the camera, as set by initcam from the camera_config file camera_model directive.
char * pdv_get_cameratype (PdvDev *pdv_p)
 Gets the type of the camera, as set by initcam from the camera configuration file's camera description directives.
int pdv_get_depth (PdvDev *pdv_p)
 Gets the depth of the image (number of bits per pixel), as set in the configuration file for the camera in use.
int pdv_get_dmasize (PdvDev *pdv_p)
 Returns the actual amount of image data for DMA.
int pdv_get_dvc_state (PdvDev *pdv_p, DVCState *pState)
int pdv_get_exposure (PdvDev *pdv_p)
 Gets the exposure time on the digital imaging device.
int pdv_get_extdepth (PdvDev *pdv_p)
 Gets the extended depth of the camera.
int pdv_get_firstpixel_counter (PdvDev *pdv_p)
 Query state of the hardware first pixel counter register enable bit.
int pdv_get_frame_height (PdvDev *pdv_p)
 Gets the camera image height.
int pdv_get_frame_period (PdvDev *pdv_p)
 Get the frame period.
int pdv_get_fulldma_size (PdvDev *pdv_p, int *extrasizep)
int pdv_get_fval_done (PdvDev *pdv_p)
int pdv_get_gain (PdvDev *pdv_p)
 Gets the gain on the device.
int pdv_get_header_dma (PdvDev *pdv_p)
 Returns the current setting for flag which determines whether the header (or footer) size is to be added to the DMA size.
int pdv_get_header_offset (PdvDev *pdv_p)
 Returns the byte offset of the header in the buffer.
HdrPosition pdv_get_header_position (PdvDev *pdv_p)
 Returns the header or fotter position value.
int pdv_get_header_size (PdvDev *pdv_p)
 Returns the currently defined header or footer size.
int pdv_get_header_within (PdvDev *pdv_p)
 Tells if there is a header and it is within the data, and not extra data that gets added to the image DMA.
int pdv_get_height (PdvDev *pdv_p)
 Gets the height of the image (number of lines), based on the camera in use.
int pdv_get_imagesize (PdvDev *pdv_p)
 Returns the size of the image, absent any padding or header data.
u_short pdv_get_interlaced (PdvDev *pdv_p)
 Obsolete, included for backwards compatability only -- see pdv_interlace_method.
u_char * pdv_get_interleave_data (PdvDev *pdv_p, u_char *buf, int bufnum)
int pdv_get_invert (PdvDev *pdv_p)
 Get the state of the hardware invert register enable bit.
u_char * pdv_get_last_image (PdvDev *pdv_p)
 Returns a pointer to the last image that was acquired (non-blocking).
u_char * pdv_get_last_raw (PdvDev *pdv_p)
 get last raw image.
int pdv_get_lines_xferred (PdvDev *pdv_p)
 Gets the number of lines transferred during the last acquire.
int pdv_get_max_gain (PdvDev *pdv_p)
 Gets the maximum allowable gain value for this camera, as set by initcam from the camera configuration file gain_max directive.
int pdv_get_max_offset (PdvDev *pdv_p)
 Gets the maximum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_max directive.
int pdv_get_max_shutter (PdvDev *pdv_p)
 Gets the maximum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_max directive.
int pdv_get_min_gain (PdvDev *pdv_p)
 Gets the minimum allowable gain value for this camera, as set by initcam from the camera configuration file gain_min directive.
int pdv_get_min_offset (PdvDev *pdv_p)
 Gets the minimum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_min directive.
int pdv_get_min_shutter (PdvDev *pdv_p)
 Gets the minimum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_min directive.
int pdv_get_pitch (PdvDev *pdv_p)
 Gets the number of bytes per line (pitch).
int pdv_get_rawio_size (PdvDev *pdv_p)
int pdv_get_roi_enabled (PdvDev *pdv_p)
int pdv_get_serial_block_size ()
 Returns the block size for serial writes.
int pdv_get_shutter_method (PdvDev *pdv_p, u_int *mcl)
 Return shutter (expose) timing method and mode control (CC) state.
int pdv_get_timeout (PdvDev *pdv_p)
 Gets the length of time to wait for data on acquisition before timing out.
int pdv_get_waitchar (PdvDev *pdv_p, u_char *waitc)
 Get serial wait character, or byte.
int pdv_get_width (PdvDev *pdv_p)
 Gets the width of the image (number of pixels per line), based on the camera in use.
int pdv_get_width_xferred (PdvDev *pdv_p)
 Gets the number of pixels transferred during the last line transferred.
unsigned char * pdv_image (PdvDev *pdv_p)
 Start image acquisition if not already started, then wait for and return the address of the next available image.
unsigned char * pdv_image_raw (PdvDev *pdv_p)
 Start image acquisition if not already started, then wait for and return the address of the next available image (unprocessed).
int pdv_image_size (PdvDev *pdv_p)
 Returns the size of the image buffer in bytes, based on its width, height, and depth.
int pdv_in_continuous (PdvDev *pdv_p)
 Gets the status of the continuous flag.
int pdv_interlace_method (PdvDev *pdv_p)
 Returns the interlace method, as set from the method_interlace directive in the configuration file [from pdv_initcam].
void pdv_invert (PdvDev *pdv_p, int val)
 Tell the EDT framergrabber hardware to invert each pixel before transferring it to the host computer's memory.
void pdv_invert_fval_interrupt (PdvDev *pdv_p)
 Set the Frame Valid interrupt to occur on the rising instead of falling edge of frame valid.
int pdv_is_atmel (PdvDev *pdv_p)
 Infers that this device is connected to is an Atmel camera, based on the camera_class directive.
int pdv_is_cameralink (PdvDev *pdv_p)
 Infers that this device is connected to is a Camera Link camera (as opposed to RS-422 or LVDS parallel), based on settings from the loaded camera config file.
int pdv_is_dvc (PdvDev *pdv_p)
 Infers that this device is connected to is a DVC camera, from settings from the loaded camera config file.
int pdv_is_hamamatsu (PdvDev *pdv_p)
 Infers that this device is connected to is a Hamamatsu camera based on the camera class string.
int pdv_is_kodak_i (PdvDev *pdv_p)
 Infer if it's a Redlake (formerly Roper, formerly Kodak) 'i' camera from the serial settings.
int pdv_is_simulator (PdvDev *pdv_p)
 Infers that this device is a simulator -- either a PCI DV CLS board, or a PCIe DV C-Link with simulator FPGA loaded.
unsigned char * pdv_last_image_timed (PdvDev *pdv_p, u_int *timep)
 Identical to pdv_wait_last_image_timed; included for backwards compatability only.
unsigned char * pdv_last_image_timed_raw (PdvDev *pdv_p, u_int *timep, int doRaw)
 Identical to pdv_wait_last_image_timed_raw; included for backwards compatability only.
void pdv_mark_bin (u_char *addr, int n, int width, int height, int x, int y)
void pdv_mark_bin_16 (u_short *addr, int n, int width, int height, int x, int y)
void pdv_mark_digit_16 (u_short *addr, int n, int width, int height, int x, int y, int mask, int fg)
void pdv_mark_digit_24 (u_char *addr, int n, int width, int height, int x, int y, int mask, int fg)
void pdv_mark_digit_32 (u_int *addr, int n, int width, int height, int x, int y, int mask, int fg)
void pdv_mark_digit_8 (u_char *addr, int n, int width, int height, int x, int y, int mask, int fg)
void pdv_mark_ras (u_char *addr, int n, int width, int height, int x, int y)
void pdv_mark_ras_depth (void *addr, int n, int width, int height, int x, int y, int depth, int fg)
int pdv_multibuf (PdvDev *pdv_p, int numbufs)
 Sets the number of multiple buffers to use in ring buffer continuous mode, and allocates them.
void pdv_new_debug (int val)
PdvDevpdv_open (char *dev_name, int unit)
 Opens channel 0 of an EDT Framegrabber for application access.
PdvDevpdv_open_channel (const char *dev_name, int unit, int channel)
 Opens an EDT Framegrabber channel for application access.
PdvDevpdv_open_device (const char *dev_name, int unit, int channel, int verbose)
 Open the pdv device, with option to suppress non-existent device console output.
int pdv_overrun (PdvDev *pdv_p)
 Determines whether data overran on the last aquire.
int pdv_pause_for_serial (PdvDev *pdv_p)
void pdv_perror (char *err)
 Formats and prints a system error.
int pdv_picture_timeout (PdvDev *pdv_p, int value)
 Sets the length of time to wait for data on acquisition before timing out.
int pdv_process_inplace (PdvDev *pdv_p)
int pdv_query_serial (PdvDev *pdv_p, char *cmd, char **resp)
 Send a serial command, get the response in a multiline string, one line per string pointer.
int pdv_read (PdvDev *pdv_p, unsigned char *buf, unsigned long size)
 Reads image data from the EDT framegrabber board.
int pdv_read_basler_frame (PdvDev *pdv_p, u_char *frame, int len)
 Read a Basler binary frame command.
int pdv_read_duncan_frame (PdvDev *pdv_p, u_char *frame)
 Read response (binary serial) from a Duncantech MS and DT series camera -- checks for STX and size, then waits for size+1 more bytes.
int pdv_read_response (PdvDev *pdv_p, char *buf)
 Read serial response, wait for timeout (or serial_term if specified), max is 2048 (arbitrary).
void pdv_reset_serial (PdvDev *pdv_p)
 Resets the serial interface.
int pdv_send_basler_command (PdvDev *pdv_p, int cmd, int rwflag, int len, int data)
 Send a basler binary command -- do the framing and BCC.
int pdv_send_basler_frame (PdvDev *pdv_p, u_char *cmd, int len)
 Send a Basler formatted serial frame.
void pdv_send_break (PdvDev *pdv_p)
 send serial break (only aiag and related xilinx files)
int pdv_send_duncan_frame (PdvDev *pdv_p, u_char *cmdbuf, int size)
 Send a Duncantech MS / DT series camera frame -- adds the framing and checksum, then sends the command.
int pdv_send_msg (PdvDev *ed, int chan, const char *buf, int size)
 wrapper for edt_send_msg, but added pause between bytes if indicated by pause_for_serial (done initially for imperx cam)
int pdv_serial_binary_command (PdvDev *pdv_p, const char *cmd, int len)
 Sends binary serial command(s) to the camera.
int pdv_serial_binary_command_flagged (PdvDev *pdv_p, const char *cmd, int len, u_int flag)
 Sends a binary serial command.
int pdv_serial_check_enabled (PdvDev *pdv_p)
int pdv_serial_command (PdvDev *pdv_p, const char *cmd)
 Sends an ASCII serial command to the camera, with ASCII camera command formatting.
int pdv_serial_command_flagged (PdvDev *pdv_p, const char *cmd, u_int flag)
 Bottom level serial_command that takes a flag for different options.
int pdv_serial_command_hex (PdvDev *pdv_p, const char *str, int length)
 Send hex byte command (formatted ascii "0xNN") as binary.
int pdv_serial_get_numbytes (PdvDev *pdv_p)
 Returns the number of bytes of unread data in the serial response buffer.
char * pdv_serial_prefix (PdvDev *pdv_p)
 Get the serial prefix.
int pdv_serial_read (PdvDev *pdv_p, char *buf, int count)
 Performs a serial read over the serial control lines.
int pdv_serial_read_blocking (PdvDev *pdv_p, char *buf, int size)
 Performs a serial read over the serial control lines, blocks until all requested serial is read.
int pdv_serial_read_disable (PdvDev *pdv_p)
int pdv_serial_read_enable (PdvDev *pdv_p)
int pdv_serial_read_nullterm (PdvDev *pdv_p, char *buf, int size, int nullterm)
 Preforms a serial read over the RS-422 or RS-232 lines if EDT has provided a special cable to accommodate RS-422 or RS-232 serial control.
char * pdv_serial_term (PdvDev *pdv_p)
 Get the serial terminator.
void pdv_serial_txrx (PdvDev *pdv_p, char *txbuf, int txcount, char *rxbuf, int rxcount, int timeout, u_char *wchar)
 Serial send AND recieve -- send a command and wait for the response.
int pdv_serial_wait (PdvDev *pdv_p, int msecs, int count)
 Waits for response from the camera as a result of a pdv_serial_write or pdv_serial_command.
int pdv_serial_wait_next (EdtDev *pdv_p, int msecs, int count)
 Wait for next serial to come in -- ignore any previous if 0, just wait for the next thing, however many it is.
int pdv_serial_write (PdvDev *pdv_p, const char *buf, int size)
 Performs a serial write over the serial lines.
int pdv_serial_write_available (PdvDev *pdv_p)
 pdv_serial_write_avail Get the number of bytes available in the driver's serial write buffer.
int pdv_serial_write_single_block (PdvDev *pdv_p, const char *buf, int size)
 Writes a serial command buffer to a serial aia (Kodak type) device.
int pdv_set_aperture (PdvDev *pdv_p, int value)
 This method is obsolete and should not be used.
int pdv_set_baud (PdvDev *pdv_p, int baud)
 Sets the baud rate on the serial lines; applies only to cameras with serial control.
int pdv_set_binning (PdvDev *pdv_p, int xval, int yval)
 Set binning on the camera to the specified values, and recalculate the values that will be returned by pdv_get_width, pdv_get_height, and pdv_get_imagesize.
int pdv_set_binning_dvc (PdvDev *pdv_p, int xval, int yval)
 DVC 1312 binning.
int pdv_set_blacklevel (PdvDev *pdv_p, int value)
 Sets the black level (offset) on the input device.
int pdv_set_buffers (PdvDev *pdv_p, int numbufs, unsigned char **bufarray)
 Used to set up user-allocated buffers to be used in ring buffer mode, cannot be used on systems that have more than 3.5GB/memory (ie the subroutine has been depricated for all practical purposes, instead use pdv_multibuf).
int pdv_set_buffers_x (PdvDev *pdv_p, int numbufs, int size, unsigned char **bufs)
int pdv_set_cam_height (PdvDev *pdv_p, int value)
 Sets placeholder for original full camera frame height, unaffected by ROI changes and usually only called by pdv_initcam.
int pdv_set_cam_width (PdvDev *pdv_p, int value)
 Sets placeholder for original full camera frame width, unaffected by ROI changes and usually only called by pdv_initcam.
int pdv_set_cameratype (PdvDev *pdv_p, char *model)
 Sets the camera's type (model) string in the dependent structure.
void pdv_set_defaults (PdvDev *pdv_p)
int pdv_set_depth (PdvDev *pdv_p, int value)
 Deprecated -- instead use the combined pdv_set_depth_extdepth_dpath.
int pdv_set_depth_extdepth (PdvDev *pdv_p, int depth, int extdepth)
 Deprecated -- instead use the combined pdv_set_depth_extdepth_dpath.
int pdv_set_depth_extdepth_dpath (PdvDev *pdv_p, int depth, int extdepth, u_int dpath)
 Sets the bit depth, extended depth, and camera link data path.
int pdv_set_exposure (PdvDev *pdv_p, int value)
 Sets the exposure time, using the method defined by the directives in the camera configuration file, if set.
int pdv_set_exposure_basler202k (PdvDev *pdv_p, int value)
 set exposure (,gain, blacklevel) on basler A202K -- ref BASLER A202K Camera Manual Document ID number DA044003.
int pdv_set_exposure_duncan_ch (PdvDev *pdv_p, int value, int ch)
 Set exposure for Redlake (formerly Duncantech) DT and MS series cameras.
int pdv_set_exposure_mcl (PdvDev *pdv_p, int value)
 Set the exposure when in pulse-width mode (also known as level trigger mode).
int pdv_set_extdepth (PdvDev *pdv_p, int value)
 Deprecated -- instead use the combined pdv_set_depth_extdepth_dpath.
void pdv_set_firstpixel_counter (PdvDev *pdv_p, int ena)
 Enable hardware overwrite of first two bytes of the frame with a counter.
int pdv_set_frame_period (PdvDev *pdv_p, int period, int method)
 Set the frame period counter and enable/disable frame timing.
void pdv_set_fval_done (PdvDev *pdv_p, int enable)
 Enables frame valid done functionality on the board.
int pdv_set_gain (PdvDev *pdv_p, int value)
 Sets the gain on the input device.
int pdv_set_gain_basler202k (PdvDev *pdv_p, int valuea, int valueb)
int pdv_set_gain_ch (PdvDev *pdv_p, int value, int chan)
 This method is obsolete and should not be used.
int pdv_set_gain_duncan_ch (PdvDev *pdv_p, int value, int ch)
 Set gain for Redlake (formerly Duncantech) DT and MS series cameras.
void pdv_set_header_dma (PdvDev *pdv_p, int header_dma)
 Sets the boolean value for whether the image header is included in the DMA from the camera.
void pdv_set_header_offset (PdvDev *pdv_p, int header_offset)
 Sets the byte offset of the header data in the allocated buffer.
void pdv_set_header_position (PdvDev *pdv_p, HdrPosition header_position)
 Sets the header (or footer) position.
void pdv_set_header_size (PdvDev *pdv_p, int header_size)
 Sets the header (or footer) size, in bytes, for the device.
 pdv_set_header_type (PdvDev *pdv_p, int header_type, int irig_slave, int irig_offset, int irig_raw)
 Sets the header (or footer) type.
int pdv_set_height (PdvDev *pdv_p, int value)
 Sets height and reallocates buffers accordingly.
void pdv_set_interlace (PdvDev *pdv_p, int interlace)
 Set the interlace flag.
int pdv_set_mode (PdvDev *pdv_p, char *mode, int mcl)
 This method is obsolete and should not be used.
int pdv_set_mode_atmel (PdvDev *pdv_p, char *mode)
int pdv_set_mode_dvc (PdvDev *pdv_p, char *mode)
int pdv_set_mode_hamamatsu (PdvDev *pdv_p, char *mode)
int pdv_set_mode_kodak (PdvDev *pdv_p, char *mode)
 Obsolete.
int pdv_set_offset_basler202k (PdvDev *pdv_p, int valuea, int valueb)
int pdv_set_roi (PdvDev *pdv_p, int hskip, int hactv, int vskip, int vactv)
 Sets a rectangular region of interest, supporting cropping.
void pdv_set_serial_block_size (int newsize)
 Sets the block size for serial writes if the default of 512 is not adequate.
void pdv_set_serial_delimiters (PdvDev *pdv_p, char *prefix, char *term)
 Get the serial prefix.
int pdv_set_serial_parity (PdvDev *pdv_p, char parity)
 Sets parity to even, odd, or none.
int pdv_set_shutter_method (PdvDev *pdv_p, int method, unsigned int mcl)
 Set the device's exposure method and CC line state.
int pdv_set_slop (PdvDev *pdv_p, int slop)
int pdv_set_strobe_counters (PdvDev *pdv_p, int count, int delay, int period)
 pdv_set_strobe_counters.
int pdv_set_strobe_dac (PdvDev *pdv_p, u_int value)
 Sets the strobe DAC level.
int pdv_set_timeout (PdvDev *pdv_p, int value)
 Sets the length of time to wait for data on acquisition before timing out.
int pdv_set_waitchar (PdvDev *pdv_p, int enable, u_char wchar)
 Set serial wait character.
int pdv_set_width (PdvDev *pdv_p, int value)
 Sets width and reallocates buffers accordingly.
void pdv_setdebug (PdvDev *pdv_p, int debug)
int pdv_setsize (PdvDev *pdv_p, int width, int height)
 Sets the width and height of the image.
void pdv_setup_continuous (PdvDev *pdv_p)
 Performs setup for continuous transfers.
void pdv_setup_continuous_channel (PdvDev *pdv_p)
 Obsolete.
void pdv_setup_dma (PdvDev *pdv_p)
 Sets up device for DMA.
int pdv_shutter_method (PdvDev *pdv_p)
 Return shutter (expose) timing method.
int pdv_slop (PdvDev *pdv_p)
void pdv_start_expose (PdvDev *pdv_p)
 Start expose independent of grab - only works in continuous mode.
void pdv_start_hardware_continuous (PdvDev *pdv_p)
 Starts hardware continuous mode.
void pdv_start_image (PdvDev *pdv_p)
 Starts acquisition of a single image.
void pdv_start_images (PdvDev *pdv_p, int count)
 Starts multiple image acquisition.
void pdv_stop_continuous (PdvDev *pdv_p)
 Performs un-setup for continuous transfers.
void pdv_stop_hardware_continuous (PdvDev *pdv_p)
 Stops hardware continous mode.
int pdv_strobe (PdvDev *pdv_p, int count, int delay)
 Fires the strobe.
int pdv_strobe_method (PdvDev *pdv_p)
 check if the strobe is even valid for this FPGA, and which method is used.
int pdv_timeout_cleanup (PdvDev *pdv_p)
 Cleans up after a timeout, particularly when you've prestarted multiple buffers or if you've forced a timeout with edt_do_timeout.
int pdv_timeout_restart (PdvDev *pdv_p, int restart)
 Cleans up after a timeout, particularly when you've prestarted multiple buffers or if you've forced a timeout with edt_do_timeout.
int pdv_timeouts (PdvDev *pdv_p)
 Returns the number of times the device timed out (frame didn't transfer completely or at all) since the device was opened.
int pdv_update_from_dvc (PdvDev *pdv_p)
int pdv_update_size (PdvDev *pdv_p)
int pdv_update_values_from_camera (PdvDev *pdv_p)
 Deprecated -- Queries certain specific cameras via serial, and sets library variables for gain, black level, exposure time and binning to values based on the results of the query.
int pdv_variable_size (PdvDev *pdv_p)
 Obsolete.
unsigned char * pdv_wait_image (PdvDev *pdv_p)
 Wait for the image started by pdv_start_image, or for the next image started by pdv_start_images.
unsigned char * pdv_wait_image_raw (PdvDev *pdv_p)
 Identical to pdv_wait_image, except image data is returned directly from DMA, bypassing any post-processing that may be in effect.
unsigned char * pdv_wait_image_timed (PdvDev *pdv_p, u_int *timep)
 Identical to pdv_wait_image but also returns the time at which the DMA was complete on this image.
unsigned char * pdv_wait_image_timed_raw (PdvDev *pdv_p, u_int *timep, int doRaw)
 Identical to pdv_wait_image_timed, except the new argument doRaw specifies whether or not to perform the deinterleave.
u_char * pdv_wait_images (PdvDev *pdv_p, int count)
 Waits for the images started by pdv_start_images.
unsigned char * pdv_wait_images_raw (PdvDev *pdv_p, int count)
 Identical to the pdv_wait_images, except that it skips any image deinterleave method defined by the method_interlace config file directive.
unsigned char * pdv_wait_images_timed (PdvDev *pdv_p, int count, u_int *timep)
 Identical to pdv_wait_images but also returns the time at which the DMA was complete on the last image.
unsigned char * pdv_wait_images_timed_raw (PdvDev *pdv_p, int count, u_int *timep, int doRaw)
 Identical to pdv_wait_images_timed, except the new argument doRaw specifies whether or not to perform the deinterleave.
unsigned char * pdv_wait_last_image (PdvDev *pdv_p, int *nSkipped)
 Waits for the last image that has been acquired.
unsigned char * pdv_wait_last_image_raw (PdvDev *pdv_p, int *nSkipped, int doRaw)
 Identical to the pdv_wait_last_image, except that it provides a way to determine whether to include or bypass any image deinterleave that is enabled.
unsigned char * pdv_wait_last_image_timed (PdvDev *pdv_p, u_int *timep)
 Identical to pdv_wait_last_image, but also returns the time at which the DMA was complete on the last image.
unsigned char * pdv_wait_last_image_timed_raw (PdvDev *pdv_p, u_int *timep, int doRaw)
 Identical to pdv_wait_last_image_raw but also returns the time at which the DMA was complete on the last image.
unsigned char * pdv_wait_next_image (PdvDev *pdv_p, int *nSkipped)
 Waits for the next image, skipping any previously started images.
unsigned char * pdv_wait_next_image_raw (PdvDev *pdv_p, int *nSkipped, int doRaw)
 Identical to the pdv_wait_next_image, except that it provides a way to include or bypass any image deinterleave method defined by the method_interlace config file directive.

Variables

int Pdv_debug = 0
int Smd_rate = NOT_SET
int Smd_type = NOT_SET


Define Documentation

#define PDVWARN   PDVLIB_MSG_WARNING

libpdv.c

PCIbus Digital Imaging Capture Library Main Module

Copyright (c) 1993-2006, Engineering Design Team, Inc.

Provides a 'C' language interface to the EDT PCI bus Digital Imaging Camera/Device Capture family of products

All routines access a specific device, whose handle is created and returned by the pdv_open() routine.

Definition at line 320 of file libpdv.c.


Function Documentation

void pdv_dmy_data ( void *  buf,
int  width,
int  height,
int  depth 
)

Fills buffer buf with software generated data.

Parameters:
buf Dummy device image buffer.
width number of bytes per line
height number of lines within image buffer.
depth number of bits per pixel

Definition at line 264 of file pdv_dmy_image.c.

int pdv_enable_strobe ( PdvDev pdv_p,
int  ena 
)

enable/disable lh strobe.

if method 2, enable or disable as specified if method 1, return ok if enable specified, -1 if disable, since we can't do that with method 1

counters and DAC value will persist whether strobe is enabled or not

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
ena 1 to enable, 0 to disable

Definition at line 8224 of file libpdv.c.

int pdv_get_aperture ( PdvDev pdv_p  ) 

This method is obsolete and should not be used.

The current implementation creates a warning message and returns -1 signifying failure.

Returns:
-1 for failure, always.

Definition at line 3530 of file libpdv.c.

PdvDev* pdv_open_device ( const char *  dev_name,
int  unit,
int  channel,
int  verbose 
)

Open the pdv device, with option to suppress non-existent device console output.

pdv_open_channel calls this subroutine with the verbose argument set to 1, so this subroutine can be directly instead with verbose set to 0 if you want to suppress the console warning message that gets output if attempting to open a non-existent device. Since that's not a bad thing to know (and usually doesn't show up in Windows non-console apps anyway), we recommend using pdv_open_channel unless you specifically want to suppress those messages.

Other than the verbose argument, this is the same as pdv_open_channel see that subroutine for a full description.

Parameters:
verbose verbose output (default 1 for pdv_open_channel) or not (0)
param see pdv_open_channel for other parameters
Returns:
see pdv_open_channel

Definition at line 495 of file libpdv.c.

int pdv_set_aperture ( PdvDev pdv_p,
int  value 
)

This method is obsolete and should not be used.

The current implementation creates a warning message and returns -1 signifying failure.

Returns:
-1 for failure, always.

Definition at line 3297 of file libpdv.c.


Generated on 19 Jun 2015 by  doxygen 1.4.7