17 std::cout <<
"ADC Unsigned Test" << std::endl;
21 std::vector< double > t_inputs_1{ -0.1, 0., 0.1, 0.5, 0.9, 1.0, 1.1 };
22 std::vector< unsigned > t_outputs_1;
24 for(
auto t_input : t_inputs_1 )
26 t_outputs_1.push_back( a2d< double, unsigned >( t_input, &t_params_1 ) );
27 std::cout << t_input <<
" --> " << t_outputs_1.back() << std::endl;
30 std::cout << std::endl;
32 std::cout <<
"ADC Signed Test" << std::endl;
36 std::vector< double > t_inputs_2{ -0.6, -0.5, -0.4, 0., 0.4, 0.5, 0.6 };
37 std::vector< int > t_outputs_2;
39 for(
auto t_input : t_inputs_2 )
41 t_outputs_2.push_back( a2d< double, int >( t_input, &t_params_2 ) );
42 std::cout << t_input <<
" --> " << t_outputs_2.back() << std::endl;
45 std::cout << std::endl;
47 std::cout <<
"DAC Unsigned Test" << std::endl;
48 for(
auto t_output : t_outputs_1 )
50 std::cout << t_output <<
" --> " << d2a< unsigned, double >( t_output, &t_params_1 ) << std::endl;
53 std::cout << std::endl;
55 std::cout <<
"DAC Signed Test" << std::endl;
56 for(
auto t_output : t_outputs_2 )
58 std::cout << t_output <<
" --> " << d2a< signed, double >( t_output, &t_params_2 ) << std::endl;
void get_calib_params(unsigned n_bits, unsigned data_type_size, double v_offset, double v_range, bool bits_r_aligned, dig_calib_params *params)