source: hvcontrol/src/HV.h@ 113

Last change on this file since 113 was 113, checked in by ogrimm, 15 years ago
Small bug fix
File size: 1.3 KB
Line 
1#ifndef HV_H_SEEN
2#define HV_H_SEEN
3
4#include <termios.h> // POSIX terminal control definitions
5#include <fcntl.h> // File control definitions => fcntl() in fcn OpenPort()
6#include <errno.h>
7#include <stdio.h>
8#include <unistd.h>
9#include <sys/ioctl.h>
10
11#include "HVConfig.h"
12
13#define BAUDRATE B115200
14
15// HV board control registers
16#define REG_HV0 0X20
17#define REG_HV1 0X28
18#define REG_HV2 0X30
19#define REG_HV3 0X38
20#define REG_RESET 0XF8
21#define REG_STATUS 0X80
22
23// HV board status bits
24#define BIT_OC0 (1<<3)
25#define BIT_OC1 (1<<4)
26#define BIT_OC2 (1<<5)
27#define BIT_OC3 (1<<6)
28#define BIT_RESET (1<<7)
29
30class ProcessIO;
31
32class HVBoard {
33
34 int BoardNumber;
35 class ProcessIO *m;
36
37 public:
38
39 HVBoard(int, char *, class ProcessIO *);
40 ~HVBoard();
41
42 int fDescriptor;
43 bool Overcurrent[NUM_CHAINS];
44 bool ResetButton;
45 bool WrapOK;
46 int LastWrapCount;
47 double fTimeOut; // [s] timeout to return from read
48 int ErrorCount;
49
50 char *BoardName;
51 int HV[NUM_CHAINS][NUM_CHANNELS]; // HV value in DAC units
52 double HVV[NUM_CHAINS][NUM_CHANNELS]; // HV value in volts
53
54 void ClearVoltageArrays();
55 int Reset();
56 int GetStatus();
57 int SetHV(int, unsigned int, int);
58 int GetBoardNumber() {return BoardNumber;}
59 int Communicate(unsigned char*, int);
60 void SetTimeOut(double);
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.