Orion
high-rate readout
cmd.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
10 
12 #include "cmd-itkpix/unigoe/decoder.hpp"
13 
14 namespace itk::itkpix::cmd::unigoe {
15 
16 using namespace itk::itkpix::cmd;
17 
18 template<typename T>
20 public:
21  using CommandCallback = T;
22 
23  CommandDecoder(CommandCallback& cb)
24  : decoder(std::nullopt, &cb) {}
25 
26  CommandDecoder(uint8_t chip_id, CommandCallback& cb)
27  : decoder(chip_id, &cb) {}
28 
29  inline void reset() { decoder.reset(); }
30 
31  inline void decode(uint16_t frame) { decoder.decode_single(frame); }
32 
33  inline void decode(const std::span<const uint16_t> frames) {
34  for (auto frame : frames) decode(frame);
35  }
36 
37  inline void decode(uint16_t* frames, size_t size) {
38  decode({ frames, size });
39  }
40 
41  TTCDecoderSMGen<CommandCallback> decoder;
42 }; // CommandDecoder
43 
44 } // itk::itkpix::cmd_unigoe
45 
46 
47 namespace itk::itkpix::cmd {
48 
50 
51  static_assert(concepts::CommandDecoder<dummy::CommandDecoder<CommandCallback>>);
52  static_assert(concepts::CommandDecoder<unigoe::CommandDecoder<CommandCallback>>);
53 
55  static_assert(concepts::CommandDecoder<CommandDecoder>);
56 
57 }
Dummy command decoder implementation.
Definition: cmddecoder.hpp:26
Command callback interface for ITkPix.
Definition: cmdcallback.hpp:20
Dummy CommandDecoder implementation.
Templates for ITkPix emulator.
Templates for ITkPix emulator.
uint16_t size
Definition: fragheader.hpp:5