quadEM  7-0
drvAPS_EM.h
Go to the documentation of this file.
1 /*
2  * drvAPS_EM.h
3  *
4  * Asyn driver that inherits from the asynPortDriver class to control the APS 4-channel picoammeter
5  *
6  * Author: Mark Rivers
7  *
8  * Created June 3, 2012
9  */
10 
11 #include "drvQuadEM.h"
12 
13 #define APS_EM_MAX_RAW 8
14 
15 typedef enum {
20 
21 
23 class drvAPS_EM : public drvQuadEM {
24 public:
25  drvAPS_EM(const char *portName, unsigned short *baseAddr, int fiberChannel,
26  const char *unidigName, int unidigChan, char *unidigDrvInfo, int ringBufferSize);
27  /* These are the methods that are new to this class */
28  void pollerThread(); /* Polling routine if no interrupts */
29  void callbackFunc(unsigned int mask); /* Callback function */
30 
31 protected:
32  virtual asynStatus setAcquire(epicsInt32 value);
33  virtual asynStatus setPingPong(epicsInt32 value);
34  virtual asynStatus setIntegrationTime(epicsFloat64 value);
35  virtual asynStatus setRange(epicsInt32 value);
36  virtual asynStatus readStatus();
37  virtual void report(FILE *fp, int details);
38  virtual asynStatus reset();
39 
40 private:
41  /* Our data */
42  asynUInt32Digital *pUInt32Digital_;
43  int unidigChan_;
44  void *pUInt32DigitalPvt_;
45  asynUser *pUInt32DAsynUser_;
46  void *pUInt32RegistrarPvt_;
47  PingPongValue_t pingPong_;
48  epicsFloat64 rawData_[QE_MAX_INPUTS];
49  int readingsAveraged_;
50  volatile unsigned short *baseAddress_;
51  asynStatus setPulse();
52  asynStatus setPeriod();
53  asynStatus setGo();
54  asynStatus writeMeter(int command, int value);
55  asynStatus readMeter(epicsInt32 raw[QE_MAX_INPUTS]);
56 };
57 
virtual asynStatus setIntegrationTime(epicsFloat64 value)
Sets the integration time.
Definition: drvAPS_EM.cpp:282
Definition: drvAPS_EM.h:16
virtual asynStatus setRange(epicsInt32 value)
Sets the range.
Definition: drvAPS_EM.cpp:301
virtual asynStatus readStatus()
Reads the settings back from the electrometer.
Definition: drvAPS_EM.cpp:332
Base class to control the quad electrometer.
Definition: drvQuadEM.h:128
#define QE_MAX_INPUTS
Definition: drvQuadEM.h:124
char * portName
The name of this asyn port.
Definition: asynPortDriver.h:201
drvAPS_EM(const char *portName, unsigned short *baseAddr, int fiberChannel, const char *unidigName, int unidigChan, char *unidigDrvInfo, int ringBufferSize)
Constructor for the drvAPS_EM class.
Definition: drvAPS_EM.cpp:70
Class to control the Elettra APS_EM 4-Channel Picoammeter.
Definition: drvAPS_EM.h:23
virtual void report(FILE *fp, int details)
Report parameters.
Definition: drvAPS_EM.cpp:436
void pollerThread()
This function runs as a polling task at the system clock rate if there is no interrupt driver (such a...
Definition: drvAPS_EM.cpp:198
virtual asynStatus setPingPong(epicsInt32 value)
Sets the ping-pong setting.
Definition: drvAPS_EM.cpp:273
void callbackFunc(unsigned int mask)
Callback function which is called either from drvAPS_EM::pollerThread or from the interrupt driver wh...
Definition: drvAPS_EM.cpp:212
Definition: drvAPS_EM.h:17
PingPongValue_t
Definition: drvAPS_EM.h:15
virtual asynStatus reset()
Resets the electometer, rebooting the device, sleeping for 1 second, and then downloading all of the ...
Definition: drvAPS_EM.cpp:308
virtual asynStatus setAcquire(epicsInt32 value)
Starts and stops the electrometer.
Definition: drvAPS_EM.cpp:247
Definition: drvAPS_EM.h:18