Frelon.sip 6.99 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

namespace Frelon
{

%TypeHeaderCode
#include "Frelon.h"
28
#include "lima/MiscUtils.h"
29 30 31 32
#ifndef LIMA_SIP_FRELON_GLOBAL_DEFINED
#define LIMA_SIP_FRELON_GLOBAL_DEFINED
namespace lima { namespace Frelon { class Global {}; } }
#endif 
33 34 35 36 37 38 39 40
%End

enum Reg {
	NbFrames,	ExpTime,	ShutCloseTime,	LatencyTime,
	RoiLineBegin,	RoiLineWidth,	RoiPixelBegin,	RoiPixelWidth,
	ChanMode,	TimeUnit,	RoiEnable,	RoiFast, 
	AntiBloom,	BinVert,	BinHorz,	ConfigHD,
	RoiKinetic,	ShutEnable,	HardTrigDisable,
41
	PixelFreq,	LineFreq,	FlipMode,	IntCalib,
42 43 44 45
	DisplayImage,	AdcFloatDiode,	AdcSignal,	
	DarkPixelCalib,	DarkPixelMode,	ChanControl,	Mire,
	AoiLineBegin,	AoiLineWidth,	AoiPixelBegin,	AoiPixelWidth,
	AoiImageHeight,	AoiImageWidth,	ChanOnImage,	ChanOnCcd,
46 47 48
	Version,	CompSerNb,	Warn,		LastWarn,
	LineClockPer,	PixelClockPer,	FirstPHIVLen,	PHIHSetupLen,
	SingleVertXfer,	SingleHorzXfer,	AllVertXfer,	AllHorzXfer,
49 50
	ReadoutTime,	TransferTime,   CcdModesAvail,	StatusSeqA,
	StatusAMTA,	StatusAMTB,	StatusAMTC,	StatusAMTD,
51
	StatusAMTE,
52 53
	LookUpTable,	ImagesPerEOF,	WeightValDFl,	WeightValSig,
	SeqClockFreq,	CamChar,
54 55 56 57
};
/*
typedef std::map<Reg, std::string> RegStrMapType;
extern RegStrMapType RegStrMap;
58 59 60 61 62 63 64
*/
class Global
{
public:
	static std::map<int, std::string> RegStrMap();
%MethodCode
	typedef std::map<int, std::string> MapType;
65 66
	sipRes = new MapType(Frelon::RegStrMap.begin(), 
			     Frelon::RegStrMap.end());
67 68
%End
};
69

70
/*
71
typedef std::vector<Reg> RegListType;
72 73
extern RegListType CacheableRegList;
extern RegListType FloatRegList;
74
extern RegListType SignedRegList;
75 76 77

typedef std::map<Reg, double> RegDoubleMapType;
extern RegDoubleMapType RegSleepMap;
78
*/
79

80 81
const int MaxRegVal;

82
enum Cmd {
83
	Reset,		Start,		Stop,		Save,		Reload,
84
	SendEOF,
85
};
86
/*
87 88
typedef std::map<Cmd, std::string> CmdStrMapType;
extern CmdStrMapType CmdStrMap;
89
*/
90 91

enum MultiLineCmd {
92
	Help,		Config,		Dac,		MonitorVolt,
93
	Aoi,		PLL,		Timing,		StatusCam,
94 95 96 97
	SampWeight,	ConfigSeq,	ConfigSPB,	ConfigDLine,
	ConfigDAC,	ConfigADC,	ConfigPLL,	ConfigSWeight,
	ConfigVCXO,	ConfigAlarm,	ConfigAoi,	UserInfo,
	MonitorADC,
98
};
99
/*
100 101 102 103 104 105 106
typedef std::map<MultiLineCmd, std::string> MultiLineCmdStrMapType;
extern MultiLineCmdStrMapType MultiLineCmdStrMap;
*/

enum FrameTransferMode {
	FFM = 0, FTM = 1,
};
107 108 109 110
/*
typedef std::map<FrameTransferMode, std::string> FTMStrMapType;
extern FTMStrMapType FTMNameMap;
*/
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

enum InputChan {
	Chan1    = 1 /*(1 << 0)*/,
	Chan2    = 2 /*(1 << 1)*/,
	Chan3    = 4 /*(1 << 2)*/,
	Chan4    = 8 /*(1 << 3)*/,
	Chan13   = 5 /*Chan1  | Chan3*/,
	Chan24   = 10 /*Chan2  | Chan4*/,
	Chan12   = 3 /*Chan1  | Chan2*/,
	Chan34   = 12 /*Chan3  | Chan4*/,
	Chan1234 = 15 /*Chan12 | Chan34*/,
};
/*
typedef std::pair<int, int> ChanRange;
typedef std::map<FrameTransferMode, ChanRange> FTMChanRangeMapType;
extern FTMChanRangeMapType FTMChanRangeMap;

typedef std::vector<InputChan> InputChanList;
typedef std::map<FrameTransferMode, InputChanList> FTMInputChanListMapType;
extern FTMInputChanListMapType FTMInputChanListMap;
131
*/
132 133

enum SerNbParam {
134 135 136 137 138 139
	SerNb        = 0x00ff,
	SPB1Kodak    = 0x2000,
	SPB1Adc16    = 0x4000,
	SPBTypeMask  = 0x0300,
	ChipTypeMask = 0x7800,
	TaperFlag    = 0x8000,
140
};
141

142 143 144
enum RoiMode {
	None, Slow, Fast, Kinetic,
};
145

146 147 148
enum TimeUnitFactor {
	Milliseconds, Microseconds,
};
149
/*
150 151 152 153
typedef std::map<TimeUnitFactor, double> TimeUnitFactorMapType;
extern TimeUnitFactorMapType TimeUnitFactorMap;


154
*/
155 156 157
enum ChipType {
	Atmel,
	Kodak,
158 159 160 161 162
	E2V_2k,
	E2V_2kNotMPP,
	E2V_4k,
	E2V_4kNotMPP,
	Hama,
163
	Andanta_CcdFT2k = 8,
164
};
165 166 167 168 169 170 171 172 173

enum SPBConType {
	SPBConNone, SPBConX, SPBConY, SPBConXY,
};

enum GeomType {
	SPB12_4_Quad,
	Hamamatsu,
	SPB2_F16,
174
	SPB8_F16_Single,
175 176 177
	SPB8_F16_Dual,
};

178
/*
179 180 181
typedef std::map<ChipType, FrameDim> ChipMaxFrameDimMapType;
extern ChipMaxFrameDimMapType ChipMaxFrameDimMap;

182 183
typedef std::map<ChipType, double> ChipPixelSizeMapType;
extern ChipPixelSizeMapType ChipPixelSizeMap;
184
*/
185 186 187 188 189
enum {
	AtmelModesAvail = 0x0fff,
	KodakModesAvail = 0x0100,
};

190 191 192 193
enum {
	MaxBinX = 8,
	MaxBinY = 1024,
};
194

195 196 197 198 199 200 201
enum ExtSync {
	ExtSyncNone  = 0,
	ExtSyncStart = 1,
	ExtSyncStop  = 2,
	ExtSyncBoth  = 3,
};

202
enum Status {
203 204 205 206 207 208 209 210 211 212 213 214 215
	InInit     = 0x200,
	EspiaXfer  = 0x100,
        Wait       = 0x080,
        Transfer   = 0x040,
        Exposure   = 0x020,
        Shutter    = 0x010,
        Readout    = 0x008,
        Latency    = 0x004,
        ExtStart   = 0x002,
        ExtStop    = 0x001,
	StatusMask = 0x3ff,
};

216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
enum StatusSPB2_SAA {
	SPB2_SAA_GBitFifoPixEmpty = 0x8000,
	SPB2_SAA_FifoOutEmpty     = 0x4000,
	SPB2_SAA_FifoInEmpty      = 0x2000,
	SPB2_SAA_FifoLUTEmpty     = 0x1000,
	SPB2_SAA_FifoChan4Empty   = 0x0800,
	SPB2_SAA_FifoChan3Empty   = 0x0400,
	SPB2_SAA_FifoChan2Empty   = 0x0200,
	SPB2_SAA_FifoChan1Empty   = 0x0100,
	SPB2_SAA_TstEnvFrmOut     = 0x0040,
	SPB2_SAA_TstEnvFrmIn      = 0x0020,
	SPB2_SAA_TstEnvMask       = 0x0060,
	SPB2_SAA_TstFlashUsrReady = 0x0010,
	SPB2_SAA_EndInitRam       = 0x0008,
	SPB2_SAA_EndFlashRead     = 0x0004,
	SPB2_SAA_AuroraChanUp     = 0x0002,
	SPB2_SAA_DcmLocked        = 0x0001,
	SPB2_SAA_TstInitMask      = 0x001f,
	SPB2_SAA_TstInitGood      = 0x001f,
};

enum StatusSPB8_SAA {
	SPB8_SAA_PLL8Locked   = 0x8000,
	SPB8_SAA_PLL7Locked   = 0x4000,
	SPB8_SAA_PLL6Locked   = 0x2000,
	SPB8_SAA_PLL5Locked   = 0x1000,
	SPB8_SAA_PLL4Locked   = 0x0800,
	SPB8_SAA_PLL3Locked   = 0x0400,
	SPB8_SAA_PLL2Locked   = 0x0200,
	SPB8_SAA_PLL1Locked   = 0x0100,
	SPB8_SAA_DCMLocked    = 0x0020,
	SPB8_SAA_AuroraChanUp = 0x0010,
	SPB8_SAA_DDR1CalDone  = 0x0002,
	SPB8_SAA_DDR0CalDone  = 0x0001,
	SPB8_SAA_TstInitMask  = 0xff33,
	SPB8_SAA_TstInitGood  = 0xff33,
};

enum StatusSPB8_SAE {
	SPB8_SAE_TstEnvFrmOut   = 0x8000,
	SPB8_SAE_TstEnvFrmIn    = 0x4000,
	SPB8_SAE_TstEnvMask     = 0xc000,
	SPB8_SAE_FifoTXAEmpty   = 0x0800,
	SPB8_SAE_FifoOutEmpty   = 0x0400,
	SPB8_SAE_FifoInEmpty    = 0x0200,
	SPB8_SAE_FifoMuxEmpty   = 0x0100,
	SPB8_SAE_FifoChan8Empty = 0x0080,
	SPB8_SAE_FifoChan7Empty = 0x0040,
	SPB8_SAE_FifoChan6Empty = 0x0020,
	SPB8_SAE_FifoChan5Empty = 0x0010,
	SPB8_SAE_FifoChan4Empty = 0x0008,
	SPB8_SAE_FifoChan3Empty = 0x0004,
	SPB8_SAE_FifoChan2Empty = 0x0002,
	SPB8_SAE_FifoChan1Empty = 0x0001,
270 271
};

272 273 274 275
enum ShutMode {
	Off, AutoFrame,
};

276 277 278
enum SPB2Config {
	SPB2Precision, SPB2Speed,
};
279 280

}; // namespace Frelon