14#ifndef FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_WIBETHFRAME_HPP_
15#define FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_WIBETHFRAME_HPP_
95 uint16_t
get_adc(
int i,
int sample=0) const
98 throw std::out_of_range(
"ADC index out of range");
108 uint16_t adc =
adc_words[sample][word_index] >> first_bit_position;
113 adc |=
adc_words[sample][word_index + 1] << bits_from_first_word;
116 return adc & 0x3FFFu;
125 throw std::out_of_range(
"ADC index out of range");
127 throw std::out_of_range(
"ADC value out of range");
136 uint64_t mask = (
static_cast<uint64_t
>(1) << first_bit_position) - 1;
137 adc_words[sample][word_index] = ((
static_cast<uint64_t
>(val) << first_bit_position) & ~mask) | (
adc_words[sample][word_index] & mask);
142 adc_words[sample][word_index + 1] = ((val >> bits_in_first_word) & mask) | (
adc_words[sample][word_index + 1] & ~mask);