damaris-backends/drivers/DAC-AD5791/AD5791.h

61 lines
1.5 KiB
C
Raw Permalink Normal View History

2015-11-25 16:43:12 +00:00
/*
Markus Rosenstihl 2005 Nov
*/
#ifndef AD5791_H
#define AD5791_H
#include "core/states.h"
#include "drivers/pfggen.h"
2017-01-19 11:48:08 +00:00
#include "../../core/states.h"
2015-11-25 16:43:12 +00:00
/**
* \ingroup drivers
*/
class AD5791: public GenericDAC {
protected:
/// The channel for the latch signal
int latch_bit;
2017-02-02 07:15:23 +00:00
int clock_bit;
int data_bit;
2015-11-25 16:43:12 +00:00
public:
int id;
// default constructor
AD5791(int myid=0);
virtual void set_dac(signed dw);
// virtual void set_dac_ttls(signed value);
2017-02-02 07:15:23 +00:00
void set_latch_bit(int bit);
void set_clock_bit(int bit);
void set_data_bit(int bit);
2015-11-25 16:43:12 +00:00
/**
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);
2016-12-19 14:03:14 +00:00
void init_dac(state_sequent* exp_sequence, state::iterator where);
2015-11-25 16:43:12 +00:00
void set_dac_control(state_sequent* exp_sequence, state::iterator where, int input_shift_register);
2017-01-19 11:48:08 +00:00
state_sequent *tx_bit(unsigned int bit);
2017-02-02 07:15:23 +00:00
state_sequent *select_input_shift_register(unsigned int register_address);
state_sequent *write_serial_register(unsigned int register_value);
2015-11-25 16:43:12 +00:00
};
/*class pfg_exception: public std::string {
public:
pfg_exception(const std::string& s): std::string(s){}
};
*/
#endif