hw functions for the SOLID slow control
Dependents: S_SCTRL_e_test SPItest sscm
DEIMOS32.h
- Committer:
- wbeaumont
- Date:
- 2014-12-07
- Revision:
- 14:ee02872b282b
- Parent:
- 11:0416cf017b7a
- Child:
- 15:2cf8211a3870
File content as of revision 14:ee02872b282b:
#ifndef DEIMOS32_H #define DEIMOS32_H /* * class related to DEIMOS specific operationt * v0.10 initial development * v1.00 added class, only setHV */ #include "AD5384.h" #define DEIMOSHDRVER 1.00 // BIAS channel nr in the layout so have to subtract 1 to control the channel #define DACBIASCH 39 // CAL 1 DAC CH #define DACCAL1CH 33 #define DACCAL2CH 34 #define DACCAL3CH 35 #define DACCAL4CH 36 #define HVmin 60 #define DVmax 4.5 // max volt out of the DAC class Deimos32 { float HVnom; u32 serialnr; u8 con; AD5384* dac; // public: // init // volt the value of the HV source // connectornr : the connector the DEIMOS is conneted to // dacdev to witch DAC device the channel is connected Deimos32( float volt, u8 connectornr,AD5384* dacdev ){ serialnr=2000; con=connectornr; HVnom=volt; // can not be initialized now because need two parameters for the command } float setHV(float volt) { if (HVnom < HVmin ) return -2; float dv=HVnom-volt; if (dv > DVmax || dv < 0 ) return -3; dac->set_volt(DACBIASCH , dv); return 0; } float getHv(){ if (HVnom < HVmin ) return -2; return HVnom - dac->get_volt(DACBIASCH); } }; #endif