4#include "./../types.hpp"
21template <
typename BinType,
unsigned int Bins>
29 constexpr unsigned int size() __attribute__((always_inline))
35 template <
typename DataType>
38 constexpr unsigned int MaxIndex = Bins-1;
39 Index = (datum > MaxIndex) * (Bins) +
40 !(datum > MaxIndex) * (datum);
46 void output() __attribute__((always_inline))
48 Serial.write((char8cast_t*)(
Histogram),
sizeof(BinType)*(Bins+1));
Photon Counting Histogram module for Real time calculation on Teensy 4.1 microcontrollers.
Definition: histogram.hpp:23
void push_back(DataType datum)
Receives a single datum and processes it to into the Histogram.
Definition: histogram.hpp:36
BinType Histogram[Bins+1]
Histogram function array.
Definition: histogram.hpp:26
unsigned int Index
Index used by the pushback function.
Definition: histogram.hpp:24
constexpr unsigned int size() __attribute__((always_inline))
Returns the total number of buns, including the overflow bin.
Definition: histogram.hpp:29
void output() __attribute__((always_inline))
Sends the complete Histogram to the Serial output.
Definition: histogram.hpp:46