//------------------------------------------------------------------------------ // Dark registers interface -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "comm_Reg.h" // [Author] "Piero Giubilato" // [Version] "1.1" // [Modified by] "Piero Giubilato" // [Last revision] "10 Feb 2009" // [Language] "C++" // [Compiler] "Visual C++ 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Provides meaningful access to DARK registers" // [Key documentation] // "Dark SEAL documentation, in particular mdl_Register.vhd" // "Visual C++ Reference Help" // {Trace} //______________________________________________________________________________ // Overloading check #ifndef comm_Reg_H #define comm_Reg_H // Root components #include //______________________________________________________________________________ class comm_Reg { private: // Singleton implementation static comm_Reg* inst_Handle; static int inst_Count; // Registers backup storage static unsigned int reg_Word[32]; // Bit manipulation support functions static unsigned int bit_Value(unsigned short *buffer, unsigned short buf_Len, unsigned short bit_Start, unsigned short bit_Stop); static unsigned int bit_Value(unsigned short *buffer, unsigned short buf_Len, unsigned short bit_Start, unsigned short bit_Stop, unsigned int value); protected: // Force a singleton comm_Reg (); ~comm_Reg (); comm_Reg (const comm_Reg&) {}; comm_Reg& operator=(comm_Reg&) {}; public: // Singleton access static comm_Reg* instance_Load(); static void instance_Destroy(); // General register access static unsigned int reg_Value(unsigned short reg_Idx, unsigned short bit_Start, unsigned short bit_Stop); static unsigned int reg_Value(unsigned short reg_Idx, unsigned short bit_Start, unsigned short bit_Stop, unsigned int value); // Registers #0 (ACQ) access functions static unsigned int acq_Mode(); static unsigned int acq_Mode(unsigned int mode); static unsigned int acq_data_Mode(); static unsigned int acq_data_Mode(unsigned int mode); static unsigned int acq_trg_Mode(); static unsigned int acq_trg_Mode(unsigned int mode); static unsigned int acq_trg_Period(); static unsigned int acq_trg_Period(unsigned int period); static unsigned int acq_drv_Sel(); static unsigned int acq_drv_Sel(unsigned int Idx); static unsigned int acq_drv_Delay(); static unsigned int acq_drv_Delay(unsigned int delay); static unsigned int acq_chn_Enable(); static unsigned int acq_chn_Enable(unsigned int chns); static unsigned int acq_frm_Count(); static unsigned int acq_frm_Count(unsigned int count); static unsigned int acq_dp_Count(); static unsigned int acq_dp_Count(unsigned int count); static unsigned int acq_dmy_Size(); static unsigned int acq_dmy_Size(unsigned int mode); // Register #1 (Data trigger) static unsigned int data_trg_Mode(); static unsigned int data_trg_Mode(unsigned int mode); static unsigned int data_trg_Slope(); static unsigned int data_trg_Slope(unsigned int slope); static unsigned int data_trg_Chn(); static unsigned int data_trg_Chn(unsigned int chns); static unsigned int data_trg_Thr(); static unsigned int data_trg_Thr(unsigned int threshold); static unsigned int data_trg_Delay(); static unsigned int data_trg_Delay(unsigned int delay); static unsigned int data_trg_Count(); static unsigned int data_trg_Count(unsigned int count); // Registers #2 (ADCs and chip access functions) static unsigned int adc_clk_Chn(); static unsigned int adc_clk_Chn(unsigned int chn); static unsigned int adc_clk_Div(); static unsigned int adc_clk_Div(unsigned int divider); static unsigned int adc_Avgs(); static unsigned int adc_Avgs(unsigned int avgs); static unsigned int chp_tem_Pre(); static unsigned int chp_tem_Pre(unsigned int pre); }; // Overloading check #endif