damaris-backends/drivers/DAC-AD5791/AD5791.h
2017-01-19 11:48:08 +00:00

53 lines
1.3 KiB
C++

/*
Markus Rosenstihl 2005 Nov
*/
#ifndef AD5791_H
#define AD5791_H
#include "core/states.h"
#include "drivers/pfggen.h"
#include "../../core/states.h"
/**
* \ingroup drivers
*/
class AD5791: public GenericDAC {
protected:
/// The channel for the latch signal
int latch_bit;
public:
int id;
// default constructor
AD5791(int myid=0);
virtual void set_dac(signed dw);
// virtual void set_dac_ttls(signed value);
void set_latch_bit(int le_bit);
/**
inserts necessary serial data transmission to set the dac, at the end of experiment reset the dac
assumes, the root sequence is not repeated, because the reset sequence is appended to the root sequence!
*/
virtual void set_dac(state& experiment);
// destructor
virtual ~AD5791();
private:
void set_dac_recursive(state_sequent& the_sequence, state::iterator& the_state);
void set_dac_to_zero(state_sequent* exp_sequence, state::iterator where);
void init_dac(state_sequent* exp_sequence, state::iterator where);
void set_dac_control(state_sequent* exp_sequence, state::iterator where, int input_shift_register);
state_sequent *tx_bit(unsigned int bit);
};
/*class pfg_exception: public std::string {
public:
pfg_exception(const std::string& s): std::string(s){}
};
*/
#endif