File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ class DmaChannelInterface
143143 // / Gets card unique ID, such as an FPGA chip ID in the case of the CRU
144144 // / \return A string containing the unique ID
145145 virtual boost::optional<std::string> getCardId () = 0;
146+
147+ // / Gets the first orbit received by CRU
148+ // / cf JIRA OMON-800
149+ // / \return orbit number, or -1 if not found.
150+ virtual int32_t getCounterFirstOrbit () {
151+ return -1 ;
152+ }
146153};
147154
148155} // namespace roc
Original file line number Diff line number Diff line change @@ -481,5 +481,18 @@ boost::optional<std::string> CruDmaChannel::getCardId()
481481 }
482482}
483483
484+ int32_t CruDmaChannel::getCounterFirstOrbit () {
485+ int address = 0x0 ;
486+ int endpoint = getBar ()->getEndpointNumber ();
487+ if (endpoint == 0 ) {
488+ address = 0x64002C ;
489+ } else if (endpoint == 1 ) {
490+ address = 0x74002C ;
491+ } else {
492+ return -1 ;
493+ }
494+ return getBar2 ()->readRegister (address / 4 );
495+ }
496+
484497} // namespace roc
485498} // namespace o2
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ class CruDmaChannel final : public DmaChannelPdaBase
6262 virtual boost::optional<std::string> getCardId () override ;
6363 AllowedChannels allowedChannels ();
6464
65+ virtual int32_t getCounterFirstOrbit () override ;
66+
6567 protected:
6668 virtual void deviceStartDma () override ;
6769 virtual void deviceStopDma () override ;
You can’t perform that action at this time.
0 commit comments