-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHodoCrate.h
65 lines (46 loc) · 1.53 KB
/
HodoCrate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* File: HodoMonitor.h
* Author: andrea
*
* Created on September 16, 2014, 12:09 PM
*/
#ifndef HODOCRATE_H
#define HODOCRATE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <GenericTypeDefs.h>
#define DFLT_NMBR_OF_BOARDS 15
#define DFLT_CH_PER_BOARD 16
#define DFLT_NMBR_OF_CH (DFLT_NMBR_OF_BOARDS*DFLT_CH_PER_BOARD)
#define BOARD_ENABLED_FIRST_PCF 7 //this is the last board (included) enabled by the first PCF
#define DFLT_AMPL 0
#define NPAUSE 5000
#define NPAUSE2 100000
#define TEMPERATURE_RES 0.0625
typedef struct HodoCrate{
BOOL status; //Main System Status. TRUE is on, FALSE is off.
unsigned short *Amplitude; //each of these is a 16 bit variable, with the Amplitude of a ch
}HodoCrate;
//here goes the functions that interact with this structure
HodoCrate* InitHodoCrate();
int LoadDefaultHodoCrate(HodoCrate *m_crate);
int GetBoard(int ch);
int GetIdInBoard(int ch);
int SetAmplitude(int ch,int val,HodoCrate *m_crate);
int SetAmplitudeAll(int val,HodoCrate *m_crate);
int GetAmplitude(int ch,HodoCrate *m_crate);
int GetAmplitudeDAC(int ch);
int UpdateOutput(int ch,HodoCrate *m_crate,int doReadback);
int UpdateOutputAll(HodoCrate *m_crate,int doReadback);
int InitTemperature(int board,HodoCrate *m_crate);
int InitTemperatureAll(HodoCrate *m_crate);
float ReadTemperature(int board,HodoCrate *m_crate);
int ReadMultiplexer(int id);
int WriteMultiplexer(int id,int val);
int turn_system_on_off(BOOL turnOn,HodoCrate *m_crate);
#ifdef __cplusplus
}
#endif
#endif /* HODOCRATE_H */