srs-control
0.2.2
Toggle main menu visibility
Loading...
Searching...
No Matches
SRSDataCompact.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
srs/utils/CommonDefinitions.hpp
"
4
#include <cstdint>
5
6
namespace
srs::process::internal
7
{
8
// Dev note: need to be of unsigned type to stop clang tidy from complaining
9
constexpr
auto
CHANNEL_NUM_BIT_LENGTH
= 6U;
10
constexpr
auto
TDC_BIT_LENGTH
= 8U;
11
constexpr
auto
BC_ID_BIT_LENGTH
= 12U;
12
constexpr
auto
ADC_BIT_LENGTH
= 10U;
13
constexpr
auto
VMM_ID_BIT_LENGTH
= 5U;
14
constexpr
auto
OFFSET_BIT_LENGTH
= 5U;
15
16
constexpr
auto
CHANNEL_NUM_BIT_MAX
= (1ULL <<
CHANNEL_NUM_BIT_LENGTH
) - 1;
17
constexpr
auto
TDC_BIT_MAX
= (1ULL <<
TDC_BIT_LENGTH
) - 1;
18
constexpr
auto
OFFSET_BIT_MAX
= (1ULL <<
OFFSET_BIT_LENGTH
) - 1;
19
constexpr
auto
VMM_ID_BIT_MAX
= (1ULL <<
VMM_ID_BIT_LENGTH
) - 1;
20
constexpr
auto
ADC_BIT_MAX
= (1ULL <<
ADC_BIT_LENGTH
) - 1;
21
constexpr
auto
BC_ID_BIT_MAX
= (1ULL <<
BC_ID_BIT_LENGTH
) - 1;
22
constexpr
auto
SRS_TIMESTAMP_MAX
=
23
(1ULL << (
common::SRS_TIMESTAMP_LOW_BIT_LENGTH
+
common::SRS_TIMESTAMP_HIGH_BIT_LENGTH
)) - 1;
24
25
struct
HitDataCompact
26
{
27
uint16_t : 16;
28
uint16_t
tdc
:
TDC_BIT_LENGTH
;
29
uint16_t
channel_num
:
CHANNEL_NUM_BIT_LENGTH
;
30
uint16_t
is_over_threshold
: 1;
31
uint16_t
flag
: 1;
32
uint32_t
bc_id
:
BC_ID_BIT_LENGTH
;
33
uint32_t
adc
:
ADC_BIT_LENGTH
;
34
uint32_t
vmm_id
:
VMM_ID_BIT_LENGTH
;
35
uint32_t
offset
:
OFFSET_BIT_LENGTH
;
36
};
37
38
struct
MarkerDataCompact
39
{
40
uint16_t : 16;
41
uint16_t
timestamp_low_bits
:
common::SRS_TIMESTAMP_LOW_BIT_LENGTH
;
42
uint16_t
vmm_id
:
OFFSET_BIT_LENGTH
;
43
uint16_t
flag
: 1;
44
uint32_t
timestamp_high_bits
:
common::SRS_TIMESTAMP_HIGH_BIT_LENGTH
;
45
};
46
}
// namespace srs::process::internal
CommonDefinitions.hpp
srs::common::SRS_TIMESTAMP_LOW_BIT_LENGTH
constexpr auto SRS_TIMESTAMP_LOW_BIT_LENGTH
Definition
CommonDefinitions.hpp:48
srs::common::SRS_TIMESTAMP_HIGH_BIT_LENGTH
constexpr auto SRS_TIMESTAMP_HIGH_BIT_LENGTH
Definition
CommonDefinitions.hpp:47
srs::process::internal
Definition
SRSDataCompact.hpp:7
srs::process::internal::TDC_BIT_MAX
constexpr auto TDC_BIT_MAX
Definition
SRSDataCompact.hpp:17
srs::process::internal::BC_ID_BIT_MAX
constexpr auto BC_ID_BIT_MAX
Definition
SRSDataCompact.hpp:21
srs::process::internal::TDC_BIT_LENGTH
constexpr auto TDC_BIT_LENGTH
Definition
SRSDataCompact.hpp:10
srs::process::internal::OFFSET_BIT_LENGTH
constexpr auto OFFSET_BIT_LENGTH
Definition
SRSDataCompact.hpp:14
srs::process::internal::ADC_BIT_LENGTH
constexpr auto ADC_BIT_LENGTH
Definition
SRSDataCompact.hpp:12
srs::process::internal::BC_ID_BIT_LENGTH
constexpr auto BC_ID_BIT_LENGTH
Definition
SRSDataCompact.hpp:11
srs::process::internal::SRS_TIMESTAMP_MAX
constexpr auto SRS_TIMESTAMP_MAX
Definition
SRSDataCompact.hpp:22
srs::process::internal::ADC_BIT_MAX
constexpr auto ADC_BIT_MAX
Definition
SRSDataCompact.hpp:20
srs::process::internal::CHANNEL_NUM_BIT_MAX
constexpr auto CHANNEL_NUM_BIT_MAX
Definition
SRSDataCompact.hpp:16
srs::process::internal::OFFSET_BIT_MAX
constexpr auto OFFSET_BIT_MAX
Definition
SRSDataCompact.hpp:18
srs::process::internal::VMM_ID_BIT_MAX
constexpr auto VMM_ID_BIT_MAX
Definition
SRSDataCompact.hpp:19
srs::process::internal::VMM_ID_BIT_LENGTH
constexpr auto VMM_ID_BIT_LENGTH
Definition
SRSDataCompact.hpp:13
srs::process::internal::CHANNEL_NUM_BIT_LENGTH
constexpr auto CHANNEL_NUM_BIT_LENGTH
Definition
SRSDataCompact.hpp:9
srs::process::internal::HitDataCompact
Definition
SRSDataCompact.hpp:26
srs::process::internal::HitDataCompact::offset
uint32_t offset
Definition
SRSDataCompact.hpp:35
srs::process::internal::HitDataCompact::is_over_threshold
uint16_t is_over_threshold
Definition
SRSDataCompact.hpp:30
srs::process::internal::HitDataCompact::vmm_id
uint32_t vmm_id
Definition
SRSDataCompact.hpp:34
srs::process::internal::HitDataCompact::bc_id
uint32_t bc_id
Definition
SRSDataCompact.hpp:32
srs::process::internal::HitDataCompact::tdc
uint16_t tdc
Definition
SRSDataCompact.hpp:28
srs::process::internal::HitDataCompact::adc
uint32_t adc
Definition
SRSDataCompact.hpp:33
srs::process::internal::HitDataCompact::channel_num
uint16_t channel_num
Definition
SRSDataCompact.hpp:29
srs::process::internal::HitDataCompact::flag
uint16_t flag
Definition
SRSDataCompact.hpp:31
srs::process::internal::MarkerDataCompact
Definition
SRSDataCompact.hpp:39
srs::process::internal::MarkerDataCompact::vmm_id
uint16_t vmm_id
Definition
SRSDataCompact.hpp:42
srs::process::internal::MarkerDataCompact::timestamp_low_bits
uint16_t timestamp_low_bits
Definition
SRSDataCompact.hpp:41
srs::process::internal::MarkerDataCompact::flag
uint16_t flag
Definition
SRSDataCompact.hpp:43
srs::process::internal::MarkerDataCompact::timestamp_high_bits
uint32_t timestamp_high_bits
Definition
SRSDataCompact.hpp:44
backend
srs
data
SRSDataCompact.hpp
Impressum
Datenschutzerklärung
Generated by
1.17.0