5#ifndef BMNPROFRAWTOOLS_H
6#define BMNPROFRAWTOOLS_H
69 static bool adc_num(
const bitset<32>& word);
70 static bool adc_num(
const uint32_t& word);
77 static bool fco(
const bitset<32>& word);
78 static bool fco(
const uint32_t& word);
84 static int adc_ch(vector<bitset<32>>& adc_word,
char channel_name);
85 static int adc_ch(vector<bitset<32>>& adc_word,
size_t start_index,
char channel_name);
88 template<
typename UIntType>
92 map<char, size_t> offsets{{
'A', 0}, {
'B', 2}, {
'C', 4}, {
'D', 6}, {
'E', 8}, {
'F', 10}, {
'G', 12}, {
'H', 14}};
93 for (
size_t i = 0;
i < 6;
i++) {
94 result += ((adc_word[start_index +
i] >> offsets[channel_name]) & 1) << (10 - 2 *
i + 1);
95 result += ((adc_word[start_index +
i] >> (offsets[channel_name] + 1)) & 1) << (10 - 2 *
i);
97 return result - 0x800;
101 template<
typename UIntType>
102 static int adc_ch(vector<UIntType> adc_word,
size_t start_index,
char channel_name)
105 map<char, size_t> offsets{{
'A', 0}, {
'B', 2}, {
'C', 4}, {
'D', 6}, {
'E', 8}, {
'F', 10}, {
'G', 12}, {
'H', 14}};
106 for (
size_t i = 0;
i < 6;
i++) {
107 result += ((adc_word[start_index +
i] >> offsets[channel_name]) & 1) << (10 - 2 *
i + 1);
108 result += ((adc_word[start_index +
i] >> (offsets[channel_name] + 1)) & 1) << (10 - 2 *
i);
110 return result - 0x800;
138 static vector<int>
tracker_tst_sgnl(vector<int>& chE, vector<int>& chF, vector<int>& chH, vector<int>& chG);