EBST_CAM
Loading...
Searching...
No Matches
Board.c File Reference

All functions for interacting with the Stresing PCIe board. More...

#include "Board.h"
#include "UIAbstractionLayer.h"
#include <sys/types.h>
#include <sys/timeb.h>
#include <math.h>
#include <stdio.h>
#include <inttypes.h>
#include "../shared_src/default_settings.h"
#include "../version.h"

Macros

#define BYTE_TO_BINARY_PATTERN   "%c%c%c%c%c%c%c%c"
 
#define BYTE_TO_BINARY(byte)
 

Functions

void SetGlobalSettings (struct measurement_settings settings)
 Set global settings struct.
 
es_status_codes InitMeasurement ()
 Initialize measurement (using board select).
 
void SetVirtualCamcnt (uint32_t drvno)
 
es_status_codes InitSoftware (uint32_t drvno)
 
es_status_codes InitPcieBoard (uint32_t drvno)
 
es_status_codes _InitMeasurement (uint32_t drvno)
 Initialize Measurement (using drvno).
 
es_status_codes SetPixelCountRegister (uint32_t drvno)
 Set pixel count.
 
es_status_codes ClearAllUserRegs (uint32_t drvno)
 Clears DAT and EC.
 
es_status_codes AbortMeasurement ()
 Use this function to abort measurement.
 
es_status_codes SetAbortMeasurementFlag ()
 Sets abortMeasurementFlag to true.
 
es_status_codes setBlockEn (uint32_t drvno)
 Sets BlockOn bit in PCIEFLAGS and notifies UI about it.
 
es_status_codes setMeasureOn (uint32_t drvno)
 Sets setMeasureOn bit in PCIEFLAGS and notifies UI about it.
 
es_status_codes resetBlockEn (uint32_t drvno)
 Resets BlockOn bit in PCIEFLAGS and notifies UI about it.
 
es_status_codes resetMeasureOn (uint32_t drvno)
 Resets setMeasureOn bit in PCIEFLAGS and notifies UI about it.
 
es_status_codes ResetDma (uint32_t drvno)
 
es_status_codes SetCamCountRegister (uint32_t drvno)
 Set cam count.
 
es_status_codes SetSensorType (uint32_t drvno, uint16_t sensor_type)
 Sets sensor type bits in register camera type.
 
es_status_codes SetCameraSystem (uint32_t drvno, uint16_t camera_system)
 Sets camera system bits in register camera type.
 
es_status_codes writeBitsS0_32 (uint32_t drvno, uint32_t data, uint32_t bitmask, uint32_t address)
 Set specified bits to 1 in S0 register at memory address.
 
es_status_codes writeBitsS0_32_allBoards (uint32_t data, uint32_t bitmask, uint32_t address)
 Set specified bits to 1 in S0 register at memory address.
 
es_status_codes writeBitsS0_8 (uint32_t drvno, uint8_t data, uint8_t bitmask, uint32_t address)
 Set specified bits to 1 in S0 register at memory address.
 
es_status_codes setBitS0_32 (uint32_t drvno, uint32_t bitnumber, uint32_t address)
 Set bit to 1 in S0 register at memory address.
 
es_status_codes setBitS0_32_allBoards (uint32_t bitnumber, uint32_t address)
 Set bit to 1 in S0 register at memory address.
 
es_status_codes setBitS0_8 (uint32_t drvno, uint32_t bitnumber, uint32_t address)
 Set bit to 1 in S0 register at memory address.
 
es_status_codes resetBitS0_32 (uint32_t drvno, uint32_t bitnumber, uint32_t address)
 Set bit to 0 in register at memory address.
 
es_status_codes resetBitS0_32_allBoards (uint32_t bitnumber, uint32_t address)
 Set bit to 0 in register at memory address.
 
es_status_codes resetBitS0_8 (uint32_t drvno, uint32_t bitnumber, uint32_t address)
 Set bit to 0 in register at memory address.
 
es_status_codes writeRegisterS0_32 (uint32_t drvno, uint32_t data, uint32_t address)
 Write 4 byte of a register in S0 space.
 
es_status_codes writeRegisterS0_32_allBoards (uint32_t data, uint32_t address)
 Write 4 bytes of a register in S0 space.
 
es_status_codes writeRegisterS0_16 (uint32_t drvno, uint16_t data, uint32_t address)
 Write 2 bytes of a register in S0 space.
 
es_status_codes writeRegisterS0_8 (uint32_t drvno, uint8_t data, uint32_t address)
 Write 1 byte of a register in S0 space.
 
es_status_codes writeRegisterS0_8_allBoards (uint8_t data, uint32_t address)
 Write the same 1 byte to a register in S0 space of all boards.
 
es_status_codes readRegisterS0_32 (uint32_t drvno, uint32_t *data, uint32_t address)
 Read 4 bytes of a register in S0 space.
 
es_status_codes readRegisterS0_32_allBoards (uint32_t **data, uint32_t address)
 Read 4 bytes of a register in S0 space of all boards.
 
es_status_codes readRegister_32_allBoards (uint32_t **data, uint32_t address)
 Reads 4 bytes on DMA area of all PCIe boards.
 
es_status_codes readRegisterS0_16 (uint32_t drvno, uint16_t *data, uint32_t address)
 Read 2 bytes of a register in S0 space.
 
es_status_codes readRegisterS0_8 (uint32_t drvno, uint8_t *data, uint32_t address)
 Read 1 byte of a register in S0 space.
 
es_status_codes ReadBitS0_32 (uint32_t drvno, uint32_t address, uint8_t bitnumber, bool *isBitHigh)
 Read 1 bit of a 4 byte s0 register.
 
es_status_codes ReadBitS0_8 (uint32_t drvno, uint32_t address, uint8_t bitnumber, bool *isBitHigh)
 Read 1 bit of 1 byte of a s0 register.
 
es_status_codes OpenShutter (uint32_t drvno)
 Open shutter for sensors with EC (exposure control) / sets IFC signal = high.
 
es_status_codes SetupFullBinning (uint32_t drvno, uint32_t lines, uint8_t vfreq)
 For FFTs: Setup full binning.
 
es_status_codes SetupVCLKReg (uint32_t drvno, uint32_t lines, uint8_t vfreq)
 Set REG VCLKCTRL for FFT sensors.
 
es_status_codes SetupVPB (uint32_t drvno, uint32_t range, uint32_t lines)
 sets Vertical Partial Binning in registers R10,R11 and R12. Only for FFT sensors.
 
es_status_codes SetPartialBinning (uint32_t drvno, uint16_t number_of_regions)
 Turn partial binning on.
 
es_status_codes ResetPartialBinning (uint32_t drvno)
 Turns ARREG off and therefore partial binning too.
 
es_status_codes DisarmScanTrigger (uint32_t drvno)
 Disarm scan trigger.
 
es_status_codes RSFifo (uint32_t drvno)
 reset FIFO and FFcounter
 
es_status_codes allocateUserMemory (uint32_t drvno)
 
es_status_codes SetDMABufRegs (uint32_t drvno)
 Set DMA register.
 
es_status_codes SetNosRegister (uint32_t drvno)
 
es_status_codes SetNobRegister (uint32_t drvno)
 
es_status_codes CloseShutter (uint32_t drvno)
 Sets the IFC bit of interface for sensors with shutter function. IFC=low.
 
es_status_codes SetSEC (uint32_t drvno, uint32_t ecin10ns)
 Exposure control (EC) signal is used for mechanical shutter or sensors with EC function.
 
es_status_codes SetTORReg (uint32_t drvno, uint8_t tor)
 Set signal of output port of PCIe card.
 
es_status_codes SetSSlope (uint32_t drvno, uint32_t sslope)
 Set the external trigger slope for scan trigger (PCI Reg CrtlA:D5 -> manual).
 
es_status_codes SetBSlope (uint32_t drvno, uint32_t slope)
 Sets slope for block trigger.
 
es_status_codes SetSTI (uint32_t drvno, uint8_t sti_mode)
 Chooses trigger input for scan trigger input (STI)
 
es_status_codes SetBTI (uint32_t drvno, uint8_t bti_mode)
 Chooses trigger input for block trigger input (BTI)
 
es_status_codes SetTimerResolution (uint32_t drvno, uint8_t resolution_mode)
 Set timer resolution.
 
es_status_codes SetSTimer (uint32_t drvno, uint32_t stime)
 Sets time for scan timer.
 
es_status_codes SetBTimer (uint32_t drvno, uint32_t btime)
 Sets time for block timer.
 
es_status_codes InitGPX (uint32_t drvno, uint32_t delay)
 Initialize the TDC-GPX chip. TDC: time delay counter option.
 
es_status_codes SetGPXCtrl (uint32_t drvno, uint8_t GPXAddress, uint32_t GPXData)
 Set GPXCtrl register.
 
es_status_codes ReadGPXCtrl (uint32_t drvno, uint8_t GPXAddress, uint32_t *GPXData)
 Read GPXCtrl register.
 
es_status_codes SetSDAT (uint32_t drvno, uint32_t datin10ns)
 Sets delay after trigger hardware register.
 
es_status_codes SetBDAT (uint32_t drvno, uint32_t datin10ns)
 Sets delay after trigger hardware register.
 
es_status_codes Use_ENFFW_protection (uint32_t drvno, bool USE_ENFFW_PROTECT)
 Protects ENFFW from cool cam status transmission. Enable with cool cam, disable with HS > 50 kHz.
 
es_status_codes DAC8568_sendData (uint32_t drvno, uint8_t location, uint8_t cameraPosition, uint8_t ctrlBits, uint8_t addrBits, uint16_t dataBits, uint8_t featureBits)
 Sends data to DAC8568.
 
es_status_codes DAC8568_setAllOutputs (uint32_t drvno, uint8_t location, uint8_t cameraPosition, uint32_t *output, bool reorder_channels)
 Sets all outputs of the DAC8568 in camera 3030 or on PCIe board.
 
es_status_codes DAC8568_setOutput (uint32_t drvno, uint8_t location, uint8_t cameraPosition, uint8_t channel, uint16_t output)
 Sets the output of the DAC8568 on PCB 2189-7.
 
es_status_codes DAC8568_enableInternalReference (uint32_t drvno, uint8_t location, uint8_t cameraPosition)
 Enable the internal reference in static mode.
 
es_status_codes SetBEC (uint32_t drvno, uint32_t bec_in_10ns)
 This function sets the register BEC.
 
es_status_codes SetXckdelay (uint32_t drvno, uint32_t xckdelay_in_10ns)
 DEPRECATED. Set XCK delay.
 
es_status_codes SetDmaRegister (uint32_t drvno, uint32_t pixel)
 Set DMA related registers like TLP mode and DMA addresses.
 
es_status_codes writeBitsDma_32 (uint32_t drvno, uint32_t data, uint32_t bitmask, uint32_t address)
 Set specified bits to 1 in DMA register at memory address.
 
es_status_codes writeBitsDma_8 (uint32_t drvno, uint8_t data, uint8_t bitmask, uint32_t address)
 Set specified bits to 1 in DMA register at memory address.
 
es_status_codes writeRegisterDma_32 (uint32_t drvno, uint32_t data, uint32_t address)
 Write 4 bytes to a register in DMA space.
 
es_status_codes writeRegisterDma_8 (uint32_t drvno, uint8_t data, uint32_t address)
 Write 1 byte to a register in DMA space.
 
es_status_codes readRegisterDma_32 (uint32_t drvno, uint32_t *data, uint32_t address)
 Read 4 bytes of a register in DMA space.
 
es_status_codes readRegisterDma_8 (uint32_t drvno, uint8_t *data, uint32_t address)
 Read 1 byte of a register in DMA space.
 
es_status_codes SetDmaStartMode (uint32_t drvno, bool start_by_hardware)
 Set DMA Start Mode.
 
es_status_codes StartMeasurement ()
 This function is starting the measurement and returns when the measurement is done.
 
es_status_codes ReturnStartMeasurement (es_status_codes status)
 This is a helper function to return startMeasurement.
 
es_status_codes FindCam (uint32_t drvno)
 Test if SFP module is there and fiber is linked up.
 
es_status_codes ResetHardwareCounter (uint32_t drvno)
 Reset the hardware block counter and scan counter.
 
es_status_codes SetHardwareTimerStopMode (uint32_t drvno, bool stop_by_hardware)
 Reset the internal intr collect counter.
 
es_status_codes pulseBitS0_32 (uint32_t drvno, uint32_t bitnumber, uint32_t address, int64_t duration_in_microseconds)
 Pulse bit () -> 1 -> 0) in S0 register at memory address.
 
es_status_codes pulseBitS0_8 (uint32_t drvno, uint32_t bitnumber, uint32_t address, int64_t duration_in_microseconds)
 Pulse bit () -> 1 -> 0) in S0 register at memory address.
 
es_status_codes waitForBlockTrigger (uint32_t drvno)
 Wait in loop until block trigger occurs.
 
es_status_codes countBlocksByHardware (uint32_t drvno)
 Sends signal to hardware to count blocks.
 
es_status_codes ArmScanTrigger (uint32_t drvno)
 Sets Scan Timer on.
 
es_status_codes DoSoftwareTrigger (uint32_t drvno)
 Triggers one camera read by calling this function.
 
es_status_codes GetArmScanTriggerStatus (uint32_t drvno, bool *on)
 Checks if timer is active (Bit30 of XCK-Reg).
 
es_status_codes GetLastBufPart (uint32_t drvno)
 For the rest part of the buffer.
 
es_status_codes InitBoard ()
 Initializes the PCIe board.
 
es_status_codes InitDriver ()
 Initialize the driver.
 
es_status_codes ExitDriver ()
 Exit driver. Call this before exiting software for cleanup.
 
es_status_codes CopyOneSample (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera, uint16_t *pdest)
 Copy the data of a single sample to pdest.
 
es_status_codes CopyOneBlock (uint32_t drvno, uint16_t block, uint16_t *pdest)
 Copy the data of a single block to pdest.
 
es_status_codes CopyAllData (uint32_t drvno, uint16_t *pdest)
 Copy the data of the complete measurement to pdest.
 
es_status_codes CopyDataArbitrary (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera, uint32_t pixel, size_t length_in_pixel, uint16_t *pdest)
 Copy the data of a custom length to pdest.
 
es_status_codes GetIndexOfPixel (uint32_t drvno, uint16_t pixel, uint32_t sample, uint32_t block, uint16_t camera, uint64_t *pIndex)
 Returns the index of a pixel located in userBuffer.
 
es_status_codes GetPixelPointer (uint32_t drvno, uint16_t pixel, uint32_t sample, uint32_t block, uint16_t camera, uint16_t **pdest, size_t *bytes_to_end_of_buffer)
 Returns the address of a specific pixel.
 
es_status_codes GetAllDataPointer (uint32_t drvno, uint16_t **pdest, size_t *bytes_to_end_of_buffer)
 Returns the address of the data buffer.
 
es_status_codes GetOneBlockPointer (uint32_t drvno, uint32_t block, uint16_t **pdest, size_t *bytes_to_end_of_buffer)
 Returns the address of a specific block.
 
es_status_codes GetOneSamplePointer (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera, uint16_t **pdest, size_t *bytes_to_end_of_buffer)
 Returns the address of a specific sample.
 
double CalcMeasureTimeInSeconds (uint32_t nos, uint32_t nob, double exposure_time_in_ms)
 Calculate the theoretical time needed for one measurement.
 
double CalcRamUsageInMB (uint32_t nos, uint32_t nob)
 Calculate needed RAM in MB for given nos and nob.
 
es_status_codes CalcTrms (uint32_t drvno, uint32_t firstSample, uint32_t lastSample, uint32_t TRMS_pixel, uint16_t CAMpos, double *mwf, double *trms)
 Calculate TRMS noise value of one pixel.
 
void GetRmsVal (uint32_t nos, uint16_t *TRMSVals, double *mwf, double *trms)
 
es_status_codes CheckFifoValid (uint32_t drvno, bool *valid)
 Checks content of FIFO.
 
es_status_codes CheckFifoOverflow (uint32_t drvno, bool *overflow)
 Check ovl flag (overflow of FIFO).
 
es_status_codes CheckFifoEmpty (uint32_t drvno, bool *empty)
 Check empty flag (FIFO empty).
 
es_status_codes CheckFifoFull (uint32_t drvno, bool *full)
 Check full flag (FIFO full).
 
es_status_codes GetMeasureOn (uint32_t drvno, bool *measureOn)
 Check if measure on bit is set.
 
es_status_codes OutTrigLow (uint32_t drvno)
 Reset trigger out(Reg CtrlA:D3) of PCI board. Can be used to control timing issues in software.
 
es_status_codes OutTrigHigh (uint32_t drvno)
 Set trigger out(Reg CtrlA:D3) of PCIe board. Can be used to control timing issues in software.
 
es_status_codes OutTrigPulse (uint32_t drvno, int64_t pulseWidthInMicroseconds)
 Pulses trigger out(Reg CtrlA:D3) of PCI board. Can be used to control timing issues in software.
 
es_status_codes readBlockTriggerState (uint32_t drvno, uint8_t btrig_ch, bool *state)
 Reads the binary state of an ext. trigger input.
 
es_status_codes WaitForBlockDone ()
 Returns when block on bit is 0.
 
es_status_codes WaitForMeasureDone ()
 Returns when measure on bit is 0.
 
es_status_codes dumpS0Registers (uint32_t drvno, char **stringPtr)
 Read all S0 registers and write them to a string in hex.
 
es_status_codes dumpHumanReadableS0Registers (uint32_t drvno, char **stringPtr)
 Read all S0 registers and write them to a string in a human readable format.
 
es_status_codes dumpDmaRegisters (uint32_t drvno, char **stringPtr)
 Read all DMA registers and write them to a string in hex.
 
es_status_codes dumpTlpRegisters (uint32_t drvno, char **stringPtr)
 Read all TLP registers and write them to a string.
 
es_status_codes _AboutGPX (uint32_t drvno, char **stringPtr)
 Reads registers 0 to 12 of TDC-GPX chip. Time delay counter option.
 
es_status_codes dumpMeasurementSettings (char **stringPtr)
 Dump all measurement settings to a string.
 
es_status_codes dumpCameraSettings (uint32_t drvno, char **stringPtr)
 Dump all camera settings to a string.
 
es_status_codes dumpPciRegisters (uint32_t drvno, char **stringPtr)
 Read all PCIe registers and write them to a string.
 
es_status_codes _AboutDrv (uint32_t drvno, char **stringPtr)
 Return infos about the PCIe board.
 
es_status_codes ResetDSC (uint32_t drvno, uint8_t DSCNumber)
 reset Delay Stage Counter
 
es_status_codes SetDIRDSC (uint32_t drvno, uint8_t DSCNumber, bool dir)
 set direction of Delay Stage Counter
 
es_status_codes GetDSC (uint32_t drvno, uint8_t DSCNumber, uint32_t *ADSC, uint32_t *LDSC)
 return all values of Delay Stage Counter
 
void PollDmaBufferToUserBuffer (uint32_t *drvno_p)
 This function copies valid data from DMA buffer to user buffer.
 
void GetCurrentScanNumber (uint32_t drvno, int64_t *sample, int64_t *block)
 Gives scan and block number of the last scan written to userBuffer.
 
void GetScanNumber (uint32_t drvno, int64_t offset, int64_t *sample, int64_t *block)
 Gives scan and block number of the last scan written to userBuffer.
 
es_status_codes SetSticnt (uint32_t drvno, uint8_t divider)
 Set the scan trigger input divider.
 
es_status_codes SetBticnt (uint32_t drvno, uint8_t divider)
 Set the block trigger input divider.
 
es_status_codes SetTocnt (uint32_t drvno, uint8_t divider)
 Set the trigger output divider.
 
void FillUserBufferWithDummyData (uint32_t drvno)
 This function inserts data to user buffer for developing purpose.
 
es_status_codes GetIsTdc (uint32_t drvno, bool *isTdc)
 Read TDC flag in PCIEFLAGS register.
 
es_status_codes GetIsDsc (uint32_t drvno, bool *isDsc)
 Read DSC flag in PCIEFLAGS register.
 
void GetVerifiedDataDialog (struct verify_data_parameter *vd, char **resultString)
 Check the consistency of the file given in vd and return the results in resultString.
 
void SetContinuousMeasurement (bool on)
 Control looping the measurement.
 
es_status_codes GetCameraStatusOverTemp (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, bool *overTemp)
 This function returns the bit overTemp of a specific scan.
 
es_status_codes GetCameraStatusTempGood (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, bool *tempGood)
 This function returns the bit tempGood of a specific scan.
 
es_status_codes GetBlockIndex (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, uint32_t *blockIndex)
 This function returns the block index of a specific scan.
 
es_status_codes GetScanIndex (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, uint32_t *scanIndex)
 This function returns the scan index of a specific scan.
 
es_status_codes GetS1State (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, bool *state)
 This function returns the bit S1 state of a specific scan.
 
es_status_codes GetS2State (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, bool *state)
 This function returns the bit S2 state of a specific scan.
 
es_status_codes GetImpactSignal1 (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, uint32_t *impactSignal)
 This function returns the impact signal 1 of a specific scan.
 
es_status_codes GetImpactSignal2 (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, uint32_t *impactSignal)
 This function returns the impact signal 2 of a specific scan.
 
es_status_codes GetAllSpecialPixelInformation (uint32_t drvno, uint32_t sample, uint32_t block, uint16_t camera_pos, struct special_pixels *sp)
 This function returns the all special pixel information of a specific scan.
 
es_status_codes ReadScanFrequencyBit (uint32_t drvno, bool *scanFrequencyTooHigh)
 Reads the ScanFrequency bit and checks if its high or low.
 
es_status_codes ResetScanFrequencyBit (uint32_t drvno)
 Resets the ScanFrequency bit.
 
es_status_codes ReadBlockFrequencyBit (uint32_t drvno, bool *blockFrequencyTooHigh)
 Reads the BlockFrequency bit and checks if its high or low.
 
es_status_codes ResetBlockFrequencyBit (uint32_t drvno)
 Resets the BlockFrequency bit.
 
es_status_codes CopyOneBlockOfOneCamera (uint32_t drvno, uint32_t block, uint16_t camera, uint16_t *pdest)
 Copy the data of one block of one camera to pdest.
 
void SetAllInterruptsDone (uint32_t drvno)
 
es_status_codes SetupROI (uint32_t drvno, uint16_t number_of_regions, uint32_t lines, uint8_t *region_size, uint8_t vfreq)
 Initializes region of interest.
 
es_status_codes SetupArea (uint32_t drvno, uint32_t lines_binning, uint8_t vfreq)
 For FFTs: Setup area mode.
 
es_status_codes SetS1S2ReadDelay (uint32_t drvno)
 This functions sets the register S1S2ReadDealy with the setting camera_settings::s1s2_read_delay_in_10ns.
 
es_status_codes SaveMeasurementDataToFile (const char *filename)
 Export the measurement data to a file.
 
es_status_codes ImportMeasurementDataFromFile (const char *filename)
 TODO. missing documentation.
 
es_status_codes ImportMeasurementDataFromFileBIN (const char *filename)
 
es_status_codes SaveMeasurementDataToFileHDF5 (const char *filename)
 Exports the measurement data to a HDF5 file.
 
hid_t CreateNumericAttribute (hid_t parent_object_id, char *attr_name, hid_t goal_type, hid_t dataspace, void *data)
 
hid_t CreateStringAttribute (hid_t parent_object_id, char *attr_name, hid_t dataspace, void *data)
 
es_status_codes GetXckLength (uint32_t drvno, uint32_t *xckLengthIn10ns)
 Get the high time duration of XCK from the S0 register S0Addr_XCKLEN.
 
es_status_codes GetXckPeriod (uint32_t drvno, uint32_t *xckPeriodIn10ns)
 Get pos edge to pos egde time of XCK time from the S0 register S0Addr_XCK_PERIOD.
 
es_status_codes GetBonLength (uint32_t drvno, uint32_t *bonLengthIn10ns)
 Get the high time duration of BON from the S0 register S0Addr_BONLEN.
 
es_status_codes GetBonPeriod (uint32_t drvno, uint32_t *bonPeriodIn10ns)
 Get the pos edge to pos edge time of BON from the S0 register S0Addr_BON_PERIOD.
 
es_status_codes GetPcieCardVersion (uint32_t drvno, uint16_t *major_version, uint16_t *minor_version)
 Get the PCIe card firmware version number.
 
bool PcieCardVersionIsGreaterThan (uint32_t drvno, uint16_t major_version, uint16_t minor_version)
 
bool PcieCardVersionIsSmallerThan (uint32_t drvno, uint16_t major_version, uint16_t minor_version)
 
bool PcieCardVersionIsEqual (uint32_t drvno, uint16_t major_version, uint16_t minor_version)
 
es_status_codes GetBlockOn (uint32_t drvno, bool *blockOn)
 Get the block on bit from the PCIe flags register.
 
es_status_codes GetScanTriggerDetected (uint32_t drvno, bool *detected)
 Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected.
 
es_status_codes GetBlockTriggerDetected (uint32_t drvno, bool *detected)
 Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected.
 
es_status_codes ResetScanTriggerDetected (uint32_t drvno)
 Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected to 0.
 
es_status_codes ResetBlockTriggerDetected (uint32_t drvno)
 Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected to 0.
 
es_status_codes WaitForBlockOn (uint32_t drvno)
 
es_status_codes SetShiftS1S2ToNextScan (uint32_t drvno)
 
void manipulateData (uint32_t drvno, uint16_t *startAddress, uint32_t numberOfScansToManipulate)
 Manipulate the incoming data buffer with a preset polynomial.
 
void clearKeyStates ()
 
es_status_codes SetGeneralOutput (uint32_t drvno, uint8_t output, bool state)
 Control the general outputs of the PCIe card addition board.
 
es_status_codes SetShutterStates (uint32_t drvno, uint16_t shutter_states)
 Sets all shutter states in one call.
 
es_status_codes SetStateControlRegister (uint32_t drvno, uint16_t state)
 
es_status_codes SetManualState (uint32_t drvno, bool state)
 

Detailed Description

All functions for interacting with the Stresing PCIe board.

All functions are written in a platform independent way. All stuff that needs to be done in a platform dependent way is done in Board_ll.h.

Author
Gerhard Stresing, Bastian Brabec, Florian Hahn
Date
before February 2016

Macro Definition Documentation

◆ BYTE_TO_BINARY

#define BYTE_TO_BINARY ( byte)
Value:
(byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0')

◆ BYTE_TO_BINARY_PATTERN

#define BYTE_TO_BINARY_PATTERN   "%c%c%c%c%c%c%c%c"

Function Documentation

◆ _AboutDrv()

es_status_codes _AboutDrv ( uint32_t drvno,
char ** stringPtr )

Return infos about the PCIe board.

  • win1 : version of driver
  • win2 : ID = 53xx
  • win3 : length of space0 BAR =0x3f
  • win4 : vendor ID = EBST
  • win5 : PCI board version (same as label on PCI board)
    Parameters
    [in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
    [out]stringPtrstring with driver information is given back here
    Returns
    es_status_codes

◆ _AboutGPX()

es_status_codes _AboutGPX ( uint32_t drvno,
char ** stringPtr )

Reads registers 0 to 12 of TDC-GPX chip. Time delay counter option.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]stringPtr
Returns
es_status_codes

◆ _InitMeasurement()

es_status_codes _InitMeasurement ( uint32_t drvno)

Initialize Measurement (using drvno).

Returns
es_status_codes

◆ AbortMeasurement()

es_status_codes AbortMeasurement ( )

Use this function to abort measurement.

Returns
es_status_codes

◆ allocateUserMemory()

es_status_codes allocateUserMemory ( uint32_t drvno)

Allocate user memory.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ArmScanTrigger()

es_status_codes ArmScanTrigger ( uint32_t drvno)

Sets Scan Timer on.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ CalcMeasureTimeInSeconds()

double CalcMeasureTimeInSeconds ( uint32_t nos,
uint32_t nob,
double exposure_time_in_ms )

Calculate the theoretical time needed for one measurement.

nos * nob * exposure_time_in_ms / 1000

Parameters
[in]nosnumber of samples
[in]nobnumber of blocks
[out]exposure_time_in_msexposure time in ms
Returns
time in seconds

◆ CalcRamUsageInMB()

double CalcRamUsageInMB ( uint32_t nos,
uint32_t nob )

Calculate needed RAM in MB for given nos and nob.

Parameters
[in]nosnumber of samples
[in]nobnumber of blocks
Returns
RAM in MB

◆ CalcTrms()

es_status_codes CalcTrms ( uint32_t drvno,
uint32_t firstSample,
uint32_t lastSample,
uint32_t TRMS_pixel,
uint16_t CAMpos,
double * mwf,
double * trms )

Calculate TRMS noise value of one pixel.

Calculates RMS of TRMS_pixel in the range of samples from firstSample to lastSample. Only calculates RMS from one block.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]firstSamplestart sample to calculate RMS. 0...(nos-2). Typical value: 10, to skip overexposed first samples
[in]lastSamplelast sample to calculate RMS. firstSample+1...(nos-1).
[in]TRMS_pixelpixel for calculating noise (0...(PIXEL-1))
[in]CAMposindex for camcount (0...(CAMCNT-1))
[out]mwfpointer for mean value
[out]trmspointer for noise
Returns
es_status_codes

◆ CheckFifoEmpty()

es_status_codes CheckFifoEmpty ( uint32_t drvno,
bool * empty )

Check empty flag (FIFO empty).

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]emptyTODO: missing doc
Returns
es_status_codes

◆ CheckFifoFull()

es_status_codes CheckFifoFull ( uint32_t drvno,
bool * full )

Check full flag (FIFO full).

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]fullTODO missing doc
Returns
es_status_codes

◆ CheckFifoOverflow()

es_status_codes CheckFifoOverflow ( uint32_t drvno,
bool * overflow )

Check ovl flag (overflow of FIFO).

If occurred stays active until a call of FFRS.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]overflowIs true (not 0) if overflow occurred (linecounter>0).
Returns
es_status_codes

◆ CheckFifoValid()

es_status_codes CheckFifoValid ( uint32_t drvno,
bool * valid )

Checks content of FIFO.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]validIs true (not 0) if FIFO keeps >= 1 complete lines (linecounter>0).
Returns
es_status_codes

◆ ClearAllUserRegs()

es_status_codes ClearAllUserRegs ( uint32_t drvno)

Clears DAT and EC.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ clearKeyStates()

void clearKeyStates ( )

◆ CloseShutter()

es_status_codes CloseShutter ( uint32_t drvno)

Sets the IFC bit of interface for sensors with shutter function. IFC=low.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ CopyAllData()

es_status_codes CopyAllData ( uint32_t drvno,
uint16_t * pdest )

Copy the data of the complete measurement to pdest.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]pdestPointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos * camcnt * nob
Returns
es_status_codes

◆ CopyDataArbitrary()

es_status_codes CopyDataArbitrary ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera,
uint32_t pixel,
size_t length_in_pixel,
uint16_t * pdest )

Copy the data of a custom length to pdest.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number ( 0...(nos - 1) )
[in]blockblock number ( 0...(nob - 1) )
[in]cameracamera number ( 0...(CAMCNT - 1) )
[in]pixelposition in one scan (0...(PIXEL-1))
[in]length_in_pixelNumber of pixels to copy. When length_in_pixel exceeds the end of the data buffer the function returns es_parameter_out_of_range.
[out]pdestPointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * length_in_pixel
Returns
es_status_codes

◆ CopyOneBlock()

es_status_codes CopyOneBlock ( uint32_t drvno,
uint16_t block,
uint16_t * pdest )

Copy the data of a single block to pdest.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]blockblock number ( 0...(nob - 1) )
[out]pdestPointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos * camcnt
Returns
es_status_codes

◆ CopyOneBlockOfOneCamera()

es_status_codes CopyOneBlockOfOneCamera ( uint32_t drvno,
uint32_t block,
uint16_t camera,
uint16_t * pdest )

Copy the data of one block of one camera to pdest.

If camera_settings::camcnt is 1, use CopyOneBlock instead. This function copies the data sample by sample because the data of one block of one camera is not stored in a contiguous memory block if camcnt is greater than 1.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]blockblock number ( 0...(nob - 1) )
[in]cameracamera number ( 0...(CAMCNT - 1) )
[out]pdestPointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos
Returns
es_status_codes

◆ CopyOneSample()

es_status_codes CopyOneSample ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera,
uint16_t * pdest )

Copy the data of a single sample to pdest.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number ( 0...(nos - 1) )
[in]blockblock number ( 0...(nob - 1) )
[in]cameracamera number ( 0...(CAMCNT - 1) )
[out]pdestPointer where the data will be written to. Make sure that the size is >= sizeof(uint16_t) * pixel
Returns
es_status_codes

◆ countBlocksByHardware()

es_status_codes countBlocksByHardware ( uint32_t drvno)

Sends signal to hardware to count blocks.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ CreateNumericAttribute()

hid_t CreateNumericAttribute ( hid_t parent_object_id,
char * attr_name,
hid_t goal_type,
hid_t dataspace,
void * data )

◆ CreateStringAttribute()

hid_t CreateStringAttribute ( hid_t parent_object_id,
char * attr_name,
hid_t dataspace,
void * data )

◆ DAC8568_enableInternalReference()

es_status_codes DAC8568_enableInternalReference ( uint32_t drvno,
uint8_t location,
uint8_t cameraPosition )

Enable the internal reference in static mode.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
locationSwitch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details.
cameraPositionThis is describing the camera position when there are multiple cameras in line. Possible values: 0....8. This parameter is only used when location == DAC8568_camera.
Returns
es_status_codes

◆ DAC8568_sendData()

es_status_codes DAC8568_sendData ( uint32_t drvno,
uint8_t location,
uint8_t cameraPosition,
uint8_t ctrlBits,
uint8_t addrBits,
uint16_t dataBits,
uint8_t featureBits )

Sends data to DAC8568.

Mapping of bits in DAC8568: 4 prefix, 4 control, 4 address, 16 data, 4 feature.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
locationSwitch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details.
cameraPositionThis is describing the camera position when there are multiple cameras in line. Possible values: 0....8. This parameter is only used when location == DAC8568_camera.
ctrlBits4 control bits
addrBits4 address bits
dataBits16 data bits
featureBits4 feature bits
Returns
es_status_codes

◆ DAC8568_setAllOutputs()

es_status_codes DAC8568_setAllOutputs ( uint32_t drvno,
uint8_t location,
uint8_t cameraPosition,
uint32_t * output,
bool reorder_channels )

Sets all outputs of the DAC8568 in camera 3030 or on PCIe board.

Use this function to set the outputs, because it is resorting the channel numeration correctly.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]locationSwitch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details.
[in]cameraPositionThis is describing the camera position when there are multiple cameras in line. Possible values: 0....8. This parameter is only used when location == DAC8568_camera.
[in]outputall output values that will be converted to analog voltage (0 ... 0xFFFF)
[in]reorder_channelsused to reorder DAC channels for high speed camera
Returns
es_status_codes

◆ DAC8568_setOutput()

es_status_codes DAC8568_setOutput ( uint32_t drvno,
uint8_t location,
uint8_t cameraPosition,
uint8_t channel,
uint16_t output )

Sets the output of the DAC8568 on PCB 2189-7.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]locationSwitch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details.
[in]cameraPositionThis is describing the camera position when there are multiple cameras in line. Possible values: 0....8. This parameter is only used when location == DAC8568_camera.
[in]channelselect one of eight output channel (0 ... 7)
[in]outputoutput value that will be converted to analog voltage (0 ... 0xFFFF)
Returns
es_status_codes

◆ DisarmScanTrigger()

es_status_codes DisarmScanTrigger ( uint32_t drvno)

Disarm scan trigger.

Clear Bit30 of XCK-Reg: 0= timer off

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ DoSoftwareTrigger()

es_status_codes DoSoftwareTrigger ( uint32_t drvno)

Triggers one camera read by calling this function.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ dumpCameraSettings()

es_status_codes dumpCameraSettings ( uint32_t drvno,
char ** stringPtr )

Dump all camera settings to a string.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpDmaRegisters()

es_status_codes dumpDmaRegisters ( uint32_t drvno,
char ** stringPtr )

Read all DMA registers and write them to a string in hex.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpHumanReadableS0Registers()

es_status_codes dumpHumanReadableS0Registers ( uint32_t drvno,
char ** stringPtr )

Read all S0 registers and write them to a string in a human readable format.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpMeasurementSettings()

es_status_codes dumpMeasurementSettings ( char ** stringPtr)

Dump all measurement settings to a string.

Parameters
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpPciRegisters()

es_status_codes dumpPciRegisters ( uint32_t drvno,
char ** stringPtr )

Read all PCIe registers and write them to a string.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpS0Registers()

es_status_codes dumpS0Registers ( uint32_t drvno,
char ** stringPtr )

Read all S0 registers and write them to a string in hex.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ dumpTlpRegisters()

es_status_codes dumpTlpRegisters ( uint32_t drvno,
char ** stringPtr )

Read all TLP registers and write them to a string.

Parameters
[in]drvnoPCIe board identifier
[out]stringPtrPointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer.
Returns
es_status_codes

◆ ExitDriver()

es_status_codes ExitDriver ( )

Exit driver. Call this before exiting software for cleanup.

Returns
es_status_codes

◆ FillUserBufferWithDummyData()

void FillUserBufferWithDummyData ( uint32_t drvno)

This function inserts data to user buffer for developing purpose.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0

◆ FindCam()

es_status_codes FindCam ( uint32_t drvno)

Test if SFP module is there and fiber is linked up.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ GetAllDataPointer()

es_status_codes GetAllDataPointer ( uint32_t drvno,
uint16_t ** pdest,
size_t * bytes_to_end_of_buffer )

Returns the address of the data buffer.

It is only safe to read as much data until the end of the buffer is reached. That is determined by bytes_to_end_of_buffer. For this function bytes_to_end_of_buffer equals the size of the complete buffer (= nos * nob * pixel * camcnt * 2). The address you get is valid until the next call of InitMeasurement. The data behind the address changes every measurement cycle when continuous mode is on or after each call of StartMeasurement.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]pdestPointer to get the pointer of the data buffer. When NULL, this functions returns es_invalid_pointer.
[out]bytes_to_end_of_bufferPointer to get the number of bytes to the end of the buffer. This is the size in bytes of the whole measurement data memory for one board. When NULL, this parameter is ignored.
Returns
es_status_codes

◆ GetAllSpecialPixelInformation()

es_status_codes GetAllSpecialPixelInformation ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
struct special_pixels * sp )

This function returns the all special pixel information of a specific scan.

The information impact signal 2 is given in the special pixels pixel_impact_signal_2_low and pixel_impact_signal_2_high. Impact signal 2 is either TDC 2 or DSC 2, depending on the PCIe daughter board.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]spstruct special_pixels Pointer to struct special_pixel, where all special pixel information will be written.
Returns
es_status_codes

◆ GetArmScanTriggerStatus()

es_status_codes GetArmScanTriggerStatus ( uint32_t drvno,
bool * on )

Checks if timer is active (Bit30 of XCK-Reg).

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
on
Returns
es_status_codes

◆ GetBlockIndex()

es_status_codes GetBlockIndex ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
uint32_t * blockIndex )

This function returns the block index of a specific scan.

The information block index is given in the special pixels pixel_block_index_low and pixel_block_index_high_s1_s2.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]blockIndexPointer to a uint32_t, where the information block index will be written. Block index is a 30 bit counter, so the highest two bits are not used.
Returns
es_status_codes

◆ GetBlockOn()

es_status_codes GetBlockOn ( uint32_t drvno,
bool * blockOn )

Get the block on bit from the PCIe flags register.

Since the block on bit position was change in 222.14 this function looks at a different bit depending on the firmware version.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]blockOnPointer to a bool, where the block on bit will be written.
Returns
es_status_codes

◆ GetBlockTriggerDetected()

es_status_codes GetBlockTriggerDetected ( uint32_t drvno,
bool * detected )

Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]detectedPointer to a bool, where the block trigger detected bit will be written.
Returns
es_status_codes

◆ GetBonLength()

es_status_codes GetBonLength ( uint32_t drvno,
uint32_t * bonLengthIn10ns )

Get the high time duration of BON from the S0 register S0Addr_BONLEN.

The signal is measured once per measurement. The fist valid value can be read after the first completed BON.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]bonLengthIn10nspointer to uint32 where the BON length is returned
  • min: 0
  • step: 1 => 10 ns
  • max: 0xFFFFFFFF = 4,294,967,295 => 42,949,672,950 ns
Returns
es_status_codes

◆ GetBonPeriod()

es_status_codes GetBonPeriod ( uint32_t drvno,
uint32_t * bonPeriodIn10ns )

Get the pos edge to pos edge time of BON from the S0 register S0Addr_BON_PERIOD.

The signal is measured once per measurement. The fist valid value can be read after the start of the second BON.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]bonPeriodIn10nspointer to uint32 where the BON period is returned
  • min: 0
  • step: 1 => 10 ns
  • max: 0xFFFFFFFF = 4,294,967,295 => 42,949,672,950 ns
Returns
es_status_codes

◆ GetCameraStatusOverTemp()

es_status_codes GetCameraStatusOverTemp ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
bool * overTemp )

This function returns the bit overTemp of a specific scan.

The information over temperature is given in the special pixel camera status (pixel_camera_status) in bit pixel_camera_status_bit_over_temp.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]overTempPointer to a bool, where the information overTemp will be written. true - over temperature detected, false - no over temperature detected
Returns
es_status_codes

◆ GetCameraStatusTempGood()

es_status_codes GetCameraStatusTempGood ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
bool * tempGood )

This function returns the bit tempGood of a specific scan.

The information temperature good is given in the special pixel camera status (pixel_camera_status) in bit pixel_camera_status_bit_temp_good. This bit is used only in cooled cameras.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]tempGoodPointer to a bool, where the information tempGood will be written. true - target temperature reached, false - target temperature not reached
Returns
es_status_codes

◆ GetCurrentScanNumber()

void GetCurrentScanNumber ( uint32_t drvno,
int64_t * sample,
int64_t * block )

Gives scan and block number of the last scan written to userBuffer.

When settings parameter camera_settings::use_software_polling is true this function converts scanCounterTotal to scan and block. This is necessary, because scanCounterTotal is just counting each scan not regarding camcnt and blocks. When camera_settings::use_software_polling is false the scan and block number of the last interrupt is given.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]sampleScan number of the last scan in userBuffer. -1 when no scan has been written yet, otherwise 0...(nos-1)
[out]blockBlock number of the last scan in userBuffer. -1 when no scans has been written yet, otherwise 0...(nob-1)

◆ GetDSC()

es_status_codes GetDSC ( uint32_t drvno,
uint8_t DSCNumber,
uint32_t * ADSC,
uint32_t * LDSC )

return all values of Delay Stage Counter

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]DSCNumber1: DSC 1; 2: DSC 2
[out]ADSCcurrent DSC
[out]LDSClast DSC
Returns
es_status_codes

◆ GetImpactSignal1()

es_status_codes GetImpactSignal1 ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
uint32_t * impactSignal )

This function returns the impact signal 1 of a specific scan.

The information impact signal 1 is given in the special pixels pixel_impact_signal_1_low and pixel_impact_signal_1_high. Impact signal 1 is either TDC 1 or DSC 1, depending on the PCIe daughter board.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]impactSignalPointer to a uint32_t, where the information impact signal will be written.
Returns
es_status_codes

◆ GetImpactSignal2()

es_status_codes GetImpactSignal2 ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
uint32_t * impactSignal )

This function returns the impact signal 2 of a specific scan.

The information impact signal 2 is given in the special pixels pixel_impact_signal_2_low and pixel_impact_signal_2_high. Impact signal 2 is either TDC 2 or DSC 2, depending on the PCIe daughter board.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]impactSignalPointer to a uint32_t, where the information impact signal will be written.
Returns
es_status_codes

◆ GetIndexOfPixel()

es_status_codes GetIndexOfPixel ( uint32_t drvno,
uint16_t pixel,
uint32_t sample,
uint32_t block,
uint16_t camera,
uint64_t * pIndex )

Returns the index of a pixel located in userBuffer.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
pixelposition in one scan (0...(PIXEL-1))
sampleposition in samples (0...(nos-1))
blockposition in blocks (0...(nob-1))
cameraposition in camera count (0...(CAMCNT-1)
pIndexPointer to index of pixel.
Returns
es_status_codes

◆ GetIsDsc()

es_status_codes GetIsDsc ( uint32_t drvno,
bool * isDsc )

Read DSC flag in PCIEFLAGS register.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]isDscDSC flag is written to this bool*. TRUE: DSC board detected, FALSE: no DSC board detected
Returns
es_status_codes

◆ GetIsTdc()

es_status_codes GetIsTdc ( uint32_t drvno,
bool * isTdc )

Read TDC flag in PCIEFLAGS register.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]isTdcTDC flag is written to this bool*. TRUE: TDC board detected, FALSE: no TDC board detected
Returns
es_status_codes

◆ GetLastBufPart()

es_status_codes GetLastBufPart ( uint32_t drvno)

For the rest part of the buffer.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ GetMeasureOn()

es_status_codes GetMeasureOn ( uint32_t drvno,
bool * measureOn )

Check if measure on bit is set.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]measureOnTrue when measureon bit is set.
Returns
es_status_codes

◆ GetOneBlockPointer()

es_status_codes GetOneBlockPointer ( uint32_t drvno,
uint32_t block,
uint16_t ** pdest,
size_t * bytes_to_end_of_buffer )

Returns the address of a specific block.

It is only safe to read as much data until the end of the buffer is reached. That is determined by bytes_to_end_of_buffer. For this function bytes_to_end_of_buffer is at least the size of one block (= nos * pixel * camcnt * 2). The address you get is valid until the next call of InitMeasurement. The data behind the address changes every measurement cycle when continuous mode is on or after each call of StartMeasurement.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]blockposition in blocks (0...(nob-1))
[out]pdestPointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer.
[out]bytes_to_end_of_bufferPointer to get the number of bytes to the end of the buffer. This is the size in bytes of the buffer from the position you are asking for and the end of the buffer. When NULL, this parameter is ignored.
Returns
es_status_codes

◆ GetOneSamplePointer()

es_status_codes GetOneSamplePointer ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera,
uint16_t ** pdest,
size_t * bytes_to_end_of_buffer )

Returns the address of a specific sample.

It is only safe to read as much data until the end of the buffer is reached. That is determined by bytes_to_end_of_buffer. For this fuction bytes_to_end_of_buffer is a least the size of scan (= pixel * 2). The address you get is valid until the next call of InitMeasurement. The data behind the address changes every measurement cycle when continuous mode is on or after each call of StartMeasurement.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]sampleposition in samples (0...(nos-1))
[in]blockposition in blocks (0...(nob-1))
[in]cameraposition in camera count (0...(CAMCNT-1))
[out]pdestPointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer.
[out]bytes_to_end_of_bufferPointer to get the number of bytes to the end of the buffer. This is the size in bytes of the buffer from the position you are asking for and the end of the buffer. When NULL, this parameter is ignored.
Returns
es_status_codes

◆ GetPcieCardVersion()

es_status_codes GetPcieCardVersion ( uint32_t drvno,
uint16_t * major_version,
uint16_t * minor_version )

Get the PCIe card firmware version number.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
major_versionPointer to a uint16_t, where the major version number will be written.
minor_versionPointer to a uint16_t, where the minor version number will be written.
Returns
es_status_codes

◆ GetPixelPointer()

es_status_codes GetPixelPointer ( uint32_t drvno,
uint16_t pixel,
uint32_t sample,
uint32_t block,
uint16_t camera,
uint16_t ** pdest,
size_t * bytes_to_end_of_buffer )

Returns the address of a specific pixel.

It is only safe to read as much data until the end of the buffer is reached. That is determined by bytes_to_end_of_buffer. It is always safe to read 2 bytes. The address you get is valid until the next call of InitMeasurement. The data behind the address changes every measurement cycle when continuous mode is on or after each call of StartMeasurement.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]pixelposition in one scan (0...(PIXEL-1))
[in]sampleposition in samples (0...(nos-1))
[in]blockposition in blocks (0...(nob-1))
[in]cameraposition in camera count (0...(CAMCNT-1))
[out]pdestPointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer.
[out]bytes_to_end_of_bufferPointer to get the number of bytes to the end of the buffer. This is the size in bytes of the buffer from the position you are asking for and the end of the buffer. When NULL, this parameter is ignored.
Returns
es_status_codes

◆ GetRmsVal()

void GetRmsVal ( uint32_t nos,
uint16_t * TRMSVals,
double * mwf,
double * trms )

◆ GetS1State()

es_status_codes GetS1State ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
bool * state )

This function returns the bit S1 state of a specific scan.

The information S1 is given in the special pixel pixel_block_index_high_s1_s2 in bit pixel_block_index_high_s1_s2_bit_s1.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]statePointer to a bool, where the information S1 state will be written. true - S1 is high, false - S1 is low
Returns
es_status_codes

◆ GetS2State()

es_status_codes GetS2State ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
bool * state )

This function returns the bit S2 state of a specific scan.

The information S2 is given in the special pixel pixel_block_index_high_s1_s2 in bit pixel_block_index_high_s1_s2_bit_s2.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]statePointer to a bool, where the information S2 state will be written. true - S2 is high, false - S2 is low
Returns
es_status_codes

◆ GetScanIndex()

es_status_codes GetScanIndex ( uint32_t drvno,
uint32_t sample,
uint32_t block,
uint16_t camera_pos,
uint32_t * scanIndex )

This function returns the scan index of a specific scan.

The information block index is given in the special pixels pixel_scan_index_low and pixel_scan_index_high.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]samplesample number (0 ... (nos-1))
[in]blockblock number (0 ... (nob-1))
[in]camera_poscamera position (0 ... (CAMCNT-1))
[out]scanIndexPointer to a uint32_t, where the information scan index will be written. Scan index is a 32 bit counter.
Returns
es_status_codes

◆ GetScanNumber()

void GetScanNumber ( uint32_t drvno,
int64_t offset,
int64_t * sample,
int64_t * block )

Gives scan and block number of the last scan written to userBuffer.

When settings parameter camera_settings::use_software_polling is true this function converts scanCounterTotal to scan and block. This is necessary, because scanCounterTotal is just counting each scan not regarding camcnt and blocks. When camera_settings::use_software_polling is false the scan and block number of the last interrupt is given.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]sampleScan number of the last scan in userBuffer. -1 when no scan has been written yet, otherwise 0...(nos-1)
[out]blockBlock number of the last scan in userBuffer. -1 when no scans has been written yet, otherwise 0...(nob-1)
offsetfrom current scan number

◆ GetScanTriggerDetected()

es_status_codes GetScanTriggerDetected ( uint32_t drvno,
bool * detected )

Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]detectedPointer to a bool, where the scan trigger detected bit will be written.
Returns
es_status_codes

◆ GetVerifiedDataDialog()

void GetVerifiedDataDialog ( struct verify_data_parameter * vd,
char ** resultString )

Check the consistency of the file given in vd and return the results in resultString.

Parameters
[in]vdPointer to a verify_data_parameter struct. The member filename_full must be set.
[out]resultStringPointer to a char*. The result string is written to this pointer. The buffer is allocated in this function and must be freed by the caller.

◆ GetXckLength()

es_status_codes GetXckLength ( uint32_t drvno,
uint32_t * xckLengthIn10ns )

Get the high time duration of XCK from the S0 register S0Addr_XCKLEN.

The signal is measured once per measurement. The fist valid value can be read after the first completed XCK.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]xckLengthIn10nspointer to uint32 where the XCK length is returned
  • min: 0
  • step: 1 => 10 ns
  • max: 0xFFFFFFFF = 4,294,967,295 => 42,949,672,950 ns
Returns
es_status_codes

◆ GetXckPeriod()

es_status_codes GetXckPeriod ( uint32_t drvno,
uint32_t * xckPeriodIn10ns )

Get pos edge to pos egde time of XCK time from the S0 register S0Addr_XCK_PERIOD.

The signal is measured once per measurement. The fist valid value can be read after the start of the second XCK.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]xckPeriodIn10nspointer to uint32 where the XCK period is returned
  • min: 0
  • step: 1 => 10 ns
  • max: 0xFFFFFFFF = 4,294,967,295 => 42,949,672,950 ns
Returns
es_status_codes

◆ ImportMeasurementDataFromFile()

es_status_codes ImportMeasurementDataFromFile ( const char * filename)

TODO. missing documentation.

Parameters
[in]filename
Returns

◆ ImportMeasurementDataFromFileBIN()

es_status_codes ImportMeasurementDataFromFileBIN ( const char * filename)

◆ InitBoard()

es_status_codes InitBoard ( )

Initializes the PCIe board.

Is called by InitDriver. It is only needed to be called once.

Returns
es_status_codes

◆ InitDriver()

es_status_codes InitDriver ( )

Initialize the driver.

Call this before any other action. It is only needed to be called once at startup.

Returns
es_status_codes

◆ InitGPX()

es_status_codes InitGPX ( uint32_t drvno,
uint32_t delay )

Initialize the TDC-GPX chip. TDC: time delay counter option.

More information: https://www.sciosense.com/wp-content/uploads/2023/12/TDC-GPX-Datasheet.pdf

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
delayGPX offset is used to increase accuracy. A counter value can be added, usually 1000. 18 bit.
Returns
es_status_codes

◆ InitMeasurement()

es_status_codes InitMeasurement ( )

Initialize measurement (using board select).

Call this every time you changed settings before starting the measurement. When you didn't change any settings, you can start the next measurement without calling InitMeasurement every time.

Returns
es_status_codes

◆ InitPcieBoard()

es_status_codes InitPcieBoard ( uint32_t drvno)

◆ InitSoftware()

es_status_codes InitSoftware ( uint32_t drvno)

◆ manipulateData()

void manipulateData ( uint32_t drvno,
uint16_t * startAddress,
uint32_t numberOfScansToManipulate )

Manipulate the incoming data buffer with a preset polynomial.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
startAddress
numberOfScansToManipulate

◆ OpenShutter()

es_status_codes OpenShutter ( uint32_t drvno)

Open shutter for sensors with EC (exposure control) / sets IFC signal = high.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ OutTrigHigh()

es_status_codes OutTrigHigh ( uint32_t drvno)

Set trigger out(Reg CtrlA:D3) of PCIe board. Can be used to control timing issues in software.

The Reg TOR:D31 must have been set to 1 and D30:D27 to zero to see the signal -> see manual.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ OutTrigLow()

es_status_codes OutTrigLow ( uint32_t drvno)

Reset trigger out(Reg CtrlA:D3) of PCI board. Can be used to control timing issues in software.

The Reg TOR:D31 must have been set to 1 and D30:D27 to zero to see the signal -> see manual.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ OutTrigPulse()

es_status_codes OutTrigPulse ( uint32_t drvno,
int64_t pulseWidthInMicroseconds )

Pulses trigger out(Reg CtrlA:D3) of PCI board. Can be used to control timing issues in software.

The Reg TOR:D31 must have been set to 1 and D30:D27 to zero to see the signal -> see manual

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
pulseWidthInMicrosecondsduration of pulse in us
Returns
es_status_codes

◆ PcieCardVersionIsEqual()

bool PcieCardVersionIsEqual ( uint32_t drvno,
uint16_t major_version,
uint16_t minor_version )

◆ PcieCardVersionIsGreaterThan()

bool PcieCardVersionIsGreaterThan ( uint32_t drvno,
uint16_t major_version,
uint16_t minor_version )

◆ PcieCardVersionIsSmallerThan()

bool PcieCardVersionIsSmallerThan ( uint32_t drvno,
uint16_t major_version,
uint16_t minor_version )

◆ PollDmaBufferToUserBuffer()

void PollDmaBufferToUserBuffer ( uint32_t * drvno_p)

This function copies valid data from DMA buffer to user buffer.

This function tracks the DMA buffer and every time there is new data available, it is copied to the user buffer. The memory of the DMA buffer which was copied is then set to 0. Create a new thread for this function. This function should run parallel to the measurement. This function is only used when USE_SOFTWARE_POLLING is true.

Parameters
drvno_pPointer to PCIe board identifier.

◆ pulseBitS0_32()

es_status_codes pulseBitS0_32 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address,
int64_t duration_in_microseconds )

Pulse bit () -> 1 -> 0) in S0 register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...31, 0 is LSB, 31 MSB
addressregister address. Only 4 byte steps are valid.
duration_in_microsecondsDuration of the bit beeing high in microseconds.
Returns
es_status_codes

◆ pulseBitS0_8()

es_status_codes pulseBitS0_8 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address,
int64_t duration_in_microseconds )

Pulse bit () -> 1 -> 0) in S0 register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...7, 0 is LSB, 7 MSB
addressregister address. 1 byte steps are valid.
duration_in_microsecondsDuration of the bit beeing high in microseconds.
Returns
es_status_codes

◆ ReadBitS0_32()

es_status_codes ReadBitS0_32 ( uint32_t drvno,
uint32_t address,
uint8_t bitnumber,
bool * isBitHigh )

Read 1 bit of a 4 byte s0 register.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]addressAddress of the register to read.
[in]bitnumberAddress of the bit to read.
[out]isBitHighTells if bit is high or low.
Returns
es_status_codes

◆ ReadBitS0_8()

es_status_codes ReadBitS0_8 ( uint32_t drvno,
uint32_t address,
uint8_t bitnumber,
bool * isBitHigh )

Read 1 bit of 1 byte of a s0 register.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]addressAddress of the register to read.
[in]bitnumberAddress of the bit to read.
[out]isBitHighTells if bit is high or low.
Returns
es_status_codes

◆ ReadBlockFrequencyBit()

es_status_codes ReadBlockFrequencyBit ( uint32_t drvno,
bool * blockFrequencyTooHigh )

Reads the BlockFrequency bit and checks if its high or low.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]blockFrequencyTooHighTrue when BlockFrequency bit is set.
Returns
es_status_codes

◆ readBlockTriggerState()

es_status_codes readBlockTriggerState ( uint32_t drvno,
uint8_t btrig_ch,
bool * state )

Reads the binary state of an ext. trigger input.

Direct read of inputs for polling.

Parameters
drvnoboard number
btrig_chspecify input channel
  • btrig_ch=0 not used
  • btrig_ch=1 is PCIe trig in I
  • btrig_ch=2 is S1
  • btrig_ch=3 is S2
  • btrig_ch=4 is S1&S2
  • btrig_ch=5 is TSTART (GTI - DAT - EC)
statefalse when low, otherwise true
Returns
es_status_codes

◆ ReadGPXCtrl()

es_status_codes ReadGPXCtrl ( uint32_t drvno,
uint8_t GPXAddress,
uint32_t * GPXData )

Read GPXCtrl register.

Parameters
drvnoselect PCIe board
GPXAddressaddress to access
GPXDatapointer where read data is written to
Returns
es_status_codes

◆ readRegister_32_allBoards()

es_status_codes readRegister_32_allBoards ( uint32_t ** data,
uint32_t address )

Reads 4 bytes on DMA area of all PCIe boards.

Parameters
databuffer array for data
addressOffset from BaseAdress - in Bytes ! 0..3= Regs of Board.
Returns
es_status_codes

◆ readRegisterDma_32()

es_status_codes readRegisterDma_32 ( uint32_t drvno,
uint32_t * data,
uint32_t address )

Read 4 bytes of a register in DMA space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ readRegisterDma_8()

es_status_codes readRegisterDma_8 ( uint32_t drvno,
uint8_t * data,
uint32_t address )

Read 1 byte of a register in DMA space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ readRegisterS0_16()

es_status_codes readRegisterS0_16 ( uint32_t drvno,
uint16_t * data,
uint32_t address )

Read 2 bytes of a register in S0 space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ readRegisterS0_32()

es_status_codes readRegisterS0_32 ( uint32_t drvno,
uint32_t * data,
uint32_t address )

Read 4 bytes of a register in S0 space.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]dataRead buffer.
[in]addressAddress of the register to read.
Returns
es_status_codes

◆ readRegisterS0_32_allBoards()

es_status_codes readRegisterS0_32_allBoards ( uint32_t ** data,
uint32_t address )

Read 4 bytes of a register in S0 space of all boards.

Parameters
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ readRegisterS0_8()

es_status_codes readRegisterS0_8 ( uint32_t drvno,
uint8_t * data,
uint32_t address )

Read 1 byte of a register in S0 space.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]dataRead buffer.
[in]addressAddress of the register to read.
Returns
es_status_codes

◆ ReadScanFrequencyBit()

es_status_codes ReadScanFrequencyBit ( uint32_t drvno,
bool * scanFrequencyTooHigh )

Reads the ScanFrequency bit and checks if its high or low.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[out]scanFrequencyTooHighTrue when scanFrequency bit is set
Returns
es_status_codes

◆ resetBitS0_32()

es_status_codes resetBitS0_32 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address )

Set bit to 0 in register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...31, 0 is LSB, 31 MSB
addressregister address. Only 4 byte steps are valid.
Returns
es_status_codes

◆ resetBitS0_32_allBoards()

es_status_codes resetBitS0_32_allBoards ( uint32_t bitnumber,
uint32_t address )

Set bit to 0 in register at memory address.

Parameters
bitnumber0...31, 0 is LSB, 31 MSB
addressregister address. Only 4 byte steps are valid.
Returns
es_status_codes

◆ resetBitS0_8()

es_status_codes resetBitS0_8 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address )

Set bit to 0 in register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...7, 0 is LSB, 7 MSB
addressregister address. 1 byte steps are valid.
Returns
es_status_codes

◆ resetBlockEn()

es_status_codes resetBlockEn ( uint32_t drvno)

Resets BlockOn bit in PCIEFLAGS and notifies UI about it.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetBlockFrequencyBit()

es_status_codes ResetBlockFrequencyBit ( uint32_t drvno)

Resets the BlockFrequency bit.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetBlockTriggerDetected()

es_status_codes ResetBlockTriggerDetected ( uint32_t drvno)

Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected to 0.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetDma()

es_status_codes ResetDma ( uint32_t drvno)
Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0.
Returns
es_status_codes

◆ ResetDSC()

es_status_codes ResetDSC ( uint32_t drvno,
uint8_t DSCNumber )

reset Delay Stage Counter

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]DSCNumber1: DSC 1; 2: DSC 2
Returns
es_status_codes

◆ ResetHardwareCounter()

es_status_codes ResetHardwareCounter ( uint32_t drvno)

Reset the hardware block counter and scan counter.

Parameters
drvnoboard number
Returns
es_status_codes

◆ resetMeasureOn()

es_status_codes resetMeasureOn ( uint32_t drvno)

Resets setMeasureOn bit in PCIEFLAGS and notifies UI about it.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetPartialBinning()

es_status_codes ResetPartialBinning ( uint32_t drvno)

Turns ARREG off and therefore partial binning too.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetScanFrequencyBit()

es_status_codes ResetScanFrequencyBit ( uint32_t drvno)

Resets the ScanFrequency bit.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ResetScanTriggerDetected()

es_status_codes ResetScanTriggerDetected ( uint32_t drvno)

Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected to 0.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ ReturnStartMeasurement()

es_status_codes ReturnStartMeasurement ( es_status_codes status)

This is a helper function to return startMeasurement.

This function sets isRunning = false and returns the given status.

Parameters
statusStatus that will be returned.
Returns
Returns input parameter status.

◆ RSFifo()

es_status_codes RSFifo ( uint32_t drvno)

reset FIFO and FFcounter

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SaveMeasurementDataToFile()

es_status_codes SaveMeasurementDataToFile ( const char * filename)

Export the measurement data to a file.

Depending on the file extension, the data is saved in a binary or HDF5 file.

Parameters
[in]filenameFilename with complete absolute path and either .bin or .h5 extension.
Returns
es_status_codes

◆ SaveMeasurementDataToFileHDF5()

es_status_codes SaveMeasurementDataToFileHDF5 ( const char * filename)

Exports the measurement data to a HDF5 file.

Parameters
filenameFilename with complete absolute path.
Returns
es_status_codes

◆ SetAbortMeasurementFlag()

es_status_codes SetAbortMeasurementFlag ( )

Sets abortMeasurementFlag to true.

Use this function if the measurement is running and you want to stop it.

Returns
es_status_codes

◆ SetAllInterruptsDone()

void SetAllInterruptsDone ( uint32_t drvno)

◆ SetBDAT()

es_status_codes SetBDAT ( uint32_t drvno,
uint32_t datin10ns )

Sets delay after trigger hardware register.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
datin10nsTime in 10 ns steps. 31 bit.
  • disable: 0
  • min: 1 * 10 ns = 10 ns.
  • max: 2.147.483.647 * 10 ns = 21.474.836.470 ns = 21,474836470 s
Returns
es_status_codes

◆ SetBEC()

es_status_codes SetBEC ( uint32_t drvno,
uint32_t bec_in_10ns )

This function sets the register BEC.

The Block Exposure control (BEC) signal can be used to open and close a mechanical shutter. BEC starts after the block delay after trigger (BDAT) signal and is active for bec_in_10ns.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
bec_in_10ns
  • =0 no BEC
  • >0 Time in 10 ns steps. Min: 1 * 10 ns, Max: 4294967295 * 10ns = 42949672950ns = 42,94967295s
Returns
es_status_codes

◆ setBitS0_32()

es_status_codes setBitS0_32 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address )

Set bit to 1 in S0 register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...31, 0 is LSB, 31 MSB
addressregister address. Only 4 byte steps are valid.
Returns
es_status_codes

◆ setBitS0_32_allBoards()

es_status_codes setBitS0_32_allBoards ( uint32_t bitnumber,
uint32_t address )

Set bit to 1 in S0 register at memory address.

Parameters
bitnumber0...31, 0 is LSB, 31 MSB
addressregister address. Only 4 byte steps are valid.
Returns
es_status_codes

◆ setBitS0_8()

es_status_codes setBitS0_8 ( uint32_t drvno,
uint32_t bitnumber,
uint32_t address )

Set bit to 1 in S0 register at memory address.

Parameters
drvnoboard number (=1 if one PCI board)
bitnumber0...7, 0 is LSB, 7 MSB
addressregister address. 1 byte steps are valid.
Returns
es_status_codes

◆ setBlockEn()

es_status_codes setBlockEn ( uint32_t drvno)

Sets BlockOn bit in PCIEFLAGS and notifies UI about it.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetBSlope()

es_status_codes SetBSlope ( uint32_t drvno,
uint32_t slope )

Sets slope for block trigger.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
slope
  • 0: negative slope
  • 1: positive slope
  • 2: both
Returns
es_status_codes

◆ SetBTI()

es_status_codes SetBTI ( uint32_t drvno,
uint8_t bti_mode )

Chooses trigger input for block trigger input (BTI)

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
bti_modeDefines the input mode for BTI.
  • 0: I
  • 1: S1
  • 2: S2
  • 3: S1&s2
  • 4: BTIMER

◆ SetBticnt()

es_status_codes SetBticnt ( uint32_t drvno,
uint8_t divider )

Set the block trigger input divider.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
divider
  • =0: disable this function (every trigger is used)
  • >0: omit n trigger
Returns
es_status_codes

◆ SetBTimer()

es_status_codes SetBTimer ( uint32_t drvno,
uint32_t btime )

Sets time for block timer.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]btimeBlock time. The resolution of the time depends on the resolution mode set by SetTimerResolution(). 28 bit.
Returns
es_status_codes

◆ SetCamCountRegister()

es_status_codes SetCamCountRegister ( uint32_t drvno)

Set cam count.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetCameraSystem()

es_status_codes SetCameraSystem ( uint32_t drvno,
uint16_t camera_system )

Sets camera system bits in register camera type.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
camera_systemDetermines the camera system. See enum camera_system_t in enum_settings.h for options.
Returns
es_status_codes

◆ SetContinuousMeasurement()

void SetContinuousMeasurement ( bool on)

Control looping the measurement.

Parameters
[in]on1: measurement runs in a loop, 0: measurement only runs once.

◆ SetDIRDSC()

es_status_codes SetDIRDSC ( uint32_t drvno,
uint8_t DSCNumber,
bool dir )

set direction of Delay Stage Counter

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]DSCNumber1: DSC 1; 2: DSC 2
[in]dirtrue: up; false: down
Returns
es_status_codes

◆ SetDMABufRegs()

es_status_codes SetDMABufRegs ( uint32_t drvno)

Set DMA register.

Sets DMA_BUFFER_SIZE_IN_SCANS, DMA_DMASPERINTR, NOS, NOB, CAMCNT

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetDmaRegister()

es_status_codes SetDmaRegister ( uint32_t drvno,
uint32_t pixel )

Set DMA related registers like TLP mode and DMA addresses.

Parameters
drvno
pixel
Returns

◆ SetDmaStartMode()

es_status_codes SetDmaStartMode ( uint32_t drvno,
bool start_by_hardware )

Set DMA Start Mode.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
start_by_hardwaretrue: every XCK h->l starts DMA by hardware, false: by software
Returns
es_status_codes

◆ SetGeneralOutput()

es_status_codes SetGeneralOutput ( uint32_t drvno,
uint8_t output,
bool state )

Control the general outputs of the PCIe card addition board.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]output0 ... 7
[in]statetrue = high, false = low
Returns
es_status_codes

◆ SetGlobalSettings()

void SetGlobalSettings ( struct measurement_settings settings)

Set global settings struct.

Call this every time you changed settings before InitMeasurement.

Parameters
[in]settingsstruct measurement_settings

◆ SetGPXCtrl()

es_status_codes SetGPXCtrl ( uint32_t drvno,
uint8_t GPXAddress,
uint32_t GPXData )

Set GPXCtrl register.

Parameters
drvnoselect PCIe board
GPXAddressaddress to access
GPXDatadata to write
Returns
es_status_codes

◆ SetHardwareTimerStopMode()

es_status_codes SetHardwareTimerStopMode ( uint32_t drvno,
bool stop_by_hardware )

Reset the internal intr collect counter.

Parameters
drvnoboard number
stop_by_hardwaretrue: timer is stopped by hardware if nos is reached
Returns
es_status_codes

◆ SetManualState()

es_status_codes SetManualState ( uint32_t drvno,
bool state )

◆ setMeasureOn()

es_status_codes setMeasureOn ( uint32_t drvno)

Sets setMeasureOn bit in PCIEFLAGS and notifies UI about it.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetNobRegister()

es_status_codes SetNobRegister ( uint32_t drvno)

◆ SetNosRegister()

es_status_codes SetNosRegister ( uint32_t drvno)

◆ SetPartialBinning()

es_status_codes SetPartialBinning ( uint32_t drvno,
uint16_t number_of_regions )

Turn partial binning on.

Parameters
drvnoPCIe board identifier.
number_of_regionsnumber of regions for partial binning
Returns
es_status_codes

◆ SetPixelCountRegister()

es_status_codes SetPixelCountRegister ( uint32_t drvno)

Set pixel count.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetS1S2ReadDelay()

es_status_codes SetS1S2ReadDelay ( uint32_t drvno)

This functions sets the register S1S2ReadDealy with the setting camera_settings::s1s2_read_delay_in_10ns.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
Returns
es_status_codes

◆ SetSDAT()

es_status_codes SetSDAT ( uint32_t drvno,
uint32_t datin10ns )

Sets delay after trigger hardware register.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
datin10nsTime in 10 ns steps. 31 bit.
  • disable: 0
  • min: 1 * 10 ns = 10 ns.
  • max: 2.147.483.647 * 10 ns = 21.474.836.470 ns = 21,474836470 s
Returns
es_status_codes

◆ SetSEC()

es_status_codes SetSEC ( uint32_t drvno,
uint32_t ecin10ns )

Exposure control (EC) signal is used for mechanical shutter or sensors with EC function.

Starts after delay after trigger (DAT) signal and is active for ecin10ns. Resets additional delay after trigger with ecin10ns = 0.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
ecin10nsTime in 10 ns steps.
Returns
es_status_codes

◆ SetSensorType()

es_status_codes SetSensorType ( uint32_t drvno,
uint16_t sensor_type )

Sets sensor type bits in register camera type.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
sensor_typeDetermines sensor type. See enum sensor_type_t in enum_settings.h for options.
Returns
es_status_codes

◆ SetShiftS1S2ToNextScan()

es_status_codes SetShiftS1S2ToNextScan ( uint32_t drvno)

◆ SetShutterStates()

es_status_codes SetShutterStates ( uint32_t drvno,
uint16_t shutter_states )

Sets all shutter states in one call.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]shutter_states16 bit value where each bit of the lower 4 represents the state of one shutter.
  • bit 0: shutter 1, 1: closed, 0: open
  • bit 1: shutter 2, 1: closed, 0: open
  • bit 2: shutter 3, 1: closed, 0: open
  • bit 3: shutter 4, 1: closed, 0: open
Returns
es_status_codes

◆ SetSSlope()

es_status_codes SetSSlope ( uint32_t drvno,
uint32_t sslope )

Set the external trigger slope for scan trigger (PCI Reg CrtlA:D5 -> manual).

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
sslopeChoose slope:
  • 0: high slope
  • 1: low slope
  • 2: both slope
Returns
es_status_codes

◆ SetStateControlRegister()

es_status_codes SetStateControlRegister ( uint32_t drvno,
uint16_t state )

◆ SetSTI()

es_status_codes SetSTI ( uint32_t drvno,
uint8_t sti_mode )

Chooses trigger input for scan trigger input (STI)

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
sti_modeDefines the input mode for STI.
  • 0: I
  • 1: S1
  • 2: S2
  • 3: unused
  • 4: S Timer
  • 5: ASL
Returns
es_status_codes

◆ SetSticnt()

es_status_codes SetSticnt ( uint32_t drvno,
uint8_t divider )

Set the scan trigger input divider.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
divider
  • =0: disable this function (every trigger is used)
  • >0: omit n trigger
Returns
es_status_codes

◆ SetSTimer()

es_status_codes SetSTimer ( uint32_t drvno,
uint32_t stime )

Sets time for scan timer.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]stimeTrigger time. The resolution of the time depends on the resolution mode set by SetTimerResolution(). 28 bit.
Returns
es_status_codes

◆ SetTimerResolution()

es_status_codes SetTimerResolution ( uint32_t drvno,
uint8_t resolution_mode )

Set timer resolution.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
resolution_modeResolution of the time. See timer_resolution_t in enum_settings.h for options.
Returns
es_status_codes

◆ SetTocnt()

es_status_codes SetTocnt ( uint32_t drvno,
uint8_t divider )

Set the trigger output divider.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
divider7 bit value
  • =0: disable this function (every trigger is used)
  • >0: use every n'th trigger
Returns
es_status_codes

◆ SetTORReg()

es_status_codes SetTORReg ( uint32_t drvno,
uint8_t tor )

Set signal of output port of PCIe card.

Parameters
[in]drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
[in]torselect output signal. See enum tor_out in enum_settings.h for options.
Returns
es_status_codes

◆ SetupArea()

es_status_codes SetupArea ( uint32_t drvno,
uint32_t lines_binning,
uint8_t vfreq )

For FFTs: Setup area mode.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
lines_binningDetermines how many lines are binned (summed) when reading camera in area mode.
vfreqFrequency for vertical clock.
Returns
es_status_codes

◆ SetupFullBinning()

es_status_codes SetupFullBinning ( uint32_t drvno,
uint32_t lines,
uint8_t vfreq )

For FFTs: Setup full binning.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
linesLines in camera.
vfreqFrequency for vertical clock.
Returns
es_status_codes

◆ SetupROI()

es_status_codes SetupROI ( uint32_t drvno,
uint16_t number_of_regions,
uint32_t lines,
uint8_t * region_size,
uint8_t vfreq )

Initializes region of interest.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
number_of_regionsdetermines how many region of interests are initialized, choose 2 to 8
linesnumber of total lines in camera
region_sizedetermines the size of each region. array of size number_of_regions. When region_size[0]==0 the lines are equally distributed for all regions. I don't know what happens when region_size[0]!=0 and region_size[1]==0. Maybe don't do this. The sum of all regions should equal lines.
vfreqVCLK frequency
Returns
es_status_codes

◆ SetupVCLKReg()

es_status_codes SetupVCLKReg ( uint32_t drvno,
uint32_t lines,
uint8_t vfreq )

Set REG VCLKCTRL for FFT sensors.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
linesnumber of vertical lines
vfreqvertical clock frequency
Returns
es_status_codes

◆ SetupVPB()

es_status_codes SetupVPB ( uint32_t drvno,
uint32_t range,
uint32_t lines )

sets Vertical Partial Binning in registers R10,R11 and R12. Only for FFT sensors.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
rangeDetermines the range, for which the value lines will be written.
  • min = 1
  • step = 1
  • max = 5
linesnumber of vertical clocks for next read
  • min = 1
  • step = 1
  • max = 2047
Returns
es_status_codes

◆ SetVirtualCamcnt()

void SetVirtualCamcnt ( uint32_t drvno)

◆ SetXckdelay()

es_status_codes SetXckdelay ( uint32_t drvno,
uint32_t xckdelay_in_10ns )

DEPRECATED. Set XCK delay.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
xckdelay_in_10nsXCK delay, 31 bit. xckdelay = 500ns + xckdelay_in_10ns * 10ns
  • disable: 0
  • min 1: 500 ns + 1 * 10ns = 510 ns
  • max 2.147.483.647: 500 ns + 2.147.483.647 * 10 ns = 21.474.836.970 ns = 21,474.836.970 s
Returns
es_status_codes

◆ StartMeasurement()

es_status_codes StartMeasurement ( )

This function is starting the measurement and returns when the measurement is done.

When there are multiple boards, all boards are starting the measurement. Create a new thread for calling this function, when you don't want to have a blocking call.

Returns
es_status_codes

◆ Use_ENFFW_protection()

es_status_codes Use_ENFFW_protection ( uint32_t drvno,
bool USE_ENFFW_PROTECT )

Protects ENFFW from cool cam status transmission. Enable with cool cam, disable with HS > 50 kHz.

Legacy code for old cameras. RX_VALID usually triggers ENFFW. This must be disabled when cool cams transmit their cooling status. RX_VALID_EN is enabled with XCKI and disabled with ~CAMFFXCK_ALL, after all frame data is collected. If RX_VALID raises again for cool status values, it doesn't effect ENFFW when RX_VALID_EN is low.

Parameters
drvnoselects PCIe board
USE_ENFFW_PROTECTenables or disables RX_VALID write protection
Returns
es_status_codes

◆ WaitForBlockDone()

es_status_codes WaitForBlockDone ( )

Returns when block on bit is 0.

Returns
es_status_codes

◆ WaitForBlockOn()

es_status_codes WaitForBlockOn ( uint32_t drvno)

◆ waitForBlockTrigger()

es_status_codes waitForBlockTrigger ( uint32_t drvno)

Wait in loop until block trigger occurs.

Since P222_14 this is a legacy function only for backwards compatibility. P222_14 and newer versions will always return 1 at the block trigger bit. If block trigger high: return If block trigger low: wait for hi Checks only PCIE board no 1

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. May only work for 1
Returns
es_status_codes

◆ WaitForMeasureDone()

es_status_codes WaitForMeasureDone ( )

Returns when measure on bit is 0.

Returns
es_status_codes

◆ writeBitsDma_32()

es_status_codes writeBitsDma_32 ( uint32_t drvno,
uint32_t data,
uint32_t bitmask,
uint32_t address )

Set specified bits to 1 in DMA register at memory address.

Parameters
data4 bytes (32 bits) data to write
bitmaskBitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written.
addressAddress of the register in DMA space.
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0.
Returns
es_status_codes

◆ writeBitsDma_8()

es_status_codes writeBitsDma_8 ( uint32_t drvno,
uint8_t data,
uint8_t bitmask,
uint32_t address )

Set specified bits to 1 in DMA register at memory address.

Parameters
data1 bytes (8 bits) data to write
bitmaskBitmask to select specific bits, which should be written. 0xFF - all bits 8 bits are written, 0 - no bits are written.
addressAddress of the register in DMA space.
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0.
Returns
es_status_codes

◆ writeBitsS0_32()

es_status_codes writeBitsS0_32 ( uint32_t drvno,
uint32_t data,
uint32_t bitmask,
uint32_t address )

Set specified bits to 1 in S0 register at memory address.

Parameters
data4 bytes (32 bits) data to write
bitmaskBitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written.
addressAddress of the register in S0 space.
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0.
Returns
es_status_codes

◆ writeBitsS0_32_allBoards()

es_status_codes writeBitsS0_32_allBoards ( uint32_t data,
uint32_t bitmask,
uint32_t address )

Set specified bits to 1 in S0 register at memory address.

Parameters
data4 bytes (32 bits) data to write
bitmaskBitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written.
addressAddress of the register in S0 space.
Returns
es_status_codes

◆ writeBitsS0_8()

es_status_codes writeBitsS0_8 ( uint32_t drvno,
uint8_t data,
uint8_t bitmask,
uint32_t address )

Set specified bits to 1 in S0 register at memory address.

Parameters
data1 bytes (8 bits) data to write
bitmaskBitmask to select specific bits, which should be written. 0xFF - all bits 8 bits are written, 0 - no bits are written.
addressAddress of the register in S0 space.
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0.
Returns
es_status_codes

◆ writeRegisterDma_32()

es_status_codes writeRegisterDma_32 ( uint32_t drvno,
uint32_t data,
uint32_t address )

Write 4 bytes to a register in DMA space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterDma_8()

es_status_codes writeRegisterDma_8 ( uint32_t drvno,
uint8_t data,
uint32_t address )

Write 1 byte to a register in DMA space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataRead buffer.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterS0_16()

es_status_codes writeRegisterS0_16 ( uint32_t drvno,
uint16_t data,
uint32_t address )

Write 2 bytes of a register in S0 space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataData to write.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterS0_32()

es_status_codes writeRegisterS0_32 ( uint32_t drvno,
uint32_t data,
uint32_t address )

Write 4 byte of a register in S0 space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataData to write.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterS0_32_allBoards()

es_status_codes writeRegisterS0_32_allBoards ( uint32_t data,
uint32_t address )

Write 4 bytes of a register in S0 space.

Parameters
dataData to write.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterS0_8()

es_status_codes writeRegisterS0_8 ( uint32_t drvno,
uint8_t data,
uint32_t address )

Write 1 byte of a register in S0 space.

Parameters
drvnoidentifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0
dataData to write.
addressAddress of the register to read.
Returns
es_status_codes

◆ writeRegisterS0_8_allBoards()

es_status_codes writeRegisterS0_8_allBoards ( uint8_t data,
uint32_t address )

Write the same 1 byte to a register in S0 space of all boards.

Parameters
dataData to write.
addressAddress of the register to write.
Returns
es_status_codes