15#ifndef FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_DAPHNESTREAMFRAME_HPP_
16#define FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_DAPHNESTREAMFRAME_HPP_
90 throw std::out_of_range(
"ADC index out of range");
93 throw std::out_of_range(
"ADC index out of range");
104 uint16_t adc =
adc_words[word_index] >> first_bit_position;
108 adc |=
adc_words[word_index + 1] << bits_from_first_word;
111 return adc & 0x3FFFu;
121 throw std::out_of_range(
"ADC index out of range");
124 throw std::out_of_range(
"ADC index out of range");
127 throw std::out_of_range(
"ADC value out of range");
139 uint32_t mask = (1 << (first_bit_position)) - 1;
140 adc_words[word_index] = ((val << first_bit_position) & ~mask) | (
adc_words[word_index] & mask);
145 adc_words[word_index + 1] = ((val >> bits_in_first_word) & mask) | (
adc_words[word_index + 1] & ~mask);