13 #ifndef SCARAB_DIGITAL_HH_ 14 #define SCARAB_DIGITAL_HH_ 19 #include <type_traits> 48 template<
typename condition >
51 template<
typename condition >
57 template<
typename dig_type,
typename an_type,
67 template<
typename dig_type,
typename an_type,
77 template<
typename an_type,
typename dig_type,
83 if( analog > (an_type)(params->
levels - 1) ) analog = params->
levels - 1;
84 else if( analog < 0. ) analog = 0.;
91 template<
typename an_type,
typename dig_type,
97 if( analog > (an_type)(params->
levels - 1) ) analog = params->
levels - 1;
98 else if( analog < 0. ) analog = 0.;
104 #endif // SCARAB_DIGITAL_HH_
void get_calib_params2(unsigned n_bits, unsigned data_type_size, double v_offset, double v_range, double dac_gain, bool bits_r_aligned, dig_calib_params *params)
std::string type(const x_type &a_param)
typename std::enable_if< condition::value, detail::is_unsigned >::type enable_if_unsigned
typename std::enable_if< condition::value, detail::is_signed >::type enable_if_signed
dig_type a2d(an_type analog, const struct dig_calib_params *params)
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)
an_type d2a(dig_type dig, const struct dig_calib_params *params)
To round(const std::chrono::duration< Rep, Period > &d)