EBST_CAM
|
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) |
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.
#define BYTE_TO_BINARY | ( | byte | ) |
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" |
es_status_codes _AboutDrv | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Return infos about the PCIe board.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | stringPtr | string with driver information is given back here |
es_status_codes _AboutGPX | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Reads registers 0 to 12 of TDC-GPX chip. Time delay counter option.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | stringPtr |
es_status_codes _InitMeasurement | ( | uint32_t | drvno | ) |
Initialize Measurement (using drvno).
es_status_codes AbortMeasurement | ( | ) |
Use this function to abort measurement.
es_status_codes allocateUserMemory | ( | uint32_t | drvno | ) |
Allocate user memory.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ArmScanTrigger | ( | uint32_t | drvno | ) |
Sets Scan Timer on.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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
[in] | nos | number of samples |
[in] | nob | number of blocks |
[out] | exposure_time_in_ms | exposure time in ms |
double CalcRamUsageInMB | ( | uint32_t | nos, |
uint32_t | nob ) |
Calculate needed RAM in MB for given nos and nob.
[in] | nos | number of samples |
[in] | nob | number of blocks |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | firstSample | start sample to calculate RMS. 0...(nos-2). Typical value: 10, to skip overexposed first samples |
[in] | lastSample | last sample to calculate RMS. firstSample+1...(nos-1). |
[in] | TRMS_pixel | pixel for calculating noise (0...(PIXEL-1)) |
[in] | CAMpos | index for camcount (0...(CAMCNT-1)) |
[out] | mwf | pointer for mean value |
[out] | trms | pointer for noise |
es_status_codes CheckFifoEmpty | ( | uint32_t | drvno, |
bool * | empty ) |
Check empty flag (FIFO empty).
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | empty | TODO: missing doc |
es_status_codes CheckFifoFull | ( | uint32_t | drvno, |
bool * | full ) |
Check full flag (FIFO full).
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | full | TODO missing doc |
es_status_codes CheckFifoOverflow | ( | uint32_t | drvno, |
bool * | overflow ) |
Check ovl flag (overflow of FIFO).
If occurred stays active until a call of FFRS.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | overflow | Is true (not 0) if overflow occurred (linecounter>0). |
es_status_codes CheckFifoValid | ( | uint32_t | drvno, |
bool * | valid ) |
Checks content of FIFO.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | valid | Is true (not 0) if FIFO keeps >= 1 complete lines (linecounter>0). |
es_status_codes ClearAllUserRegs | ( | uint32_t | drvno | ) |
Clears DAT and EC.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
void clearKeyStates | ( | ) |
es_status_codes CloseShutter | ( | uint32_t | drvno | ) |
Sets the IFC bit of interface for sensors with shutter function. IFC=low.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes CopyAllData | ( | uint32_t | drvno, |
uint16_t * | pdest ) |
Copy the data of the complete measurement to pdest.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | pdest | Pointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos * camcnt * nob |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number ( 0...(nos - 1) ) |
[in] | block | block number ( 0...(nob - 1) ) |
[in] | camera | camera number ( 0...(CAMCNT - 1) ) |
[in] | pixel | position in one scan (0...(PIXEL-1)) |
[in] | length_in_pixel | Number of pixels to copy. When length_in_pixel exceeds the end of the data buffer the function returns es_parameter_out_of_range. |
[out] | pdest | Pointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * length_in_pixel |
es_status_codes CopyOneBlock | ( | uint32_t | drvno, |
uint16_t | block, | ||
uint16_t * | pdest ) |
Copy the data of a single block to pdest.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | block | block number ( 0...(nob - 1) ) |
[out] | pdest | Pointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos * camcnt |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | block | block number ( 0...(nob - 1) ) |
[in] | camera | camera number ( 0...(CAMCNT - 1) ) |
[out] | pdest | Pointer where the data will be written to. Make sure that the size of the buffer is >= sizeof(uint16_t) * pixel * nos |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number ( 0...(nos - 1) ) |
[in] | block | block number ( 0...(nob - 1) ) |
[in] | camera | camera number ( 0...(CAMCNT - 1) ) |
[out] | pdest | Pointer where the data will be written to. Make sure that the size is >= sizeof(uint16_t) * pixel |
es_status_codes countBlocksByHardware | ( | uint32_t | drvno | ) |
Sends signal to hardware to count blocks.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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 DAC8568_enableInternalReference | ( | uint32_t | drvno, |
uint8_t | location, | ||
uint8_t | cameraPosition ) |
Enable the internal reference in static mode.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
location | Switch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details. |
cameraPosition | This 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. |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
location | Switch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details. |
cameraPosition | This 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. |
ctrlBits | 4 control bits |
addrBits | 4 address bits |
dataBits | 16 data bits |
featureBits | 4 feature bits |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | location | Switch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details. |
[in] | cameraPosition | This 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] | output | all output values that will be converted to analog voltage (0 ... 0xFFFF) |
[in] | reorder_channels | used to reorder DAC channels for high speed camera |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | location | Switch for the different locations of DAC85689. See enum DAC8568_location_t in enum_settings.h for details. |
[in] | cameraPosition | This 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] | channel | select one of eight output channel (0 ... 7) |
[in] | output | output value that will be converted to analog voltage (0 ... 0xFFFF) |
es_status_codes DisarmScanTrigger | ( | uint32_t | drvno | ) |
Disarm scan trigger.
Clear Bit30 of XCK-Reg: 0= timer off
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes DoSoftwareTrigger | ( | uint32_t | drvno | ) |
Triggers one camera read by calling this function.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes dumpCameraSettings | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Dump all camera settings to a string.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpDmaRegisters | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Read all DMA registers and write them to a string in hex.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpHumanReadableS0Registers | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Read all S0 registers and write them to a string in a human readable format.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpMeasurementSettings | ( | char ** | stringPtr | ) |
Dump all measurement settings to a string.
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpPciRegisters | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Read all PCIe registers and write them to a string.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpS0Registers | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Read all S0 registers and write them to a string in hex.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes dumpTlpRegisters | ( | uint32_t | drvno, |
char ** | stringPtr ) |
Read all TLP registers and write them to a string.
[in] | drvno | PCIe board identifier |
[out] | stringPtr | Pointer to a string buffer. The buffer will be allocated by this function. The caller is responsible to free the buffer. |
es_status_codes ExitDriver | ( | ) |
Exit driver. Call this before exiting software for cleanup.
void FillUserBufferWithDummyData | ( | uint32_t | drvno | ) |
This function inserts data to user buffer for developing purpose.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes FindCam | ( | uint32_t | drvno | ) |
Test if SFP module is there and fiber is linked up.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | pdest | Pointer to get the pointer of the data buffer. When NULL, this functions returns es_invalid_pointer. |
[out] | bytes_to_end_of_buffer | Pointer 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. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | sp | struct special_pixels Pointer to struct special_pixel, where all special pixel information will be written. |
es_status_codes GetArmScanTriggerStatus | ( | uint32_t | drvno, |
bool * | on ) |
Checks if timer is active (Bit30 of XCK-Reg).
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
on |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | blockIndex | Pointer 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. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | blockOn | Pointer to a bool, where the block on bit will be written. |
es_status_codes GetBlockTriggerDetected | ( | uint32_t | drvno, |
bool * | detected ) |
Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | detected | Pointer to a bool, where the block trigger detected bit will be written. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | bonLengthIn10ns | pointer to uint32 where the BON length is returned
|
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | bonPeriodIn10ns | pointer to uint32 where the BON period is returned
|
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | overTemp | Pointer to a bool, where the information overTemp will be written. true - over temperature detected, false - no over temperature detected |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | tempGood | Pointer to a bool, where the information tempGood will be written. true - target temperature reached, false - target temperature not reached |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | sample | Scan number of the last scan in userBuffer. -1 when no scan has been written yet, otherwise 0...(nos-1) |
[out] | block | Block number of the last scan in userBuffer. -1 when no scans has been written yet, otherwise 0...(nob-1) |
es_status_codes GetDSC | ( | uint32_t | drvno, |
uint8_t | DSCNumber, | ||
uint32_t * | ADSC, | ||
uint32_t * | LDSC ) |
return all values of Delay Stage Counter
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | DSCNumber | 1: DSC 1; 2: DSC 2 |
[out] | ADSC | current DSC |
[out] | LDSC | last DSC |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | impactSignal | Pointer to a uint32_t, where the information impact signal will be written. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | impactSignal | Pointer to a uint32_t, where the information impact signal will be written. |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
pixel | position in one scan (0...(PIXEL-1)) |
sample | position in samples (0...(nos-1)) |
block | position in blocks (0...(nob-1)) |
camera | position in camera count (0...(CAMCNT-1) |
pIndex | Pointer to index of pixel. |
es_status_codes GetIsDsc | ( | uint32_t | drvno, |
bool * | isDsc ) |
Read DSC flag in PCIEFLAGS register.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | isDsc | DSC flag is written to this bool*. TRUE: DSC board detected, FALSE: no DSC board detected |
es_status_codes GetIsTdc | ( | uint32_t | drvno, |
bool * | isTdc ) |
Read TDC flag in PCIEFLAGS register.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | isTdc | TDC flag is written to this bool*. TRUE: TDC board detected, FALSE: no TDC board detected |
es_status_codes GetLastBufPart | ( | uint32_t | drvno | ) |
For the rest part of the buffer.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes GetMeasureOn | ( | uint32_t | drvno, |
bool * | measureOn ) |
Check if measure on bit is set.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | measureOn | True when measureon bit is set. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | block | position in blocks (0...(nob-1)) |
[out] | pdest | Pointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer. |
[out] | bytes_to_end_of_buffer | Pointer 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. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | position in samples (0...(nos-1)) |
[in] | block | position in blocks (0...(nob-1)) |
[in] | camera | position in camera count (0...(CAMCNT-1)) |
[out] | pdest | Pointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer. |
[out] | bytes_to_end_of_buffer | Pointer 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. |
es_status_codes GetPcieCardVersion | ( | uint32_t | drvno, |
uint16_t * | major_version, | ||
uint16_t * | minor_version ) |
Get the PCIe card firmware version number.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
major_version | Pointer to a uint16_t, where the major version number will be written. |
minor_version | Pointer to a uint16_t, where the minor version number will be written. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | pixel | position in one scan (0...(PIXEL-1)) |
[in] | sample | position in samples (0...(nos-1)) |
[in] | block | position in blocks (0...(nob-1)) |
[in] | camera | position in camera count (0...(CAMCNT-1)) |
[out] | pdest | Pointer to get the pointer of the specific pixel. When NULL, this functions returns es_invalid_pointer. |
[out] | bytes_to_end_of_buffer | Pointer 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. |
void GetRmsVal | ( | uint32_t | nos, |
uint16_t * | TRMSVals, | ||
double * | mwf, | ||
double * | trms ) |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | state | Pointer to a bool, where the information S1 state will be written. true - S1 is high, false - S1 is low |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | state | Pointer to a bool, where the information S2 state will be written. true - S2 is high, false - S2 is low |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | sample | sample number (0 ... (nos-1)) |
[in] | block | block number (0 ... (nob-1)) |
[in] | camera_pos | camera position (0 ... (CAMCNT-1)) |
[out] | scanIndex | Pointer to a uint32_t, where the information scan index will be written. Scan index is a 32 bit counter. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | sample | Scan number of the last scan in userBuffer. -1 when no scan has been written yet, otherwise 0...(nos-1) |
[out] | block | Block number of the last scan in userBuffer. -1 when no scans has been written yet, otherwise 0...(nob-1) |
offset | from current scan number |
es_status_codes GetScanTriggerDetected | ( | uint32_t | drvno, |
bool * | detected ) |
Read the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | detected | Pointer to a bool, where the scan trigger detected bit will be written. |
void GetVerifiedDataDialog | ( | struct verify_data_parameter * | vd, |
char ** | resultString ) |
Check the consistency of the file given in vd and return the results in resultString.
[in] | vd | Pointer to a verify_data_parameter struct. The member filename_full must be set. |
[out] | resultString | Pointer 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. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | xckLengthIn10ns | pointer to uint32 where the XCK length is returned
|
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | xckPeriodIn10ns | pointer to uint32 where the XCK period is returned
|
es_status_codes ImportMeasurementDataFromFile | ( | const char * | filename | ) |
TODO. missing documentation.
[in] | filename |
es_status_codes ImportMeasurementDataFromFileBIN | ( | const char * | filename | ) |
es_status_codes InitBoard | ( | ) |
Initializes the PCIe board.
Is called by InitDriver. It is only needed to be called once.
es_status_codes InitDriver | ( | ) |
Initialize the driver.
Call this before any other action. It is only needed to be called once at startup.
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
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
delay | GPX offset is used to increase accuracy. A counter value can be added, usually 1000. 18 bit. |
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.
es_status_codes InitPcieBoard | ( | uint32_t | drvno | ) |
es_status_codes InitSoftware | ( | uint32_t | drvno | ) |
void manipulateData | ( | uint32_t | drvno, |
uint16_t * | startAddress, | ||
uint32_t | numberOfScansToManipulate ) |
Manipulate the incoming data buffer with a preset polynomial.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
startAddress | |
numberOfScansToManipulate |
es_status_codes OpenShutter | ( | uint32_t | drvno | ) |
Open shutter for sensors with EC (exposure control) / sets IFC signal = high.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
pulseWidthInMicroseconds | duration of pulse in us |
bool PcieCardVersionIsEqual | ( | uint32_t | drvno, |
uint16_t | major_version, | ||
uint16_t | minor_version ) |
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 ) |
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.
drvno_p | Pointer to PCIe board identifier. |
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.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...31, 0 is LSB, 31 MSB |
address | register address. Only 4 byte steps are valid. |
duration_in_microseconds | Duration of the bit beeing high in microseconds. |
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.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...7, 0 is LSB, 7 MSB |
address | register address. 1 byte steps are valid. |
duration_in_microseconds | Duration of the bit beeing high in microseconds. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | address | Address of the register to read. |
[in] | bitnumber | Address of the bit to read. |
[out] | isBitHigh | Tells if bit is high or low. |
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.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | address | Address of the register to read. |
[in] | bitnumber | Address of the bit to read. |
[out] | isBitHigh | Tells if bit is high or low. |
es_status_codes ReadBlockFrequencyBit | ( | uint32_t | drvno, |
bool * | blockFrequencyTooHigh ) |
Reads the BlockFrequency bit and checks if its high or low.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | blockFrequencyTooHigh | True when BlockFrequency bit is set. |
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.
drvno | board number |
btrig_ch | specify input channel
|
state | false when low, otherwise true |
es_status_codes ReadGPXCtrl | ( | uint32_t | drvno, |
uint8_t | GPXAddress, | ||
uint32_t * | GPXData ) |
Read GPXCtrl register.
drvno | select PCIe board |
GPXAddress | address to access |
GPXData | pointer where read data is written to |
es_status_codes readRegister_32_allBoards | ( | uint32_t ** | data, |
uint32_t | address ) |
Reads 4 bytes on DMA area of all PCIe boards.
data | buffer array for data |
address | Offset from BaseAdress - in Bytes ! 0..3= Regs of Board. |
es_status_codes readRegisterDma_32 | ( | uint32_t | drvno, |
uint32_t * | data, | ||
uint32_t | address ) |
Read 4 bytes of a register in DMA space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Read buffer. |
address | Address of the register to read. |
es_status_codes readRegisterDma_8 | ( | uint32_t | drvno, |
uint8_t * | data, | ||
uint32_t | address ) |
Read 1 byte of a register in DMA space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Read buffer. |
address | Address of the register to read. |
es_status_codes readRegisterS0_16 | ( | uint32_t | drvno, |
uint16_t * | data, | ||
uint32_t | address ) |
Read 2 bytes of a register in S0 space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Read buffer. |
address | Address of the register to read. |
es_status_codes readRegisterS0_32 | ( | uint32_t | drvno, |
uint32_t * | data, | ||
uint32_t | address ) |
Read 4 bytes of a register in S0 space.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | data | Read buffer. |
[in] | address | Address of the register to read. |
es_status_codes readRegisterS0_32_allBoards | ( | uint32_t ** | data, |
uint32_t | address ) |
Read 4 bytes of a register in S0 space of all boards.
data | Read buffer. |
address | Address of the register to read. |
es_status_codes readRegisterS0_8 | ( | uint32_t | drvno, |
uint8_t * | data, | ||
uint32_t | address ) |
Read 1 byte of a register in S0 space.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | data | Read buffer. |
[in] | address | Address of the register to read. |
es_status_codes ReadScanFrequencyBit | ( | uint32_t | drvno, |
bool * | scanFrequencyTooHigh ) |
Reads the ScanFrequency bit and checks if its high or low.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[out] | scanFrequencyTooHigh | True when scanFrequency bit is set |
es_status_codes resetBitS0_32 | ( | uint32_t | drvno, |
uint32_t | bitnumber, | ||
uint32_t | address ) |
Set bit to 0 in register at memory address.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...31, 0 is LSB, 31 MSB |
address | register address. Only 4 byte steps are valid. |
es_status_codes resetBitS0_32_allBoards | ( | uint32_t | bitnumber, |
uint32_t | address ) |
Set bit to 0 in register at memory address.
bitnumber | 0...31, 0 is LSB, 31 MSB |
address | register address. Only 4 byte steps are valid. |
es_status_codes resetBitS0_8 | ( | uint32_t | drvno, |
uint32_t | bitnumber, | ||
uint32_t | address ) |
Set bit to 0 in register at memory address.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...7, 0 is LSB, 7 MSB |
address | register address. 1 byte steps are valid. |
es_status_codes resetBlockEn | ( | uint32_t | drvno | ) |
Resets BlockOn bit in PCIEFLAGS and notifies UI about it.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetBlockFrequencyBit | ( | uint32_t | drvno | ) |
Resets the BlockFrequency bit.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetBlockTriggerDetected | ( | uint32_t | drvno | ) |
Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_block_trigger_detected to 0.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetDma | ( | uint32_t | drvno | ) |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. |
es_status_codes ResetDSC | ( | uint32_t | drvno, |
uint8_t | DSCNumber ) |
reset Delay Stage Counter
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | DSCNumber | 1: DSC 1; 2: DSC 2 |
es_status_codes ResetHardwareCounter | ( | uint32_t | drvno | ) |
Reset the hardware block counter and scan counter.
drvno | board number |
es_status_codes resetMeasureOn | ( | uint32_t | drvno | ) |
Resets setMeasureOn bit in PCIEFLAGS and notifies UI about it.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetPartialBinning | ( | uint32_t | drvno | ) |
Turns ARREG off and therefore partial binning too.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetScanFrequencyBit | ( | uint32_t | drvno | ) |
Resets the ScanFrequency bit.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes ResetScanTriggerDetected | ( | uint32_t | drvno | ) |
Reset the bit PCIEFLAGS_bits_t::PCIEFLAGS_bit_scan_trigger_detected to 0.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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.
status | Status that will be returned. |
es_status_codes RSFifo | ( | uint32_t | drvno | ) |
reset FIFO and FFcounter
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
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.
[in] | filename | Filename with complete absolute path and either .bin or .h5 extension. |
es_status_codes SaveMeasurementDataToFileHDF5 | ( | const char * | filename | ) |
Exports the measurement data to a HDF5 file.
filename | Filename with complete absolute path. |
es_status_codes SetAbortMeasurementFlag | ( | ) |
Sets abortMeasurementFlag to true.
Use this function if the measurement is running and you want to stop it.
void SetAllInterruptsDone | ( | uint32_t | drvno | ) |
es_status_codes SetBDAT | ( | uint32_t | drvno, |
uint32_t | datin10ns ) |
Sets delay after trigger hardware register.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
datin10ns | Time in 10 ns steps. 31 bit.
|
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
bec_in_10ns |
|
es_status_codes setBitS0_32 | ( | uint32_t | drvno, |
uint32_t | bitnumber, | ||
uint32_t | address ) |
Set bit to 1 in S0 register at memory address.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...31, 0 is LSB, 31 MSB |
address | register address. Only 4 byte steps are valid. |
es_status_codes setBitS0_32_allBoards | ( | uint32_t | bitnumber, |
uint32_t | address ) |
Set bit to 1 in S0 register at memory address.
bitnumber | 0...31, 0 is LSB, 31 MSB |
address | register address. Only 4 byte steps are valid. |
es_status_codes setBitS0_8 | ( | uint32_t | drvno, |
uint32_t | bitnumber, | ||
uint32_t | address ) |
Set bit to 1 in S0 register at memory address.
drvno | board number (=1 if one PCI board) |
bitnumber | 0...7, 0 is LSB, 7 MSB |
address | register address. 1 byte steps are valid. |
es_status_codes setBlockEn | ( | uint32_t | drvno | ) |
Sets BlockOn bit in PCIEFLAGS and notifies UI about it.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetBSlope | ( | uint32_t | drvno, |
uint32_t | slope ) |
Sets slope for block trigger.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
slope |
|
es_status_codes SetBTI | ( | uint32_t | drvno, |
uint8_t | bti_mode ) |
Chooses trigger input for block trigger input (BTI)
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
bti_mode | Defines the input mode for BTI.
|
es_status_codes SetBticnt | ( | uint32_t | drvno, |
uint8_t | divider ) |
Set the block trigger input divider.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
divider |
|
es_status_codes SetBTimer | ( | uint32_t | drvno, |
uint32_t | btime ) |
Sets time for block timer.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | btime | Block time. The resolution of the time depends on the resolution mode set by SetTimerResolution(). 28 bit. |
es_status_codes SetCamCountRegister | ( | uint32_t | drvno | ) |
Set cam count.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetCameraSystem | ( | uint32_t | drvno, |
uint16_t | camera_system ) |
Sets camera system bits in register camera type.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
camera_system | Determines the camera system. See enum camera_system_t in enum_settings.h for options. |
void SetContinuousMeasurement | ( | bool | on | ) |
Control looping the measurement.
[in] | on | 1: measurement runs in a loop, 0: measurement only runs once. |
es_status_codes SetDIRDSC | ( | uint32_t | drvno, |
uint8_t | DSCNumber, | ||
bool | dir ) |
set direction of Delay Stage Counter
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | DSCNumber | 1: DSC 1; 2: DSC 2 |
[in] | dir | true: up; false: down |
es_status_codes SetDMABufRegs | ( | uint32_t | drvno | ) |
Set DMA register.
Sets DMA_BUFFER_SIZE_IN_SCANS, DMA_DMASPERINTR, NOS, NOB, CAMCNT
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetDmaRegister | ( | uint32_t | drvno, |
uint32_t | pixel ) |
Set DMA related registers like TLP mode and DMA addresses.
drvno | |
pixel |
es_status_codes SetDmaStartMode | ( | uint32_t | drvno, |
bool | start_by_hardware ) |
Set DMA Start Mode.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
start_by_hardware | true: every XCK h->l starts DMA by hardware, false: by software |
es_status_codes SetGeneralOutput | ( | uint32_t | drvno, |
uint8_t | output, | ||
bool | state ) |
Control the general outputs of the PCIe card addition board.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | output | 0 ... 7 |
[in] | state | true = high, false = low |
void SetGlobalSettings | ( | struct measurement_settings | settings | ) |
Set global settings struct.
Call this every time you changed settings before InitMeasurement.
[in] | settings | struct measurement_settings |
es_status_codes SetGPXCtrl | ( | uint32_t | drvno, |
uint8_t | GPXAddress, | ||
uint32_t | GPXData ) |
Set GPXCtrl register.
drvno | select PCIe board |
GPXAddress | address to access |
GPXData | data to write |
es_status_codes SetHardwareTimerStopMode | ( | uint32_t | drvno, |
bool | stop_by_hardware ) |
Reset the internal intr collect counter.
drvno | board number |
stop_by_hardware | true: timer is stopped by hardware if nos is reached |
es_status_codes SetManualState | ( | uint32_t | drvno, |
bool | state ) |
es_status_codes setMeasureOn | ( | uint32_t | drvno | ) |
Sets setMeasureOn bit in PCIEFLAGS and notifies UI about it.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetNobRegister | ( | uint32_t | drvno | ) |
es_status_codes SetNosRegister | ( | uint32_t | drvno | ) |
es_status_codes SetPartialBinning | ( | uint32_t | drvno, |
uint16_t | number_of_regions ) |
Turn partial binning on.
drvno | PCIe board identifier. |
number_of_regions | number of regions for partial binning |
es_status_codes SetPixelCountRegister | ( | uint32_t | drvno | ) |
Set pixel count.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetS1S2ReadDelay | ( | uint32_t | drvno | ) |
This functions sets the register S1S2ReadDealy with the setting camera_settings::s1s2_read_delay_in_10ns.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes SetSDAT | ( | uint32_t | drvno, |
uint32_t | datin10ns ) |
Sets delay after trigger hardware register.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
datin10ns | Time in 10 ns steps. 31 bit.
|
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
ecin10ns | Time in 10 ns steps. |
es_status_codes SetSensorType | ( | uint32_t | drvno, |
uint16_t | sensor_type ) |
Sets sensor type bits in register camera type.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
sensor_type | Determines sensor type. See enum sensor_type_t in enum_settings.h for options. |
es_status_codes SetShiftS1S2ToNextScan | ( | uint32_t | drvno | ) |
es_status_codes SetShutterStates | ( | uint32_t | drvno, |
uint16_t | shutter_states ) |
Sets all shutter states in one call.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | shutter_states | 16 bit value where each bit of the lower 4 represents the state of one shutter.
|
es_status_codes SetSSlope | ( | uint32_t | drvno, |
uint32_t | sslope ) |
Set the external trigger slope for scan trigger (PCI Reg CrtlA:D5 -> manual).
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
sslope | Choose slope:
|
es_status_codes SetStateControlRegister | ( | uint32_t | drvno, |
uint16_t | state ) |
es_status_codes SetSTI | ( | uint32_t | drvno, |
uint8_t | sti_mode ) |
Chooses trigger input for scan trigger input (STI)
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
sti_mode | Defines the input mode for STI.
|
es_status_codes SetSticnt | ( | uint32_t | drvno, |
uint8_t | divider ) |
Set the scan trigger input divider.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
divider |
|
es_status_codes SetSTimer | ( | uint32_t | drvno, |
uint32_t | stime ) |
Sets time for scan timer.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | stime | Trigger time. The resolution of the time depends on the resolution mode set by SetTimerResolution(). 28 bit. |
es_status_codes SetTimerResolution | ( | uint32_t | drvno, |
uint8_t | resolution_mode ) |
Set timer resolution.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
resolution_mode | Resolution of the time. See timer_resolution_t in enum_settings.h for options. |
es_status_codes SetTocnt | ( | uint32_t | drvno, |
uint8_t | divider ) |
Set the trigger output divider.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
divider | 7 bit value
|
es_status_codes SetTORReg | ( | uint32_t | drvno, |
uint8_t | tor ) |
Set signal of output port of PCIe card.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | tor | select output signal. See enum tor_out in enum_settings.h for options. |
es_status_codes SetupArea | ( | uint32_t | drvno, |
uint32_t | lines_binning, | ||
uint8_t | vfreq ) |
For FFTs: Setup area mode.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
lines_binning | Determines how many lines are binned (summed) when reading camera in area mode. |
vfreq | Frequency for vertical clock. |
es_status_codes SetupFullBinning | ( | uint32_t | drvno, |
uint32_t | lines, | ||
uint8_t | vfreq ) |
For FFTs: Setup full binning.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
lines | Lines in camera. |
vfreq | Frequency for vertical clock. |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
number_of_regions | determines how many region of interests are initialized, choose 2 to 8 |
lines | number of total lines in camera |
region_size | determines 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. |
vfreq | VCLK frequency |
es_status_codes SetupVCLKReg | ( | uint32_t | drvno, |
uint32_t | lines, | ||
uint8_t | vfreq ) |
Set REG VCLKCTRL for FFT sensors.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
lines | number of vertical lines |
vfreq | vertical clock frequency |
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.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
range | Determines the range, for which the value lines will be written.
|
lines | number of vertical clocks for next read
|
void SetVirtualCamcnt | ( | uint32_t | drvno | ) |
es_status_codes SetXckdelay | ( | uint32_t | drvno, |
uint32_t | xckdelay_in_10ns ) |
DEPRECATED. Set XCK delay.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
xckdelay_in_10ns | XCK delay, 31 bit. xckdelay = 500ns + xckdelay_in_10ns * 10ns
|
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.
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.
drvno | selects PCIe board |
USE_ENFFW_PROTECT | enables or disables RX_VALID write protection |
es_status_codes WaitForBlockDone | ( | ) |
Returns when block on bit is 0.
es_status_codes WaitForBlockOn | ( | uint32_t | drvno | ) |
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
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. May only work for 1 |
es_status_codes WaitForMeasureDone | ( | ) |
Returns when measure on bit is 0.
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.
data | 4 bytes (32 bits) data to write |
bitmask | Bitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written. |
address | Address of the register in DMA space. |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. |
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.
data | 1 bytes (8 bits) data to write |
bitmask | Bitmask to select specific bits, which should be written. 0xFF - all bits 8 bits are written, 0 - no bits are written. |
address | Address of the register in DMA space. |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. |
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.
data | 4 bytes (32 bits) data to write |
bitmask | Bitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written. |
address | Address of the register in S0 space. |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. |
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.
data | 4 bytes (32 bits) data to write |
bitmask | Bitmask to select specific bits, which should be written. 0xFFFFFFFF - all bits 32 bits are written, 0 - no bits are written. |
address | Address of the register in S0 space. |
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.
data | 1 bytes (8 bits) data to write |
bitmask | Bitmask to select specific bits, which should be written. 0xFF - all bits 8 bits are written, 0 - no bits are written. |
address | Address of the register in S0 space. |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0. |
es_status_codes writeRegisterDma_32 | ( | uint32_t | drvno, |
uint32_t | data, | ||
uint32_t | address ) |
Write 4 bytes to a register in DMA space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Read buffer. |
address | Address of the register to read. |
es_status_codes writeRegisterDma_8 | ( | uint32_t | drvno, |
uint8_t | data, | ||
uint32_t | address ) |
Write 1 byte to a register in DMA space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Read buffer. |
address | Address of the register to read. |
es_status_codes writeRegisterS0_16 | ( | uint32_t | drvno, |
uint16_t | data, | ||
uint32_t | address ) |
Write 2 bytes of a register in S0 space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Data to write. |
address | Address of the register to read. |
es_status_codes writeRegisterS0_32 | ( | uint32_t | drvno, |
uint32_t | data, | ||
uint32_t | address ) |
Write 4 byte of a register in S0 space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Data to write. |
address | Address of the register to read. |
es_status_codes writeRegisterS0_32_allBoards | ( | uint32_t | data, |
uint32_t | address ) |
Write 4 bytes of a register in S0 space.
data | Data to write. |
address | Address of the register to read. |
es_status_codes writeRegisterS0_8 | ( | uint32_t | drvno, |
uint8_t | data, | ||
uint32_t | address ) |
Write 1 byte of a register in S0 space.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
data | Data to write. |
address | Address of the register to read. |
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.
data | Data to write. |
address | Address of the register to write. |