Project
Loading...
Searching...
No Matches
PixelWords.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef ALICEO2_FOCAL_PIXELWORDS_H
12#define ALICEO2_FOCAL_PIXELWORDS_H
13
14#include <bitset>
15#include <cstdint>
16
17namespace o2::focal
18{
19
20namespace PixelWord
21{
22
23using Idle = uint8_t;
26
39
40struct ChipHeader {
41 union {
42 struct {
46 };
48 };
49
50 bool isEmptyFrame() const { return mIdentifier == 0xe; }
51};
52
54 union {
55 struct {
58 };
60 };
61};
62
64 union {
65 struct {
68 };
70 };
71};
72
73struct Hitmap {
74 union {
75 struct {
78 };
80 };
81
82 std::bitset<7> getHitmap() const { return std::bitset<7>(mHitmap); }
83};
84
85struct DataShort {
86 union {
87 struct {
91 };
93 };
94 DataShort(const uint8_t* payload)
95 {
96 mData = (static_cast<uint16_t>(payload[0]) << 8) + static_cast<uint16_t>(payload[1]);
97 }
98 uint16_t getAddress() const { return mAddress; }
99 uint16_t getEncoder() const { return mEncoderID; }
101};
102} // namespace PixelWord
103
104} // namespace o2::focal
105#endif // ALICEO2_FOCAL_PIXELWORDS_H
unsigned char uint8_t
unsigned short int uint16_t
DataShort(const uint8_t *payload)
Definition PixelWords.h:94
std::bitset< 7 > getHitmap() const
Definition PixelWords.h:82