12#error This is a C++ include file and cannot be used from plain C
36 data = (
int *)malloc(
len *
sizeof(
int));
47 data = (
int *)malloc(
len *
sizeof(
int));
55 data = (
int *)malloc(n *
sizeof(
int));
70#define ngcdcsSCA_NUM_EXT_BIAS 20
75#define ngcdcsSCA_NUM_INT_BIAS 8
80#define ngcdcsSCA_NUM_BIAS (ngcdcsSCA_NUM_EXT_BIAS + ngcdcsSCA_NUM_INT_BIAS)
85#define ngcdcsSCA_MODE_RAMP 0x0
86#define ngcdcsSCA_MODE_FOWLER 0x1
91#define ngcdcsSCA_IDLE_SKIP 0x0
92#define ngcdcsSCA_IDLE_RST 0x1
93#define ngcdcsSCA_IDLE_RSTRD 0x2
225 int Enable(
int check = 1);
239 int Read(
int addr,
int *buffer,
int size,
int lw = -1);
242 int RdReg(
int addr,
int *value,
int lw = -1);
245 int Write(
int addr,
int *buffer,
int size);
248 int WrReg(
int addr,
int value);
274 int ScaSetup(
const char *key,
const int *idx,
const char *value,
int *update,
275 int *handled = NULL);
278 int ScaStatus(
const char *key,
const int *idx,
char *value,
279 int *handled = NULL);
289 int Stop(
int align,
int force = 0);
314 virtual int LookupCB(
const char *name,
char *value);
328 int Preset(
const char *key,
const char *value,
int *handled=NULL);
351 int VoltageDC(
int num,
double volt,
int rangeCheck=1);
354 int TelDC(
int chan,
double *volt);
357 int VSetup(
int autoCtrl = 0);
369 int Restore(
const char *keyWord);
395 void UpdateParamList_();
398 void DetachParamList_();
412 int LdCode_(
const char *fileName);
438 void AddSeqIdx_(
char *keyWord);
441 void DelSeqIdx_(
char *keyWord);
444 void AddScaIdx_(
char *keyWord);
447 void DelScaIdx_(
char *keyWord);
450 int Lookup_(
const char *,
char *);
453 int LoadPrg_(
const char *);
456 int Script_(
const char *shell,
const char *script, FILE *dbg,
464 void UpdateExpTime_();
493 int LoadCfg_(
const char *restoreKey,
const char *tmpFile);
496 void DefaultVoltages_();
502 int Reg2Volt_(
int chan,
double *v,
int force = 1);
505 int Volt2Reg_(
int chan,
double v);
511 void Mirror_(
int addr,
int *buffer,
int size);
Definition ngcbIFC.hpp:754
Definition ngcbPARAM.hpp:200
int Start()
Start sequencer.
Definition ngcdcsSCA.cpp:654
int Reconfigure()
ASIC re-configure.
Definition ngcdcsSCA.cpp:439
int Disable()
Call-back at transition to not operational state.
Definition ngcdcsSCA.cpp:286
int ClearPrgFile()
Clear program file.
Definition ngcdcsScaPrg.cpp:28
int UploadMcFile(const char *fileName)
Upload micro-controller file.
Definition ngcdcsScaCfg.cpp:360
int VoltageDC(int num, double volt, int rangeCheck=1)
Set DC voltage.
Definition ngcdcsSCA.cpp:991
int LoadPrgFile(const char *name=NULL)
Load sequencer program file.
Definition ngcdcsScaPrg.cpp:55
int rxDelay
RX-delay (phase-shift in steps of 5 ns)
Definition ngcdcsSCA.hpp:212
int Preset(const char *key, const char *value, int *handled=NULL)
Parameter preset.
Definition ngcdcsScaSetup.cpp:164
int RdReg(int addr, int *value, int lw=-1)
Read register value.
Definition ngcdcsSCA.cpp:385
int flags
ASIC i/o-flags.
Definition ngcdcsSCA.hpp:203
int OutputDisable()
Disable output.
Definition ngcdcsSCA.cpp:907
int VSetup(int autoCtrl=0)
Apply voltage setup.
Definition ngcdcsSCA.cpp:1056
int WrReg(int addr, int value)
Write register value.
Definition ngcdcsSCA.cpp:424
int packetSize
Data packet size (in 32-bit words)
Definition ngcdcsSCA.hpp:209
int Window(ngcdcs_win_t w)
Apply read-out window.
Definition ngcdcsSCA.cpp:1078
int Delay(int n)
Set data delay (steps of 5 ns)
Definition ngcdcsSCA.cpp:630
int LoadCfgFile(const char *fileName=NULL)
Load voltage configuration.
Definition ngcdcsScaCfg.cpp:553
int Stop(int align, int force=0)
Stop sequencer.
Definition ngcdcsSCA.cpp:697
int SaveCfgFile(const char *fileName)
Save voltage configuration.
Definition ngcdcsScaCfg.cpp:1148
char * StatusString()
Get status string.
Definition ngcdcsSCA.cpp:830
int NewSetup()
New setup.
Definition ngcdcsScaSetup.cpp:414
virtual int LookupCB(const char *name, char *value)
Parameter lookup.
Definition ngcdcsScaPrg.cpp:163
void Reset()
Align software state after reset.
Definition ngcdcsSCA.cpp:835
char * VStatusString()
Get voltage status string.
Definition ngcdcsSCA.cpp:1051
int Read(int addr, int *buffer, int size, int lw=-1)
Read register buffer.
Definition ngcdcsSCA.cpp:354
virtual ~ngcdcsSCA()
Destructor.
Definition ngcdcsSCA.cpp:60
int OutputEnable()
Enable output.
Definition ngcdcsSCA.cpp:842
void NewStatus(int newStatus)
Set new soft status.
Definition ngcdcsSCA.cpp:744
ngcdcs_sca_pa_t paParam
ASIC preamplifier setup parameters.
Definition ngcdcsSCA.hpp:218
int Restore(const char *keyWord)
Restore keyword from the last loaded file.
Definition ngcdcsScaCfg.cpp:558
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsSCA.cpp:143
int Update()
Read back all relevant values.
Definition ngcdcsScaCfg.cpp:524
int FailureState()
Check if in failure state.
Definition ngcdcsSCA.hpp:311
int Selftest()
Perform selftest.
Definition ngcdcsSCA.cpp:345
ngcdcsSCA(const ngcb_route_t &r)
Constructor with route.
Definition ngcdcsSCA.cpp:28
int Setup()
Upload current setup.
Definition ngcdcsScaSetup.cpp:434
int RunningState()
Check if in running state.
Definition ngcdcsSCA.hpp:305
int Snapshot()
Telemetry snapshot.
Definition ngcdcsSCA.cpp:973
int Status(int *hwStat)
Get status value.
Definition ngcdcsSCA.cpp:789
ngcdcs_sca_exp_t expParam
ASIC exposure setup parameters.
Definition ngcdcsSCA.hpp:215
int id
ASIC ID.
Definition ngcdcsSCA.hpp:200
int TelDC(int chan, double *volt)
Telemetry for DC-bias.
Definition ngcdcsSCA.cpp:1029
char mcFile[256]
Micro-controller file.
Definition ngcdcsSCA.hpp:206
int Write(int addr, int *buffer, int size)
Write register buffer.
Definition ngcdcsSCA.cpp:398
int ScaStatus(const char *key, const int *idx, char *value, int *handled=NULL)
Parameter status.
Definition ngcdcsScaStatus.cpp:26
int PacketSize(int n)
Set packet size.
Definition ngcdcsSCA.cpp:543
int ScaSetup(const char *key, const int *idx, const char *value, int *update, int *handled=NULL)
Parameter setup.
Definition ngcdcsScaSetup.cpp:26
int status
Soft state: idle, waiting, running or failure.
Definition ngcdcsSEQ.hpp:215
ngcdcsSEQ0(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsSEQ.hpp:278
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:333
#define ngcdcsCLDC_BUFSIZE
Definition ngcdcsCLDC.hpp:33
#define ngcdcsSCA_IDLE_RST
Definition ngcdcsSCA.hpp:92
#define ngcdcsSCA_MODE_RAMP
Definition ngcdcsSCA.hpp:85
#define ngcdcsSEQ_STAT_IDLE
Definition ngcdcsSEQ.hpp:40
#define ngcdcsSEQ_STAT_FAILURE
Definition ngcdcsSEQ.hpp:44
Definition ngcbIFC.hpp:72
Definition ngcdcsSEQ.hpp:145
int len
Definition ngcdcsSCA.hpp:28
ngcdcs_mc_block_t(int a, int n)
Constructor.
Definition ngcdcsSCA.hpp:53
~ngcdcs_mc_block_t()
Destructor.
Definition ngcdcsSCA.hpp:61
ngcdcs_mc_block_t(const ngcdcs_mc_block_t &other)
Copy constructor.
Definition ngcdcsSCA.hpp:44
ngcdcs_mc_block_t & operator=(const ngcdcs_mc_block_t &other)
Operator =.
Definition ngcdcsSCA.hpp:31
int * data
Definition ngcdcsSCA.hpp:27
int addr
Definition ngcdcsSCA.hpp:26
Definition ngcdcsSCA.hpp:98
unsigned int tFowlerExp
Definition ngcdcsSCA.hpp:110
int nrmp
Definition ngcdcsSCA.hpp:101
int tFowlerExp_x
Definition ngcdcsSCA.hpp:125
int clkDrop
Definition ngcdcsSCA.hpp:107
int enhancedClk_x
Definition ngcdcsSCA.hpp:126
int nrd
Definition ngcdcsSCA.hpp:100
int expMode_x
Definition ngcdcsSCA.hpp:124
int ndrop
Definition ngcdcsSCA.hpp:103
int rowEndDelay
Definition ngcdcsSCA.hpp:104
int frameEndDelay_x
Definition ngcdcsSCA.hpp:120
int rstOut
Definition ngcdcsSCA.hpp:106
int clkDrop_x
Definition ngcdcsSCA.hpp:122
int ndrop_x
Definition ngcdcsSCA.hpp:118
int expMode
Definition ngcdcsSCA.hpp:109
int ngrp_x
Definition ngcdcsSCA.hpp:117
int nrd_x
Definition ngcdcsSCA.hpp:115
int rstOut_x
Definition ngcdcsSCA.hpp:121
int idleMode_x
Definition ngcdcsSCA.hpp:123
int globalReset
Definition ngcdcsSCA.hpp:112
int nrst
Definition ngcdcsSCA.hpp:99
int enhancedClk
Definition ngcdcsSCA.hpp:111
int rowEndDelay_x
Definition ngcdcsSCA.hpp:119
int frameEndDelay
Definition ngcdcsSCA.hpp:105
int nrst_x
Definition ngcdcsSCA.hpp:114
int nexp
Definition ngcdcsSCA.hpp:113
int ngrp
Definition ngcdcsSCA.hpp:102
int idleMode
Definition ngcdcsSCA.hpp:108
ngcdcs_sca_exp_t()
Constructor.
Definition ngcdcsSCA.hpp:130
int nrmp_x
Definition ngcdcsSCA.hpp:116
int globalReset_x
Definition ngcdcsSCA.hpp:127
Definition ngcdcsSCA.hpp:158
int kTCRemove
Definition ngcdcsSCA.hpp:160
int gain
Definition ngcdcsSCA.hpp:162
ngcdcs_sca_pa_t()
Constructor.
Definition ngcdcsSCA.hpp:169
int cold
Definition ngcdcsSCA.hpp:159
int kTCRemove_x
Definition ngcdcsSCA.hpp:164
int rowReset_x
Definition ngcdcsSCA.hpp:165
int rowReset
Definition ngcdcsSCA.hpp:161
int gain_x
Definition ngcdcsSCA.hpp:166
int cold_x
Definition ngcdcsSCA.hpp:163
Definition ngcdcsSEQ.hpp:156