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

All the low level platform specific implementations for interacting with the Stresing PCIe board. More...

#include "../Board_ll.h"
#include <stdint.h>
#include "../Board.h"
#include <process.h>
#include <io.h>
#include "../../version.h"
#include "../Direct2dViewer_c.h"

Macros

#define DIV   1024
 
#define WIDTH   7
 

Functions

es_status_codes CleanupDma (uint32_t drvno)
 Cleanup DMA buffer.
 
void isr (uint32_t drvno)
 This interrupt routine copies data from the DMA buffer to the user buffer. If write to disk is true, the data is also written to disc.
 
void __stdcall interrupt_handler0 (void)
 
void __stdcall interrupt_handler1 (void)
 
void __stdcall interrupt_handler2 (void)
 
void __stdcall interrupt_handler3 (void)
 
void __stdcall interrupt_handler4 (void)
 
es_status_codes readRegister_32 (uint32_t drvno, uint32_t *data, uint32_t address)
 Reads 4 bytes on DMA area.
 
es_status_codes readRegister_16 (uint32_t drvno, uint16_t *data, uint32_t address)
 Reads long on DMA area.
 
es_status_codes readRegister_8 (uint32_t drvno, uint8_t *data, uint32_t address)
 Read byte (8 bit) from register of PCIe board, except r10-r1f.
 
es_status_codes writeRegister_32 (uint32_t drvno, uint32_t data, uint32_t address)
 Writes 32 bits (4 bytes) to register.
 
es_status_codes writeRegister_16 (uint32_t drvno, uint16_t data, uint32_t address)
 Writes 16 bits (2 bytes) to register.
 
es_status_codes writeRegister_8 (uint32_t drvno, uint8_t data, uint32_t address)
 Write byte (8 bit) to register in space0 of PCIe board, except r10-r1f.
 
es_status_codes checkDriverHandle (uint32_t drvno)
 
uint64_t getPhysicalDmaAddress (uint32_t drvno)
 
es_status_codes SetupDma (uint32_t drvno)
 Allocate DMA buffer - should only be called once.
 
es_status_codes enableInterrupt (uint32_t drvno)
 Enable interrupt.
 
es_status_codes disableInterrupt (uint32_t drvno)
 Disable interrupt.
 
void ResetBufferWritePos (uint32_t drvno)
 Reset the buffer write pointers and software ISR counter.
 
void copyRestData (uint32_t drvno, size_t rest_in_bytes)
 DMA copies in blocks of dmaBufferSizeInWords/DMA_BUFFER_PARTS - the rest is copied here.
 
es_status_codes _InitBoard (uint32_t drvno)
 Initializes PCIe board on a platform specific way.
 
es_status_codes _InitDriver (uint8_t *_number_of_boards)
 Windows specific function for initializing driver.
 
es_status_codes CleanupDriver (uint32_t drvno)
 Cleanup driver. Call this before Exit driver.
 
es_status_codes _ExitDriver ()
 Exit driver. Call this after Cleanup driver.
 
es_status_codes readConfig_32 (uint32_t drvno, uint32_t *data, uint32_t address)
 Read long (32 bit) from runtime register of PCIe board.
 
es_status_codes writeConfig_32 (uint32_t drvno, uint32_t data, uint32_t address)
 Write long (32 bit) to register in space0 of PCIe board.
 
es_status_codes FreeMemInfo (uint64_t *pmemory_all, uint64_t *pmemory_free)
 Get the free and installed memory info.
 
es_status_codes StartCopyDataToUserBufferThread (uint32_t drvno)
 Start thread which polls DMA buffer to user buffer when software polling is used.
 
es_status_codes InitMutex (uint32_t drvno)
 Initialize mutexes for register read/write.
 
void initPerformanceCounter ()
 Initialize performance counter for high resolution timing.
 
int64_t GetTimestampInTicks ()
 Get the current timestamp in ticks.
 
int64_t GetTimestampInMicroseconds ()
 Get the current timestamp in microseconds.
 
int64_t GetTimestampInMilliseconds ()
 Get the current timestamp in milliseconds.
 
int64_t ConvertTicksToMicroseconds (int64_t ticks)
 Translate ticks to microseconds.
 
uint8_t WaitforTelapsed (int64_t microseconds)
 This functions returns after a time given in microseconds. The time is measured in CPU ticks. The function is escapable by pressing ESC.
 
uint16_t checkEscapeKeyState ()
 Check if escape key was pressed.
 
uint16_t checkSpaceKeyState ()
 Check if space key was pressed.
 
es_status_codes SetPriority ()
 Set thread to high priority level.
 
es_status_codes ResetPriority ()
 Reset thread priority to normal.
 
uint16_t * getVirtualDmaAddress (uint32_t drvno)
 Get the virtual address of the DMA buffer.
 
uint32_t getDmaBufferSizeInBytes (uint32_t drvno)
 Get the size of the DMA buffer in bytes.
 
int64_t getCurrentInterruptCounter (uint32_t drvno)
 Get the current interrupt counter.
 
es_status_codes SaveMeasurementDataToFileBIN (const char *filename)
 Export the measurement data to a binary file.
 
es_status_codes CopyFromFileToUserBufferBIN (const char *filename)
 Import measurement data from binary file to user buffer.
 
void openFile (uint32_t drvno)
 Open a file or create it for writing measurement data.
 
void closeFile (uint32_t drvno)
 Close the file.
 
void setTimestamp ()
 Set the start timestamp that is used for file name and file header.
 
void writeFileHeaderToFile (uint32_t drvno)
 Creates a file at filename_full and writes struct file_header to it.
 
void writeToDisc (uint32_t *drvno_ptr)
 Thread function which writes data from user buffer to disc.
 
void startWriteToDiscThead (uint32_t drvno)
 Start thread which writes data from user buffer to disc.
 
void VerifyData (struct verify_data_parameter *vd)
 Check a file for its data consistency.
 
void getFileHeaderFromFile (struct file_header *fh, const char *filename_full)
 Open the file at filename_full and write the header to fh.
 
void WaitForAllInterruptsDone ()
 Wait until all interrupts are done or timeout occurs.
 
es_status_codes About (uint32_t board_sel)
 Display information about registers and settings in pop up windows.
 
es_status_codes AboutDrv (uint32_t drvno)
 Shows window with infos about the PCIe board.
 
es_status_codes AboutGPX (uint32_t drvno)
 Reads registers 0 to 12 of TDC-GPX chip. Time delay counter option.
 
es_status_codes AboutS0 (uint32_t drvno)
 Read registers of space0. Space0 are the control registers of the PCIe board.
 
es_status_codes AboutTLPs (uint32_t drvno)
 
es_status_codes AboutPCI (uint32_t drvno)
 Read registers of PCIe config space.
 
es_status_codes AboutMeasurementSettings ()
 Show measurement settings in a message box.
 
es_status_codes AboutCameraSettings (uint32_t drvno)
 Show camera settings in a message box.
 
void ErrMsgBoxOn ()
 Switch on error message boxes of our software. Default is On.
 
void ErrMsgBoxOff ()
 Disable error message boxes, if not needed.
 
void ErrorMsg (char ErrMsg[100])
 Display error message. If ErrMsgBoxOn is set.
 
void ValMsg (uint64_t val)
 Simple display of unsigned integer as error message for test purpose.
 
void Start2dViewer (uint32_t drvno, uint32_t block, uint16_t camera, uint16_t pixel, uint32_t nos)
 Start 2d viewer.
 
void ShowNewBitmap (uint32_t drvno, uint32_t block, uint16_t camera, uint16_t pixel, uint32_t nos)
 Update the displayed bitmap.
 
void Deinit2dViewer ()
 Call when closing 2d viewer or at least before opening a new 2d viewer.
 
void SetGammaValue (uint16_t white, uint16_t black)
 Set gamma value.
 
uint16_t GetGammaWhite ()
 return gamma value white
 
uint16_t GetGammaBlack ()
 return gamma value black
 
void LockHighLevelMutex (uint32_t drvno)
 Lock the mutex for register read/write.
 
void UnlockHighLevelMutex (uint32_t drvno)
 Unlock the mutex for register read/write.
 

Variables

volatile DWORD dmaBufferSizeInBytes [MAXPCIECARDS] = { 0, 0, 0, 0, 0 }
 
uint16_t * dmaBuffer [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
volatile uint64_t IsrCounter [MAXPCIECARDS] = { 0, 0, 0, 0, 0 }
 
volatile UINT8 dmaBufferPartReadPos [MAXPCIECARDS] = { 0, 0, 0, 0, 0 }
 
bool _SHOW_MSG = TRUE
 
HANDLE ghMutex [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
HANDLE registerReadWriteMutex [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
HANDLE registerReadWriteMutexHighLevel [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
HANDLE mutexUserBuffer [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
FILE * file_stream [MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }
 
void * Direct2dViewer = NULL
 
uint16_t * greyscale_data = NULL
 
LARGE_INTEGER freq
 
LSCPCIEJ_INT_HANDLER_STUB interrupt_handler_array [MAXPCIECARDS] = { &interrupt_handler0, &interrupt_handler1, &interrupt_handler2, &interrupt_handler3, &interrupt_handler4 }
 

Detailed Description

All the low level platform specific implementations for interacting with the Stresing PCIe board.

Author
Florian Hahn
Date
23.10.2020

Macro Definition Documentation

◆ DIV

#define DIV   1024

◆ WIDTH

#define WIDTH   7

Function Documentation

◆ _ExitDriver()

es_status_codes _ExitDriver ( )

Exit driver. Call this after Cleanup driver.

Returns
es_status_codes

◆ _InitBoard()

es_status_codes _InitBoard ( uint32_t drvno)

Initializes PCIe board on a platform specific way.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ _InitDriver()

es_status_codes _InitDriver ( uint8_t * _number_of_boards)

Windows specific function for initializing driver.

Parameters
[out]_number_of_boardsPointer to number of boards found.
Returns
es_status_codes

◆ About()

es_status_codes About ( uint32_t board_sel)

Display information about registers and settings in pop up windows.

Returns
es_status_codes

◆ AboutCameraSettings()

es_status_codes AboutCameraSettings ( uint32_t drvno)

Show camera settings in a message box.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ AboutDrv()

es_status_codes AboutDrv ( uint32_t drvno)

Shows window with infos about the PCIe board.

  • version of driver
  • ID = 53xx
  • length of space0 BAR =0x3f
  • vendor ID = EBST
  • PCI board version (same as label on PCI board)
    Parameters
    drvnoboard number (=1 if one PCI board)
    Returns
    es_status_codes

◆ AboutGPX()

es_status_codes AboutGPX ( uint32_t drvno)

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

Parameters
drvnoPCIe board identifier
Returns
es_status_codes

◆ AboutMeasurementSettings()

es_status_codes AboutMeasurementSettings ( )

Show measurement settings in a message box.

Returns
es_status_codes

◆ AboutPCI()

es_status_codes AboutPCI ( uint32_t drvno)

Read registers of PCIe config space.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ AboutS0()

es_status_codes AboutS0 ( uint32_t drvno)

Read registers of space0. Space0 are the control registers of the PCIe board.

Parameters
drvnoPCIe board identifier
Returns
es_status_codes

◆ AboutTLPs()

es_status_codes AboutTLPs ( uint32_t drvno)
Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ checkDriverHandle()

es_status_codes checkDriverHandle ( uint32_t drvno)

Check drvno for being legit

Parameters
[in]drvnodriver number
Returns
es_status_codes

◆ checkEscapeKeyState()

uint16_t checkEscapeKeyState ( )

Check if escape key was pressed.

Returns
non zero if escape key was pressed

◆ checkSpaceKeyState()

uint16_t checkSpaceKeyState ( )

Check if space key was pressed.

Returns
non zero if space key was pressed

◆ CleanupDma()

es_status_codes CleanupDma ( uint32_t drvno)

Cleanup DMA buffer.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ CleanupDriver()

es_status_codes CleanupDriver ( uint32_t drvno)

Cleanup driver. Call this before Exit driver.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ closeFile()

void closeFile ( uint32_t drvno)

Close the file.

Parameters
[in]drvnoPCIe board identifier.

◆ ConvertTicksToMicroseconds()

int64_t ConvertTicksToMicroseconds ( int64_t ticks)

Translate ticks to microseconds.

Parameters
[in]ticksticks of system timer
Returns
microseconds of ticks

◆ CopyFromFileToUserBufferBIN()

es_status_codes CopyFromFileToUserBufferBIN ( const char * filename)

Import measurement data from binary file to user buffer.

Parameters
[in]filenameFilename with complete absolute path.
Returns
es_status_codes

◆ copyRestData()

void copyRestData ( uint32_t drvno,
size_t rest_in_bytes )

DMA copies in blocks of dmaBufferSizeInWords/DMA_BUFFER_PARTS - the rest is copied here.

Parameters
[in]drvnoPCIe board identifier.
rest_in_bytesbytes which were not copied by INTR.

◆ Deinit2dViewer()

void Deinit2dViewer ( )

Call when closing 2d viewer or at least before opening a new 2d viewer.

◆ disableInterrupt()

es_status_codes disableInterrupt ( uint32_t drvno)

Disable interrupt.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ enableInterrupt()

es_status_codes enableInterrupt ( uint32_t drvno)

Enable interrupt.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ ErrMsgBoxOff()

void ErrMsgBoxOff ( )

Disable error message boxes, if not needed.

◆ ErrMsgBoxOn()

void ErrMsgBoxOn ( )

Switch on error message boxes of our software. Default is On.

◆ ErrorMsg()

void ErrorMsg ( char ErrMsg[100])

Display error message. If ErrMsgBoxOn is set.

Parameters
[in]ErrMsgMessage. Buffer size: 100.

◆ FreeMemInfo()

es_status_codes FreeMemInfo ( uint64_t * pmemory_all,
uint64_t * pmemory_free )

Get the free and installed memory info.

Parameters
[out]pmemory_allhow much is installed
[out]pmemory_freehow much is free
Returns
es_status_codes

◆ getCurrentInterruptCounter()

int64_t getCurrentInterruptCounter ( uint32_t drvno)

Get the current interrupt counter.

When measurement_cnt is greater than 1, that means measurement is running in a loop, return number of interrupts, because the last interrupt was the maximum number of interrupts, when the IsrCounter is 0.

Parameters
[in]drvnoPCIe board identifier.
Returns
current interrupt counter

◆ getDmaBufferSizeInBytes()

uint32_t getDmaBufferSizeInBytes ( uint32_t drvno)

Get the size of the DMA buffer in bytes.

Parameters
[in]drvnoPCIe board identifier.
Returns
size of DMA buffer in bytes

◆ getFileHeaderFromFile()

void getFileHeaderFromFile ( struct file_header * fh,
const char * filename_full )

Open the file at filename_full and write the header to fh.

Parameters
fhstruct file_header*
filename_fullPath and file name to the file.

◆ GetGammaBlack()

uint16_t GetGammaBlack ( )

return gamma value black

◆ GetGammaWhite()

uint16_t GetGammaWhite ( )

return gamma value white

◆ getPhysicalDmaAddress()

uint64_t getPhysicalDmaAddress ( uint32_t drvno)

◆ GetTimestampInMicroseconds()

int64_t GetTimestampInMicroseconds ( )

Get the current timestamp in microseconds.

Returns
microseconds of system timer

◆ GetTimestampInMilliseconds()

int64_t GetTimestampInMilliseconds ( )

Get the current timestamp in milliseconds.

Returns
milliseconds of system timer

◆ GetTimestampInTicks()

int64_t GetTimestampInTicks ( )

Get the current timestamp in ticks.

Returns
ticks of system timer

◆ getVirtualDmaAddress()

uint16_t * getVirtualDmaAddress ( uint32_t drvno)

Get the virtual address of the DMA buffer.

Parameters
[in]drvnoPCIe board identifier.
Returns
pointer to DMA buffer

◆ InitMutex()

es_status_codes InitMutex ( uint32_t drvno)

Initialize mutexes for register read/write.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ initPerformanceCounter()

void initPerformanceCounter ( )

Initialize performance counter for high resolution timing.

This function must be called once before using GetTimestampInTicks.

◆ interrupt_handler0()

void __stdcall interrupt_handler0 ( void )

◆ interrupt_handler1()

void __stdcall interrupt_handler1 ( void )

◆ interrupt_handler2()

void __stdcall interrupt_handler2 ( void )

◆ interrupt_handler3()

void __stdcall interrupt_handler3 ( void )

◆ interrupt_handler4()

void __stdcall interrupt_handler4 ( void )

◆ isr()

void isr ( uint32_t drvno)

This interrupt routine copies data from the DMA buffer to the user buffer. If write to disk is true, the data is also written to disc.

This routine is called every DMASPERINTR=500 scans. The size of a drivers contiguous memory is limited, so we must copy the data from a small buffer to a bigger buffer. The copy process is split in lower/upper half blocks.

Parameters
[in]drvnoPCIe board identifier.

◆ LockHighLevelMutex()

void LockHighLevelMutex ( uint32_t drvno)

Lock the mutex for register read/write.

Parameters
[in]drvnoPCIe board identifier.

◆ openFile()

void openFile ( uint32_t drvno)

Open a file or create it for writing measurement data.

Parameters
[in]drvnoPCIe board identifier.

◆ readConfig_32()

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

Read long (32 bit) from runtime register of PCIe board.

This function reads the memory mapped data , not the I/O Data. Reads data from PCIe config space.

Parameters
[in]drvnoboard number (=1 if one PCI board)
[out]datapointer to where data is stored
[in]addressoffset of register (count in bytes)
Returns
es_status_codes

◆ readRegister_16()

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

Reads long on DMA area.

Parameters
[in]drvnoPCIe board identifier
[out]databuffer for data
[in]addressOffset from BaseAdress - in Bytes ! 0..3= Regs of Board.
Returns
es_status_codes

◆ readRegister_32()

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

Reads 4 bytes on DMA area.

Parameters
[in]drvnoPCIe board identifier
[out]databuffer for data
[in]addressOffset from BaseAdress - in Bytes ! 0..3= Regs of Board.
Returns
es_status_codes

◆ readRegister_8()

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

Read byte (8 bit) from register of PCIe board, except r10-r1f.

Parameters
[in]drvnoboard number (=0 if one PCI board)
[out]datapointer to where data is stored
[in]addressoffset of register from base address (count in bytes)
Returns
es_status_codes

◆ ResetBufferWritePos()

void ResetBufferWritePos ( uint32_t drvno)

Reset the buffer write pointers and software ISR counter.

Parameters
[in]drvnoPCIe board identifier.

◆ ResetPriority()

es_status_codes ResetPriority ( )

Reset thread priority to normal.

Returns
es_status_codes

◆ SaveMeasurementDataToFileBIN()

es_status_codes SaveMeasurementDataToFileBIN ( const char * filename)

Export the measurement data to a binary file.

Parameters
[in]filenameFilename with complete absolute path.
Returns
es_status_codes

◆ SetGammaValue()

void SetGammaValue ( uint16_t white,
uint16_t black )

Set gamma value.

Parameters
[in]whiteset value for maximum brightness. Default: 0xFFFF (16 bit), 0x3FFF (14 bit)
[in]blackset value for minimum brightness. Default: 0

◆ SetPriority()

es_status_codes SetPriority ( )

Set thread to high priority level.

Returns
es_status_codes

◆ setTimestamp()

void setTimestamp ( )

Set the start timestamp that is used for file name and file header.

◆ SetupDma()

es_status_codes SetupDma ( uint32_t drvno)

Allocate DMA buffer - should only be called once.

Gets address of DMASubBuf from driver and copy it later to our pDMABigBuf.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ ShowNewBitmap()

void ShowNewBitmap ( uint32_t drvno,
uint32_t block,
uint16_t camera,
uint16_t pixel,
uint32_t nos )

Update the displayed bitmap.

Parameters
[in]drvnoboard number
[in]blockcurrent number of blocks
[in]camerawhich camera to display (when camcnt is >1)
[in]pixelcount of pixel of one line
[in]nossamples in one block

◆ Start2dViewer()

void Start2dViewer ( uint32_t drvno,
uint32_t block,
uint16_t camera,
uint16_t pixel,
uint32_t nos )

Start 2d viewer.

Parameters
[in]drvnoboard number
[in]blockcurrent number of block
[in]camerawhich camera to display (when camcnt is >1)
[in]pixelcount of pixel of one line
[in]nossamples in one block

◆ StartCopyDataToUserBufferThread()

es_status_codes StartCopyDataToUserBufferThread ( uint32_t drvno)

Start thread which polls DMA buffer to user buffer when software polling is used.

Parameters
[in]drvnoPCIe board identifier.
Returns
es_status_codes

◆ startWriteToDiscThead()

void startWriteToDiscThead ( uint32_t drvno)

Start thread which writes data from user buffer to disc.

Parameters
[in]drvnoPCIe board identifier.

◆ UnlockHighLevelMutex()

void UnlockHighLevelMutex ( uint32_t drvno)

Unlock the mutex for register read/write.

Parameters
[in]drvnoPCIe board identifier.

◆ ValMsg()

void ValMsg ( uint64_t val)

Simple display of unsigned integer as error message for test purpose.

Parameters
[in]valunsigned integer 64 bit

◆ VerifyData()

void VerifyData ( struct verify_data_parameter * vd)

Check a file for its data consistency.

Parameters
vdsee struct verify_data_parameter in globals.h for details

◆ WaitForAllInterruptsDone()

void WaitForAllInterruptsDone ( )

Wait until all interrupts are done or timeout occurs.

◆ WaitforTelapsed()

uint8_t WaitforTelapsed ( int64_t microseconds)

This functions returns after a time given in microseconds. The time is measured in CPU ticks. The function is escapable by pressing ESC.

Parameters
[in]microsecondsTime to wait in microseconds.
Returns
1 when success, 0 when aborted by ESC or failure

◆ writeConfig_32()

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

Write long (32 bit) to register in space0 of PCIe board.

Parameters
[in]drvnoboard number (=1 if one PCI board)
[in]datalong value to write
[in]addressoffset from base address of register (count in bytes)
Returns
es_status_codes

◆ writeFileHeaderToFile()

void writeFileHeaderToFile ( uint32_t drvno)

Creates a file at filename_full and writes struct file_header to it.

Parameters
[in]drvnoPCIe board identifier.

◆ writeRegister_16()

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

Writes 16 bits (2 bytes) to register.

Parameters
[in]drvnoPCIe board identifier.
[in]datadata to write
[in]addressRegister offset from BaseAdress - in bytes
Returns
es_status_codes

◆ writeRegister_32()

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

Writes 32 bits (4 bytes) to register.

Parameters
[in]drvnoPCIe board identifier.
[in]datadata to write
[in]addressRegister offset from BaseAdress - in bytes
Returns
es_status_codes

◆ writeRegister_8()

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

Write byte (8 bit) to register in space0 of PCIe board, except r10-r1f.

Parameters
[in]drvnoboard number (=1 if one PCI board)
[in]databyte value to write
[in]addressOffset from BaseAdress of register (count in bytes)
Returns
es_status_codes

◆ writeToDisc()

void writeToDisc ( uint32_t * drvno_ptr)

Thread function which writes data from user buffer to disc.

Parameters
[in]drvno_ptrPointer to PCIe board identifier.

Variable Documentation

◆ _SHOW_MSG

bool _SHOW_MSG = TRUE

◆ Direct2dViewer

void* Direct2dViewer = NULL

◆ dmaBuffer

uint16_t* dmaBuffer[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }

◆ dmaBufferPartReadPos

volatile UINT8 dmaBufferPartReadPos[MAXPCIECARDS] = { 0, 0, 0, 0, 0 }

◆ dmaBufferSizeInBytes

volatile DWORD dmaBufferSizeInBytes[MAXPCIECARDS] = { 0, 0, 0, 0, 0 }

◆ file_stream

FILE* file_stream[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }

◆ freq

LARGE_INTEGER freq

◆ ghMutex

HANDLE ghMutex[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }

◆ greyscale_data

uint16_t* greyscale_data = NULL

◆ interrupt_handler_array

LSCPCIEJ_INT_HANDLER_STUB interrupt_handler_array[MAXPCIECARDS] = { &interrupt_handler0, &interrupt_handler1, &interrupt_handler2, &interrupt_handler3, &interrupt_handler4 }

◆ IsrCounter

volatile uint64_t IsrCounter[MAXPCIECARDS] = { 0, 0, 0, 0, 0 }

◆ mutexUserBuffer

HANDLE mutexUserBuffer[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }

◆ registerReadWriteMutex

HANDLE registerReadWriteMutex[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }

◆ registerReadWriteMutexHighLevel

HANDLE registerReadWriteMutexHighLevel[MAXPCIECARDS] = { NULL, NULL, NULL, NULL, NULL }