Scarab  v3.1.0
Project 8 C++ Utility Library
Classes | Namespaces | Typedefs | Enumerations | Functions
digital.hh File Reference
#include "scarab_api.hh"
#include <cmath>
#include <type_traits>
Include dependency graph for digital.hh:

Go to the source code of this file.

Classes

struct  dig_calib_params
 Collection of parameters used for converting between analog and digital data. More...
 

Namespaces

 scarab
 
 scarab::detail
 

Typedefs

template<typename condition >
using enable_if_signed = typename std::enable_if< condition::value, detail::is_signed >::type
 
template<typename condition >
using enable_if_unsigned = typename std::enable_if< condition::value, detail::is_unsigned >::type
 

Enumerations

enum  is_signed
 
enum  is_unsigned
 

Functions

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)
 Calculate the digitizer calibration parameters with basic parameters: number of bits, Voffset, and Vrange. More...
 
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)
 Calculate the digitizer calibration parameters when given the DAC gain (e.g. from a digitizer's own calibration) More...
 
template<typename dig_type , typename an_type >
an_type d2a (dig_type dig, const struct dig_calib_params *params)
 Convert a signed or unsigned digital value to an analog value. More...
 
template<typename an_type , typename dig_type , enable_if_unsigned< std::is_unsigned< dig_type > > ...>
dig_type a2d (an_type analog, const struct dig_calib_params *params)
 Convert an analog value to an unsigned digital value. More...