13#error This is a C++ include file and cannot be used from plain C
37 data = (
int *)malloc(
len *
sizeof(
int));
48 data = (
int *)malloc(
len *
sizeof(
int));
56 data = (
int *)malloc(n *
sizeof(
int));
71#define ngcdcsSCA_NUM_EXT_BIAS 20
76#define ngcdcsSCA_NUM_INT_BIAS 8
81#define ngcdcsSCA_NUM_BIAS (ngcdcsSCA_NUM_EXT_BIAS + ngcdcsSCA_NUM_INT_BIAS)
86#define ngcdcsSCA_MODE_RAMP 0x0
87#define ngcdcsSCA_MODE_FOWLER 0x1
92#define ngcdcsSCA_IDLE_SKIP 0x0
93#define ngcdcsSCA_IDLE_RST 0x1
94#define ngcdcsSCA_IDLE_RSTRD 0x2
226 int Enable(
int check = 1);
240 int Read(
int addr,
int *buffer,
int size,
int lw = -1);
243 int RdReg(
int addr,
int *value,
int lw = -1);
246 int Write(
int addr,
int *buffer,
int size);
249 int WrReg(
int addr,
int value);
275 int ScaSetup(
const char *key,
const int *idx,
const char *value,
int *update,
276 int *handled = NULL);
279 int ScaStatus(
const char *key,
const int *idx,
char *value,
280 int *handled = NULL);
290 int Stop(
int align,
int force = 0);
315 virtual int LookupCB(
const char *name,
char *value);
329 int Preset(
const char *key,
const char *value,
int *handled=NULL);
352 int VoltageDC(
int num,
double volt,
int rangeCheck=1);
355 int TelDC(
int chan,
double *volt);
358 int VSetup(
int autoCtrl = 0);
370 int Restore(
const char *keyWord);
396 void UpdateParamList_();
399 void DetachParamList_();
413 int LdCode_(
const char *fileName);
439 void AddSeqIdx_(
char *keyWord);
442 void DelSeqIdx_(
char *keyWord);
445 void AddScaIdx_(
char *keyWord);
448 void DelScaIdx_(
char *keyWord);
451 int Lookup_(
const char *,
char *);
454 int LoadPrg_(
const char *);
457 int Script_(
const char *shell,
const char *script, FILE *dbg,
465 void UpdateExpTime_();
494 int LoadCfg_(
const char *restoreKey,
const char *tmpFile);
497 void DefaultVoltages_();
503 int Reg2Volt_(
int chan,
double *v,
int force = 1);
506 int Volt2Reg_(
int chan,
double v);
512 void Mirror_(
int addr,
int *buffer,
int size);
Definition ngcbIFC.hpp:760
Definition ngcbPARAM.hpp:201
int Start()
Start sequencer.
Definition ngcdcsSCA.cpp:655
int Reconfigure()
ASIC re-configure.
Definition ngcdcsSCA.cpp:440
int Disable()
Call-back at transition to not operational state.
Definition ngcdcsSCA.cpp:287
int ClearPrgFile()
Clear program file.
Definition ngcdcsScaPrg.cpp:29
int UploadMcFile(const char *fileName)
Upload micro-controller file.
Definition ngcdcsScaCfg.cpp:361
int VoltageDC(int num, double volt, int rangeCheck=1)
Set DC voltage.
Definition ngcdcsSCA.cpp:992
int LoadPrgFile(const char *name=NULL)
Load sequencer program file.
Definition ngcdcsScaPrg.cpp:65
int rxDelay
RX-delay (phase-shift in steps of 5 ns)
Definition ngcdcsSCA.hpp:213
int Preset(const char *key, const char *value, int *handled=NULL)
Parameter preset.
Definition ngcdcsScaSetup.cpp:165
int RdReg(int addr, int *value, int lw=-1)
Read register value.
Definition ngcdcsSCA.cpp:386
int flags
ASIC i/o-flags.
Definition ngcdcsSCA.hpp:204
int OutputDisable()
Disable output.
Definition ngcdcsSCA.cpp:908
int VSetup(int autoCtrl=0)
Apply voltage setup.
Definition ngcdcsSCA.cpp:1057
int WrReg(int addr, int value)
Write register value.
Definition ngcdcsSCA.cpp:425
int packetSize
Data packet size (in 32-bit words)
Definition ngcdcsSCA.hpp:210
int Window(ngcdcs_win_t w)
Apply read-out window.
Definition ngcdcsSCA.cpp:1079
int Delay(int n)
Set data delay (steps of 5 ns)
Definition ngcdcsSCA.cpp:631
int LoadCfgFile(const char *fileName=NULL)
Load voltage configuration.
Definition ngcdcsScaCfg.cpp:554
int Stop(int align, int force=0)
Stop sequencer.
Definition ngcdcsSCA.cpp:698
int SaveCfgFile(const char *fileName)
Save voltage configuration.
Definition ngcdcsScaCfg.cpp:1149
char * StatusString()
Get status string.
Definition ngcdcsSCA.cpp:831
int NewSetup()
New setup.
Definition ngcdcsScaSetup.cpp:415
virtual int LookupCB(const char *name, char *value)
Parameter lookup.
Definition ngcdcsScaPrg.cpp:174
void Reset()
Align software state after reset.
Definition ngcdcsSCA.cpp:836
char * VStatusString()
Get voltage status string.
Definition ngcdcsSCA.cpp:1052
int Read(int addr, int *buffer, int size, int lw=-1)
Read register buffer.
Definition ngcdcsSCA.cpp:355
virtual ~ngcdcsSCA()
Destructor.
Definition ngcdcsSCA.cpp:61
int OutputEnable()
Enable output.
Definition ngcdcsSCA.cpp:843
void NewStatus(int newStatus)
Set new soft status.
Definition ngcdcsSCA.cpp:745
ngcdcs_sca_pa_t paParam
ASIC preamplifier setup parameters.
Definition ngcdcsSCA.hpp:219
int Restore(const char *keyWord)
Restore keyword from the last loaded file.
Definition ngcdcsScaCfg.cpp:559
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsSCA.cpp:144
int Update()
Read back all relevant values.
Definition ngcdcsScaCfg.cpp:525
int FailureState()
Check if in failure state.
Definition ngcdcsSCA.hpp:312
int Selftest()
Perform selftest.
Definition ngcdcsSCA.cpp:346
ngcdcsSCA(const ngcb_route_t &r)
Constructor with route.
Definition ngcdcsSCA.cpp:29
int Setup()
Upload current setup.
Definition ngcdcsScaSetup.cpp:435
int RunningState()
Check if in running state.
Definition ngcdcsSCA.hpp:306
int Snapshot()
Telemetry snapshot.
Definition ngcdcsSCA.cpp:974
int Status(int *hwStat)
Get status value.
Definition ngcdcsSCA.cpp:790
ngcdcs_sca_exp_t expParam
ASIC exposure setup parameters.
Definition ngcdcsSCA.hpp:216
int id
ASIC ID.
Definition ngcdcsSCA.hpp:201
int TelDC(int chan, double *volt)
Telemetry for DC-bias.
Definition ngcdcsSCA.cpp:1030
char mcFile[256]
Micro-controller file.
Definition ngcdcsSCA.hpp:207
int Write(int addr, int *buffer, int size)
Write register buffer.
Definition ngcdcsSCA.cpp:399
int ScaStatus(const char *key, const int *idx, char *value, int *handled=NULL)
Parameter status.
Definition ngcdcsScaStatus.cpp:27
int PacketSize(int n)
Set packet size.
Definition ngcdcsSCA.cpp:544
int ScaSetup(const char *key, const int *idx, const char *value, int *update, int *handled=NULL)
Parameter setup.
Definition ngcdcsScaSetup.cpp:27
int status
Soft state: idle, waiting, running or failure.
Definition ngcdcsSEQ.hpp:219
ngcdcsSEQ0(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsSEQ.hpp:285
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:334
#define ngcdcsCLDC_BUFSIZE
Definition ngcdcsCLDC.hpp:34
#define ngcdcsSCA_IDLE_RST
Definition ngcdcsSCA.hpp:93
#define ngcdcsSCA_MODE_RAMP
Definition ngcdcsSCA.hpp:86
#define ngcdcsSEQ_STAT_IDLE
Definition ngcdcsSEQ.hpp:41
#define ngcdcsSEQ_STAT_FAILURE
Definition ngcdcsSEQ.hpp:45
Definition ngcbIFC.hpp:78
Definition ngcdcsSEQ.hpp:146
int len
Definition ngcdcsSCA.hpp:29
ngcdcs_mc_block_t(int a, int n)
Constructor.
Definition ngcdcsSCA.hpp:54
~ngcdcs_mc_block_t()
Destructor.
Definition ngcdcsSCA.hpp:62
ngcdcs_mc_block_t(const ngcdcs_mc_block_t &other)
Copy constructor.
Definition ngcdcsSCA.hpp:45
ngcdcs_mc_block_t & operator=(const ngcdcs_mc_block_t &other)
Operator =.
Definition ngcdcsSCA.hpp:32
int * data
Definition ngcdcsSCA.hpp:28
int addr
Definition ngcdcsSCA.hpp:27
Definition ngcdcsSCA.hpp:99
unsigned int tFowlerExp
Definition ngcdcsSCA.hpp:111
int nrmp
Definition ngcdcsSCA.hpp:102
int tFowlerExp_x
Definition ngcdcsSCA.hpp:126
int clkDrop
Definition ngcdcsSCA.hpp:108
int enhancedClk_x
Definition ngcdcsSCA.hpp:127
int nrd
Definition ngcdcsSCA.hpp:101
int expMode_x
Definition ngcdcsSCA.hpp:125
int ndrop
Definition ngcdcsSCA.hpp:104
int rowEndDelay
Definition ngcdcsSCA.hpp:105
int frameEndDelay_x
Definition ngcdcsSCA.hpp:121
int rstOut
Definition ngcdcsSCA.hpp:107
int clkDrop_x
Definition ngcdcsSCA.hpp:123
int ndrop_x
Definition ngcdcsSCA.hpp:119
int expMode
Definition ngcdcsSCA.hpp:110
int ngrp_x
Definition ngcdcsSCA.hpp:118
int nrd_x
Definition ngcdcsSCA.hpp:116
int rstOut_x
Definition ngcdcsSCA.hpp:122
int idleMode_x
Definition ngcdcsSCA.hpp:124
int globalReset
Definition ngcdcsSCA.hpp:113
int nrst
Definition ngcdcsSCA.hpp:100
int enhancedClk
Definition ngcdcsSCA.hpp:112
int rowEndDelay_x
Definition ngcdcsSCA.hpp:120
int frameEndDelay
Definition ngcdcsSCA.hpp:106
int nrst_x
Definition ngcdcsSCA.hpp:115
int nexp
Definition ngcdcsSCA.hpp:114
int ngrp
Definition ngcdcsSCA.hpp:103
int idleMode
Definition ngcdcsSCA.hpp:109
ngcdcs_sca_exp_t()
Constructor.
Definition ngcdcsSCA.hpp:131
int nrmp_x
Definition ngcdcsSCA.hpp:117
int globalReset_x
Definition ngcdcsSCA.hpp:128
Definition ngcdcsSCA.hpp:159
int kTCRemove
Definition ngcdcsSCA.hpp:161
int gain
Definition ngcdcsSCA.hpp:163
ngcdcs_sca_pa_t()
Constructor.
Definition ngcdcsSCA.hpp:170
int cold
Definition ngcdcsSCA.hpp:160
int kTCRemove_x
Definition ngcdcsSCA.hpp:165
int rowReset_x
Definition ngcdcsSCA.hpp:166
int rowReset
Definition ngcdcsSCA.hpp:162
int gain_x
Definition ngcdcsSCA.hpp:167
int cold_x
Definition ngcdcsSCA.hpp:164
Definition ngcdcsSEQ.hpp:157