M1M3 Support System
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
LSST::M1M3::SS::IFPGA Class Referenceabstract

Abstract interface for FPGA. More...

#include <IFPGA.h>

Inheritance diagram for LSST::M1M3::SS::IFPGA:
Inheritance graph
[legend]
Collaboration diagram for LSST::M1M3::SS::IFPGA:
Collaboration graph
[legend]

Public Member Functions

uint16_t getTxCommand (uint8_t bus) override
 
uint16_t getRxCommand (uint8_t bus) override
 
uint32_t getIrq (uint8_t bus) override
 
SupportFPGADatagetSupportFPGAData ()
 Call after pullTelemetry to retrieve telemetry data.
 
HealthAndStatusFPGADatagetHealthAndStatusFPGAData ()
 Call after pullHealthAndStatus to retrieve HealthAndStatus data.
 
virtual void waitForOuterLoopClock (uint32_t timeout)=0
 Wait for outer loop clock interrupt for synchronization between C++ and FPGA code.
 
virtual void ackOuterLoopClock ()=0
 Acknowledge (clear interrupt 0) outer loop clock.
 
virtual void waitForPPS (uint32_t timeout)=0
 Waits for Peer-to-Peer Synchronization interrupt (10).
 
virtual void ackPPS ()=0
 Acknowledge (clear) Peer-to-Peer Synchronization interrupt.
 
virtual void waitForModbusIRQs (uint32_t warning_timeout, uint32_t error_timeout)=0
 Wait for ModBus interrupts.
 
virtual void ackModbusIRQs ()=0
 Acknowledge ModBus interrupt reception.
 
virtual void pullTelemetry ()=0
 Retrieve telemetry data.
 
virtual void pullHealthAndStatus ()=0
 Retrieve Health&Status data.
 
virtual void writeTimestampFIFO (uint64_t timestamp)=0
 Write current timestamp value into timestampFIFO.
 
virtual void readU8ResponseFIFO (uint8_t *data, size_t length, uint32_t timeoutInMs)=0
 
virtual void writeHealthAndStatusFIFO (uint16_t request, uint16_t param=0)=0
 Requests HealthAndStatus data.
 
virtual void readHealthAndStatusFIFO (uint64_t *data, size_t length, uint32_t timeoutInMs=10)=0
 Copy HealthAndStatus data into supplied data buffer.
 
virtual void readRawAccelerometerFIFO (uint64_t *raw, size_t samples)=0
 Reads raw accelerometer FIFO.
 
void setPower (bool aux, bool network)
 Sets all auxiliary and network buses power (A-D).
 
void setPower (const bool aux[4], const bool network[4])
 Sets aux and network power.
 

Static Public Member Functions

static IFPGAget ()
 

Protected Attributes

SupportFPGAData supportFPGAData
 
HealthAndStatusFPGAData healthAndStatusFPGAData
 

Detailed Description

Abstract interface for FPGA.

Both real FPGA and simulated class implements this. Singleton.

Please see LSST::M1M3::SS::FPGA class for communication details.

See also
FPGA
https://github.com/lsst-ts/ts_m1m3SupportFPGA

Member Function Documentation

◆ ackModbusIRQs()

virtual void LSST::M1M3::SS::IFPGA::ackModbusIRQs ( )
pure virtual

Acknowledge ModBus interrupt reception.

Interrupt can be generated (raised on the FPGA side) again after being acknowledged.

Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ ackOuterLoopClock()

virtual void LSST::M1M3::SS::IFPGA::ackOuterLoopClock ( )
pure virtual

Acknowledge (clear interrupt 0) outer loop clock.

Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ ackPPS()

virtual void LSST::M1M3::SS::IFPGA::ackPPS ( )
pure virtual

Acknowledge (clear) Peer-to-Peer Synchronization interrupt.

Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ getHealthAndStatusFPGAData()

HealthAndStatusFPGAData * LSST::M1M3::SS::IFPGA::getHealthAndStatusFPGAData ( )
inline

Call after pullHealthAndStatus to retrieve HealthAndStatus data.

Returns
HealthAndStatus data

◆ getSupportFPGAData()

SupportFPGAData * LSST::M1M3::SS::IFPGA::getSupportFPGAData ( )
inline

Call after pullTelemetry to retrieve telemetry data.

Returns
telemetry data

◆ pullHealthAndStatus()

virtual void LSST::M1M3::SS::IFPGA::pullHealthAndStatus ( )
pure virtual

Retrieve Health&Status data.

Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ pullTelemetry()

virtual void LSST::M1M3::SS::IFPGA::pullTelemetry ( )
pure virtual

Retrieve telemetry data.

Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ readHealthAndStatusFIFO()

virtual void LSST::M1M3::SS::IFPGA::readHealthAndStatusFIFO ( uint64_t * data,
size_t length,
uint32_t timeoutInMs = 10 )
pure virtual

Copy HealthAndStatus data into supplied data buffer.

Parameters
datamemory data will be copied
lengthbuffer length. Must match FPGA defined memory size (64)
timeoutInMstimeout in microseconds
Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ readRawAccelerometerFIFO()

virtual void LSST::M1M3::SS::IFPGA::readRawAccelerometerFIFO ( uint64_t * raw,
size_t samples )
pure virtual

Reads raw accelerometer FIFO.

Waits for new data if no data are available.

Parameters
raw8 raw accelerometer values. Data are stored as 24 bits fixed points (5 bits integer part) in uint64_t. So actually on 3 bytes out of 64 are used - that copies NI interface for accessing fixed points
samplesnumber of samples

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ readU8ResponseFIFO()

virtual void LSST::M1M3::SS::IFPGA::readU8ResponseFIFO ( uint8_t * data,
size_t length,
uint32_t timeoutInMs )
pure virtual
Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ setPower() [1/2]

void IFPGA::setPower ( bool aux,
bool network )

Sets all auxiliary and network buses power (A-D).

Parameters
auxauxiliary buses power (true = on)
networknetwork buses power (true = on)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPower() [2/2]

void IFPGA::setPower ( const bool aux[4],
const bool network[4] )

Sets aux and network power.

Parameters
aux[4]new auxiliar power, buses A-D
network[4]new network power, buses A-D

◆ waitForModbusIRQs()

virtual void LSST::M1M3::SS::IFPGA::waitForModbusIRQs ( uint32_t warning_timeout,
uint32_t error_timeout )
pure virtual

Wait for ModBus interrupts.

The interrupt is generated when ModBus command 0x7 is processed.

Parameters
warning_timeoutwarning timeout for IRQ call in milliseconds
error_timeoutafter that time (in millisecond) expires, and error will be thrown
Exceptions
NiErroron NI error
std::runtime_erroron timeout

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ waitForOuterLoopClock()

virtual void LSST::M1M3::SS::IFPGA::waitForOuterLoopClock ( uint32_t timeout)
pure virtual

Wait for outer loop clock interrupt for synchronization between C++ and FPGA code.

The interrupt (0) is raised every 20 ms inside FPGA code (OuterLoop/OuterLoopClock.vi).

Parameters
timeoutafter that time (in millisecond) expires, and error will be thrown
Exceptions
NiErroron NI error
See also
writeTimestampFIFO

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ waitForPPS()

virtual void LSST::M1M3::SS::IFPGA::waitForPPS ( uint32_t timeout)
pure virtual

Waits for Peer-to-Peer Synchronization interrupt (10).

The interrupt is raised in Timestamp/Timestamp.vi and signals FPGA is ready to read peer time offset from TimestampControlFIFO.

Parameters
timeoutcall timeout in milliseconds. TimeStamp VI introduces 1 milliseconds delay between successive waits for interrupt, so this value shall be larger than 1000.
Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ writeHealthAndStatusFIFO()

virtual void LSST::M1M3::SS::IFPGA::writeHealthAndStatusFIFO ( uint16_t request,
uint16_t param = 0 )
pure virtual

Requests HealthAndStatus data.

Response can be read calling readHealthAndStatusFIFO method.

Request types are:

  • 1 return single U64 value at address param
  • 2 return full HealthAndStatus memory. Size is specified when creating HealthAndStatus memory.
  • 3 clear health and status memory
Parameters
requestrequest type, see above
paramrelevant only for request 1
Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.

◆ writeTimestampFIFO()

virtual void LSST::M1M3::SS::IFPGA::writeTimestampFIFO ( uint64_t timestamp)
pure virtual

Write current timestamp value into timestampFIFO.

Shall be called after PPS interrupt is received. See NI forum for details.

Parameters
timestampcurrent system timestamp in nanoseconds
Exceptions
NiErroron NI error

Implemented in LSST::M1M3::SS::FPGA, and LSST::M1M3::SS::SimulatedFPGA.


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