Skip to content

Commit 773fdc9

Browse files
authored
Merge pull request #429 from sy-c/master
v0.46.0
2 parents 26ebdaa + 244bc59 commit 773fdc9

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ endif()
2424

2525
# Define project
2626
project(ReadoutCard
27-
VERSION 0.45.7
27+
VERSION 0.46.0
2828
DESCRIPTION "O2 ReadoutCard library"
2929
LANGUAGES C CXX
3030
)

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@ This file describes the main feature changes for released versions of ReadoutCar
9393

9494
## v0.45.7 - 13/03/2025
9595
- o2-roc-config: added (temporary) option --test-mode-ORC501 to enable testing of new firmware as described in [ORC-501](https://its.cern.ch/jira/browse/ORC-501).
96+
97+
## v0.46.0 - 19/03/2025
98+
- class DmaChannelInterface: added getCounterFirstOrbit(), c.f. JIRA OMON-800

include/ReadoutCard/DmaChannelInterface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/Cru/CruDmaChannel.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/Cru/CruDmaChannel.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)