Scope
scope::FPGADigitalDemultiplexer Class Reference

#include <FPGADigitalDemultiplexer.h>

Inherits scope::FPGAInterface, and scope::FPGAIO6587.

Public Member Functions

 FPGADigitalDemultiplexer ()
 
 ~FPGADigitalDemultiplexer ()
 
void Initialize (parameters::InputsFPGA *_parameters) override
 
double SetPixeltime (const uint32_t &_area, const double &_pixeltime) override
 
double SetLinetime (const uint32_t &_area, const double &_linetime) override
 
void SetTriggering (const bool &_waitfortrigger) override
 
void SetContinuousAcquisition (const bool &_cont) override
 
void SetRequestedPixels (const uint32_t &_area, const uint32_t &_reqpixels) override
 
void StartAcquisition () override
 
void StopAcquisition () override
 
void ResetAcquisition ()
 
int32_t ReadPixels (DaqChunk &_chunk, const double &_timeout, bool &_timedout) override
 
void CheckFPGADiagnosis ()
 
void ClearFIFOs ()
 
void SetCountMode (const bool &_mode)
 
- Public Member Functions inherited from scope::FPGAInterface
virtual ~FPGAInterface ()
 
virtual void SetScannerdelay (const uint32_t &_scannerdelay)
 
FPGAStatusSafe CurrentStatus () const
 
- Public Member Functions inherited from scope::FPGAIO6587
 FPGAIO6587 (const uint32_t &_clock_ready, const uint32_t &_clock_write_data, const uint32_t &_clock_write, const uint32_t &_xpoint_ready, const uint32_t &_clock_source, const uint32_t &_xpoint_write, const uint32_t &_commit_control, const uint32_t &_acquisition_reset_control)
 
bool CheckIOModule (NiFpga_Session _session)
 
void WriteOnboardClockFrequency (NiFpga_Session _session, const double &_clock_freq)
 
void SetClockSource (NiFpga_Session _session, const uint8_t &_clock_source=3)
 
void InitializeAcquisition (NiFpga_Session _session)
 

Protected Attributes

parameters::InputsFPGADigitalDemultiplexerparameters
 
std::array< NiFpga_DigitalDemultiplexerV3_TargetToHostFifoU16, 4 > fifos
 
std::array< double, 2 > pixeltimes
 
std::array< NiFpga_DigitalDemultiplexerV3_ControlU32, 2 > reqpixels
 
std::array< NiFpga_DigitalDemultiplexerV3_ControlU16, 2 > smplsperpixel
 
std::array< NiFpga_DigitalDemultiplexerV3_ControlU16, 2 > smplsperpixelacq
 
double samplingrate
 
- Protected Attributes inherited from scope::FPGAInterface
FPGAStatusSafe status
 
NiFpga_Session session
 
bool initialized
 
- Protected Attributes inherited from scope::FPGAIO6587
const uint32_t onboard_clock_ready_indicator
 
const uint32_t onboard_clock_write_data_control
 
const uint32_t onboard_clock_write_control
 
const uint32_t xpoint_switch_ready_indicator
 
const uint32_t clock_source_control
 
const uint32_t xpoint_switch_write_control
 
const uint32_t commit_control
 
const uint32_t acquisition_reset_control
 
std::array< uint16_t, 9 > regndata
 
FPGAStatusSafe iostatus
 

Additional Inherited Members

- Protected Member Functions inherited from scope::FPGAIO6587
void ClockFrequencySetup (const double &_clock_freq)
 

Detailed Description

Wraps an FPGA that does two area demultiplexing and photon counting.

Definition at line 18 of file FPGADigitalDemultiplexer.h.

Constructor & Destructor Documentation

scope::FPGADigitalDemultiplexer::FPGADigitalDemultiplexer ( )

Load the FPGA bitfile, set the IO module's onboard clock, initialize the acquisition.

Definition at line 8 of file FPGADigitalDemultiplexer.cpp.

scope::FPGADigitalDemultiplexer::~FPGADigitalDemultiplexer ( void  )

Close FPGA session.

Definition at line 51 of file FPGADigitalDemultiplexer.cpp.

Member Function Documentation

void scope::FPGADigitalDemultiplexer::Initialize ( parameters::InputsFPGA _parameters)
overridevirtual

Set initial parameters.

Derived classes override this and cast _parameters to the appropriate derived type. Derived functions should check if already initialized.

Reimplemented from scope::FPGAInterface.

Definition at line 57 of file FPGADigitalDemultiplexer.cpp.

double scope::FPGADigitalDemultiplexer::SetPixeltime ( const uint32_t &  _area,
const double &  _pixeltime 
)
overridevirtual

Sets the time per pixel/dwell time (in seconds)

Parameters
[in]_areafor which area
[in]_pixeltimethe pixel dwell time in seconds
Returns
the actual pixel dwell time, can be different than requested due to finite clock rate

Reimplemented from scope::FPGAInterface.

Definition at line 81 of file FPGADigitalDemultiplexer.cpp.

double scope::FPGADigitalDemultiplexer::SetLinetime ( const uint32_t &  _area,
const double &  _linetime 
)
overridevirtual

Sets the time per line (in seconds) for the generation of the line clock (if implemented)

Parameters
[in]_areafor which area
[in]_linetimethe line time in seconds
Returns
the actual line time, can be different than requested due to finite clock rate

Reimplemented from scope::FPGAInterface.

Definition at line 96 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::SetTriggering ( const bool &  _waitfortrigger)
overridevirtual

Sets if the FPGA should wait for a trigger before starting acquisition.

Parameters
[in]_waitfortriggertrue if wait for trigger

Reimplemented from scope::FPGAInterface.

Definition at line 101 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::SetContinuousAcquisition ( const bool &  _cont)
overridevirtual

Sets if the FPGA should acquire data continuously or acquire the number of pixels per channel set with SetRequestedPixels.

Parameters
[in]_contyes or no

Reimplemented from scope::FPGAInterface.

Definition at line 105 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::SetRequestedPixels ( const uint32_t &  _area,
const uint32_t &  _reqpixels 
)
overridevirtual

Sets the number of pixels per channel the FPGA should acquire, set to -1 for live scanning.

Parameters
[in]_areafor which area
[in]_reqpixelsnumber of pixels the FPGA should acquire before automatically stopping acquisition

Reimplemented from scope::FPGAInterface.

Definition at line 109 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::StartAcquisition ( )
overridevirtual

Starts the acquisition on the FPGA.

Reimplemented from scope::FPGAInterface.

Definition at line 113 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::StopAcquisition ( )
overridevirtual

Stops the acquisition on the FPGA.

Reimplemented from scope::FPGAInterface.

Definition at line 122 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::ResetAcquisition ( )

Resets the acquisition.

Definition at line 127 of file FPGADigitalDemultiplexer.cpp.

int32_t scope::FPGADigitalDemultiplexer::ReadPixels ( DaqChunk _chunk,
const double &  _timeout,
bool &  _timedout 
)
overridevirtual

Read only pixels from the FPGA FIFO.

Parameters
[in,out]_chunkthe daq chunk to read into, inside _chunk is information about the area for wich to retrieve, the number of pixels per channel to read, and the number of channels
[in]_timeouttime out for reading in seconds
[out]_timedoutset to true if reading timed out
Returns
number of read pixels per channel or -1 on error
Precondition
_channels > 0 && _channels <= 2

Implements scope::FPGAInterface.

Definition at line 134 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::CheckFPGADiagnosis ( )

Checks the status of the FIFOs on the FPGA.

Definition at line 165 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::ClearFIFOs ( )

Clears the interloop and ToHost FIFOs.

Definition at line 187 of file FPGADigitalDemultiplexer.cpp.

void scope::FPGADigitalDemultiplexer::SetCountMode ( const bool &  _mode)

Set the counting mode on the FPGA.

Count high samples (true) or count pulses/flanks (false).

Definition at line 203 of file FPGADigitalDemultiplexer.cpp.

Member Data Documentation

parameters::InputsFPGADigitalDemultiplexer* scope::FPGADigitalDemultiplexer::parameters
protected

the parameter set

Definition at line 24 of file FPGADigitalDemultiplexer.h.

std::array<NiFpga_DigitalDemultiplexerV3_TargetToHostFifoU16, 4> scope::FPGADigitalDemultiplexer::fifos
protected

all FIFOs for both areas both channels

Definition at line 27 of file FPGADigitalDemultiplexer.h.

std::array<double, 2> scope::FPGADigitalDemultiplexer::pixeltimes
protected

Pixel dwell time in microseconds.

Definition at line 30 of file FPGADigitalDemultiplexer.h.

std::array<NiFpga_DigitalDemultiplexerV3_ControlU32, 2> scope::FPGADigitalDemultiplexer::reqpixels
protected

requested pixels for both areas

Definition at line 33 of file FPGADigitalDemultiplexer.h.

std::array<NiFpga_DigitalDemultiplexerV3_ControlU16, 2> scope::FPGADigitalDemultiplexer::smplsperpixel
protected

samples per pixel for both areas

Definition at line 36 of file FPGADigitalDemultiplexer.h.

std::array<NiFpga_DigitalDemultiplexerV3_ControlU16, 2> scope::FPGADigitalDemultiplexer::smplsperpixelacq
protected

samples per pixel for both areas, for the acquisition loop

Definition at line 39 of file FPGADigitalDemultiplexer.h.

double scope::FPGADigitalDemultiplexer::samplingrate
protected

programmed sampling rate (usually 1-1.4GHz), this is double the IO modules clock rate

Definition at line 42 of file FPGADigitalDemultiplexer.h.


The documentation for this class was generated from the following files: