Frelon.h 5.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
22
23
24
25
26
27
#ifndef FRELON_H
#define FRELON_H

#include "EspiaSerialLine.h"
#include <string>
#include <map>
ahoms's avatar
ahoms committed
28
#include <vector>
29
30
31
32

namespace lima
{

33
namespace Frelon
34
35
{

36
enum Reg {
ahoms's avatar
ahoms committed
37
	NbFrames,	ExpTime,	ShutCloseTime,	LatencyTime,
38
39
40
41
	RoiLineBegin,	RoiLineWidth,	RoiPixelBegin,	RoiPixelWidth,
	ChanMode,	TimeUnit,	RoiEnable,	RoiFast, 
	AntiBloom,	BinVert,	BinHorz,	ConfigHD,
	RoiKinetic,	ShutEnable,	HardTrigDisable,
42
	PixelFreq,	LineFreq,	FlipMode,	IntCalib,
43
44
45
46
	DisplayImage,	AdcFloatDiode,	AdcSignal,	
	DarkPixelCalib,	DarkPixelMode,	ChanControl,	Mire,
	AoiLineBegin,	AoiLineWidth,	AoiPixelBegin,	AoiPixelWidth,
	AoiImageHeight,	AoiImageWidth,	ChanOnImage,	ChanOnCcd,
47
48
49
	Version,	CompSerNb,	Warn,		LastWarn,
	LineClockPer,	PixelClockPer,	FirstPHIVLen,	PHIHSetupLen,
	SingleVertXfer,	SingleHorzXfer,	AllVertXfer,	AllHorzXfer,
50
51
	ReadoutTime,	TransferTime,   CcdModesAvail,	StatusSeqA,
	StatusAMTA,	StatusAMTB,	StatusAMTC,	StatusAMTD,
52
	LookUpTable,	ImagesPerEOF,
53
};
54

ahoms's avatar
ahoms committed
55
56
57
typedef std::map<Reg, std::string> RegStrMapType;
extern RegStrMapType RegStrMap;

58
typedef std::vector<Reg> RegListType;
59
extern RegListType CacheableRegList;
60
extern RegListType FloatRegList;
61

62
63
64
typedef std::map<Reg, double> RegDoubleMapType;
extern RegDoubleMapType RegSleepMap;

65
extern const int MaxRegVal;
66

67
enum Cmd {
68
	Reset,		Start,		Stop,		Save,		Reload,
69
	SendEOF,
70
};
71

ahoms's avatar
ahoms committed
72
73
74
typedef std::map<Cmd, std::string> CmdStrMapType;
extern CmdStrMapType CmdStrMap;

75

76
77
enum MultiLineCmd {
	Help,		Config,		Dac,		Volt,
78
	Aoi,		PLL,		Timing,		StatusCam,
79
80
};

ahoms's avatar
ahoms committed
81
82
83
84
85
86
87
88
typedef std::map<MultiLineCmd, std::string> MultiLineCmdStrMapType;
extern MultiLineCmdStrMapType MultiLineCmdStrMap;


enum FrameTransferMode {
	FFM = 0, FTM = 1,
};

89
90
91
typedef std::map<FrameTransferMode, std::string> FTMStrMapType;
extern FTMStrMapType FTMNameMap;

ahoms's avatar
ahoms committed
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
enum InputChan {
	Chan1    = (1 << 0),
	Chan2    = (1 << 1),
	Chan3    = (1 << 2),
	Chan4    = (1 << 3),
	Chan13   = Chan1  | Chan3,
	Chan24   = Chan2  | Chan4,
	Chan12   = Chan1  | Chan2,
	Chan34   = Chan3  | Chan4,
	Chan1234 = Chan12 | Chan34,
};

typedef std::pair<int, int> ChanRange;
typedef std::map<FrameTransferMode, ChanRange> FTMChanRangeMapType;
extern FTMChanRangeMapType FTMChanRangeMap;

typedef std::vector<InputChan> InputChanList;
109

ahoms's avatar
ahoms committed
110
111
112
typedef std::map<FrameTransferMode, InputChanList> FTMInputChanListMapType;
extern FTMInputChanListMapType FTMInputChanListMap;

113
114
extern InputChanList DefInputChanList;

ahoms's avatar
ahoms committed
115
116

enum SerNbParam {
117
118
119
120
121
122
	SerNb      = 0x00ff,
	SPB1Kodak  = 0x2000,
	SPB1Adc16  = 0x4000,
	SPB2Sign   = 0x0100,
	SPB2Type   = 0x7000,
	Taper      = 0x8000,
ahoms's avatar
ahoms committed
123
124
125
126
127
128
};

enum RoiMode {
	None, Slow, Fast, Kinetic,
};

129
130
131
132
133
134
135
136
enum TimeUnitFactor {
	Milliseconds, Microseconds,
};

typedef std::map<TimeUnitFactor, double> TimeUnitFactorMapType;
extern TimeUnitFactorMapType TimeUnitFactorMap;


137
138
139
enum ChipType {
	Atmel,
	Kodak,
140
141
142
143
144
	E2V_2k,
	E2V_2kNotMPP,
	E2V_4k,
	E2V_4kNotMPP,
	Hama,
145
146
};

147
148
149
typedef std::map<ChipType, FrameDim> ChipMaxFrameDimMapType;
extern ChipMaxFrameDimMapType ChipMaxFrameDimMap;

150
151
152
typedef std::map<ChipType, double> ChipPixelSizeMapType;
extern ChipPixelSizeMapType ChipPixelSizeMap;

153
154
155
156
157
enum {
	AtmelModesAvail = 0x0fff,
	KodakModesAvail = 0x0100,
};

158
159
160
161
enum {
	MaxBinX = 8,
	MaxBinY = 1024,
};
162

163
164
165
166
167
168
169
enum ExtSync {
	ExtSyncNone  = 0,
	ExtSyncStart = 1,
	ExtSyncStop  = 2,
	ExtSyncBoth  = 3,
};

170
enum Status {
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
	InInit     = 0x200,
	EspiaXfer  = 0x100,
        Wait       = 0x080,
        Transfer   = 0x040,
        Exposure   = 0x020,
        Shutter    = 0x010,
        Readout    = 0x008,
        Latency    = 0x004,
        ExtStart   = 0x002,
        ExtStop    = 0x001,
	StatusMask = 0x3ff,
};

enum StatusSPB2 {
	SPB2_GBitFifoPixEmpty = 0x8000,
	SPB2_FifoOutEmpty     = 0x4000,
	SPB2_FifoInEmpty      = 0x2000,
	SPB2_FifoLUTEmpty     = 0x1000,
	SPB2_FifoChan4Empty   = 0x0800,
	SPB2_FifoChan3Empty   = 0x0400,
	SPB2_FifoChan2Empty   = 0x0200,
	SPB2_FifoChan1Empty   = 0x0100,
	SPB2_FifoEmptyMask    = 0xff00,
	SPB2_TstEnvFrmOut     = 0x0040,
	SPB2_TstEnvFrmIn      = 0x0020,
	SPB2_TstEnvMask       = 0x0060,
	SPB2_TstFlashUsrReady = 0x0010,
	SPB2_EndInitRam       = 0x0008,
	SPB2_EndFlashRead     = 0x0004,
	SPB2_AuroraChanUp     = 0x0002,
	SPB2_DcmLocked        = 0x0001,
	SPB2_TstInitMask      = 0x001f,
	SPB2_TstInitGood      = 0x001f,
204
205
};

206
207
208
209
enum ShutMode {
	Off, AutoFrame,
};

210
211
212
enum SPB2Config {
	SPB2Precision, SPB2Speed,
};
213
214
typedef std::map<SPB2Config, std::string> SPB2ConfigStrMapType;
extern SPB2ConfigStrMapType SPB2ConfigNameMap;
215

216
217
} // namespace Frelon

218
219
220
} // namespace lima

#endif // FRELON_H