20 #define F1_BOARD_ID 0xf10000
21 #define F1_MAX_BOARDS 20
22 #define F1_MAX_TDC_CHANNELS 64
23 #define F1_MAX_HITS_PER_CHANNEL 8
24 #define F1_MAX_TDC_CHIPS 8
25 #define F1_MAX_A32_MEM 0x800000
26 #define F1_MAX_A32MB_SIZE 0x1000000
27 #define F1_VME_INT_LEVEL 2
28 #define F1_VME_INT_VEC 0xEE
30 #define F1_SUPPORTED_V2_FIRMWARE 0x0e
31 #define F1_SUPPORTED_V3_FIRMWARE 0x15
32 #define F1_SUPPORTED_FIRMWARE(x) ((x==2)? F1_SUPPORTED_V2_FIRMWARE : F1_SUPPORTED_V3_FIRMWARE)
38 volatile unsigned int csr;
39 volatile unsigned int ctrl;
42 volatile unsigned int intr;
45 volatile unsigned short stat[8];
75 #define F1_VERSION_FIRMWARE_MASK 0xFF
76 #define F1_VERSION_BOARDREV_MASK 0xFF00
77 #define F1_VERSION_BOARDTYPE_MASK 0xFFFF0000
80 #define F1_SRSRC_SOFT (0<<0)
81 #define F1_SRSRC_EXT (1<<0)
82 #define F1_SRSRC_FP F1_SRSRC_EXT
83 #define F1_SRSRC_VXS F1_SRSRC_EXT
84 #define F1_SRSRC_MASK 0x1
85 #define F1_TRIGSRC_SOFT (0<<1)
86 #define F1_TRIGSRC_FP (1<<1)
87 #define F1_TRIGSRC_VXS (2<<1)
88 #define F1_TRIGSRC_MASK 0x6
89 #define F1_CLKSRC_INT (0<<4)
90 #define F1_CLKSRC_FP (1<<4)
91 #define F1_CLKSRC_VXS (2<<4)
92 #define F1_CLKSRC_MASK 0x30
93 #define F1_IFLAG_NOINIT (1<<16)
94 #define F1_IFLAG_USELIST (1<<17)
95 #define F1_IFLAG_NOFWCHECK (1<<18)
98 #define F1_CSR_MASK 0x7ffff
101 #define F1_CSR_REFCLK_PLL_LOCKED (1<<0)
102 #define F1_CSR_BOARDCLK_PLL_LOCKED (1<<1)
103 #define F1_CSR_CONFIG_ERROR (1<<2)
105 #define F1_CSR_BLOCK_ACCEPTED (1<<3)
106 #define F1_CSR_BLOCK_READY (1<<4)
107 #define F1_CSR_BERR_STATUS (1<<5)
108 #define F1_CSR_TOKEN_STATUS (1<<6)
109 #define F1_CSR_MODULE_EMPTY (1<<7)
110 #define F1_CSR_ERROR_MASK 0xFF00
111 #define F1_CSR_ERROR_TDC0 (1<<8)
112 #define F1_CSR_ERROR_TDC1 (1<<9)
113 #define F1_CSR_ERROR_TDC2 (1<<10)
114 #define F1_CSR_ERROR_TDC3 (1<<11)
115 #define F1_CSR_ERROR_TDC4 (1<<12)
116 #define F1_CSR_ERROR_TDC5 (1<<13)
117 #define F1_CSR_ERROR_TDC6 (1<<14)
118 #define F1_CSR_ERROR_TDC7 (1<<15)
120 #define F1_CSR_BUF0_EMPTY (1<<17)
121 #define F1_CSR_BUF1_EMPTY (1<<18)
123 #define F1_CSR_TOKEN_RETURN (1<<24)
127 #define F1_CSR_START (1<<27)
128 #define F1_CSR_SYNC_RESET (1<<28)
129 #define F1_CSR_TRIGGER (1<<29)
130 #define F1_CSR_SOFT_RESET (1<<30)
131 #define F1_CSR_HARD_RESET (1<<31)
134 #define F1_CONTROL_MASK 0xffffffff
135 #define F1_CTRL_SIGNALS_MASK 0x000003ff
139 #define F1_REFCLK_SRC_MASK 0x7
140 #define F1_REFCLK_SRC_INTERNALFP (1<<0)
141 #define F1_REFCLK_INTERNAL_ENABLE (1<<1)
142 #define F1_REFCLK_SRC_FP (1<<2)
143 #define F1_SYNC_RESET_SRC_MASK 0x18
144 #define F1_SYNC_RESET_SRC_FP (1<<3)
145 #define F1_SYNC_RESET_SRC_P0 (2<<3)
146 #define F1_SYNC_RESET_SRC_SOFT (3<<3)
147 #define F1_TRIGGER_SRC_MASK 0x60
148 #define F1_TRIGGER_SRC_FP (1<<5)
149 #define F1_TRIGGER_SRC_P0 (2<<5)
150 #define F1_TRIGGER_SRC_SOFT (3<<5)
151 #define F1_START_SRC_MASK 0x180
152 #define F1_START_SRC_FP (1<<7)
153 #define F1_START_SRC_P0 (2<<7)
154 #define F1_START_SRC_SOFT (3<<7)
157 #define F1_ENABLE_SOFT_CONTROL (1<<9)
158 #define F1_INT_ENABLE (1<<24)
159 #define F1_ENABLE_BERR (1<<25)
160 #define F1_ENABLE_MULTIBLOCK (1<<26)
161 #define F1_FIRST_BOARD (1<<27)
162 #define F1_LAST_BOARD (1<<28)
163 #define F1_MB_TOKEN_P0 (1<<29)
164 #define F1_MB_TOKEN_P2 (1<<30)
165 #define F1_MB_CONFIG_MASK 0x7c000000
179 #define F1_EVENT_COUNT_MASK 0x00FFFFFF
182 #define F1_BLOCKLEVEL_MASK 0xFFFF
185 #define F1_INT_VEC_MASK 0xff
186 #define F1_INT_LEVEL_MASK 0x700
187 #define F1_SLOT_ID_MASK 0x1f0000
190 #define F1_A32_ENABLE (1<<0)
191 #define F1_A32_ADDR_MASK 0xffc0
194 #define F1_AMB_ENABLE (1<<0)
195 #define F1_AMB_MIN_MASK 0xffc0
196 #define F1_AMB_MAX_MASK 0xffc00000
200 #define F1_CHIP_RES_LOCKED (1<<0)
201 #define F1_CHIP_HITFIFO_OVERFLOW (1<<1)
202 #define F1_CHIP_TRIGFIFO_OVERFLOW (1<<2)
203 #define F1_CHIP_OUTFIFO_OVERFLOW (1<<3)
204 #define F1_CHIP_EXTFIFO_FULL (1<<4)
205 #define F1_CHIP_EXTFIFO_ALMOST_FULL (1<<5)
206 #define F1_CHIP_EXTFIFO_EMPTY (1<<6)
207 #define F1_CHIP_INITIALIZED (1<<7)
208 #define F1_CHIP_LOSS_OF_LOCK_OCCURRED (1<<8)
209 #define F1_CHIP_CLEAR_STATUS (1<<15)
210 #define F1_CHIP_ERROR_COND 0x1f1e
211 #define F1_CHIP_STAT_MASK 0x007e
212 #define F1_CHIP_LATCH_STAT_MASK 0x1f00
215 #define F1_HIREZ_MODE 0x8000
217 #define F1_CONFIG_CHIP_MASK 0x00E00000
218 #define F1_CONFIG_COMMON (1<<20)
219 #define F1_CONFIG_REG_MASK 0x000F0000
220 #define F1_CONFIG_DATA_MASK 0x0000FFFF
223 #define F1_GO_DATA (1<<0)
224 #define F1_FORCE_BUSY (1<<15)
225 #define F1_SYSTEM_TEST_MODE (1<<16)
226 #define F1_SINGLE_BOARD_TEST_MODE (1<<17)
227 #define F1_TRIGGER_LED_ENABLE (1<<18)
228 #define F1_STATUS_LED_ENABLE (1<<19)
231 #define F1_CONFIG_CSR_WRITE_EN (1<<31)
232 #define F1_CONFIG_CSR_BULK_ERASE (1<<30)
233 #define F1_CONFIG_CSR_SECTOR_ERASE (1<<29)
234 #define F1_CONFIG_CSR_SECTOR_BUSY (1<<8)
235 #define F1_CONFIG_CSR_LAST_DATA_MASK 0xFF
238 #define F1_CONFIG_DATA_ADDR_MASK 0xFFFFFF00
239 #define F1_CONFIG_DATA_DATA_MASK 0x000000FF
246 #define F1_CONTROL_SEL_MASK 0x7
247 #define F1_EVENT_LEVEL_MASK 0xffff
248 #define F1_INT_ENABLE_MASK 0x18
249 #define F1_MODULE_EMPTY_MASK (F1_CSR_ZERO_EVENTS_FLAG | F1_CSR_BUF0_EMPTY | F1_CSR_BUF1_EMPTY | F1_CSR_EXTFIFO_EMPTY)
255 #define F1_ALL_CHIPS 0xff
256 #define F1_OFFSET_MASK 0x3f3f
257 #define F1_ENABLE_EDGES 0x4040
258 #define F1_ENABLE_DUAL_EDGES 0xc0c0
259 #define F1_DISABLE_EDGES_ODD 0xff3f
260 #define F1_DISABLE_EDGES_EVEN 0x3fff
261 #define F1_DISABLE_EDGES 0x3f3f
264 #define F1_PULSER_DELAY_MASK 0x00000fff
265 #define F1_PULSER_DAC_RESET 0x002f0000
266 #define F1_PULSER_DAC_INT_REF 0x003f0001
267 #define F1_PULSER_DAC_MASK 0x0000fff0
268 #define F1_PULSER_DAC_A_VALUE 0x00000000
269 #define F1_PULSER_DAC_B_VALUE 0x00010000
270 #define F1_PULSER_DAC_BOTH_VALUE 0x00070000
271 #define F1_PULSER_PULSE_OUT (1<<0)
272 #define F1_PULSER_TRIGGER_OUT (1<<1)
275 #define F1_TEST_TRIG_OUT (1<<0)
276 #define F1_TEST_BUSY_OUT (1<<1)
277 #define F1_TEST_SDLINK_OUT (1<<2)
278 #define F1_TEST_TOKEN_OUT (1<<3)
279 #define F1_TEST_STATBITB_IN (1<<8)
280 #define F1_TEST_TOKEN_IN (1<<9)
281 #define F1_TEST_CLOCK_COUNTER_STATUS (1<<15)
284 #define F1_CLOCK_SCALER_RESET 0
285 #define F1_CLOCK_SCALER_START 0
286 #define F1_SYNC_SCALER_RESET 0
287 #define F1_TRIG1_SCALER_RESET 0
288 #define F1_TRIG2_SCALER_RESET 0
290 #define F1_DATA_TYPE_DEFINE 0x80000000
291 #define F1_DATA_TYPE_MASK 0x78000000
292 #define F1_DATA_SLOT_MASK 0x07c00000
294 #define F1_DATA_BLOCK_HEADER 0x00000000
295 #define F1_DATA_BLOCK_TRAILER 0x08000000
296 #define F1_DATA_EVENT_HEADER 0x10000000
297 #define F1_DATA_TRIGGER_TIME 0x18000000
298 #define F1_DATA_WINDOW_RAW 0x20000000
299 #define F1_DATA_WINDOW_SUM 0x28000000
300 #define F1_DATA_PULSE_RAW 0x30000000
301 #define F1_DATA_PULSE_INTEGRAL 0x38000000
302 #define F1_DATA_PULSE_TIME 0x40000000
303 #define F1_DATA_STREAM 0x48000000
304 #define F1_DATA_INVALID 0x70000000
305 #define F1_DATA_FILLER 0x78000000
307 #define F1_DATA_BLKNUM_MASK 0x0000003f
308 #define F1_DATA_WRDCNT_MASK 0x003fffff
309 #define F1_DATA_TRIGNUM_MASK 0x07ffffff
312 #define F1_DATA_TDC_MASK 0x00ffffff
313 #define F1_DATA_FLAG_MASK 0x07000000
318 #define F1_DATA_CHIP_MASK 0x00380000
319 #define F1_DATA_CHAN_MASK 0x00070000
320 #define F1_DATA_TIME_MASK 0x0000ffff
322 #define F1_HEAD_DATA 0x00000000
323 #define F1_TAIL_DATA 0x00000007
324 #define F1_DUMMY_DATA 0xf800ffff
326 #define F1_HT_DATA_MASK 0x00800007
327 #define F1_HT_CHAN_MASK 0x00000007
328 #define F1_HT_CHIP_MASK 0x00000038
329 #define F1_HT_XOR_MASK 0x00000040
330 #define F1_HT_TRIG_MASK 0x0000ff80
331 #define F1_HT_EVENT_MASK 0x003f0000
332 #define F1_HT_TRIG_OVF_MASK 0x00400000
339 int f1Init (
unsigned int addr,
unsigned int addr_inc,
int ntdc,
int iFlag);
340 int f1Slot(
unsigned int i);
344 int f1ConfigRead(
int id,
unsigned int *config_data,
int chipID);
352 int f1ReadBlock(
int id,
volatile unsigned int *data,
int nwrds,
int rflag);
364 void f1Reset(
int id,
int iFlag);
376 int f1SetWindow(
int id,
int window,
int latency,
int chipMask);
377 void f1GSetWindow(
int window,
int latency,
int chipMask);
void f1TestResetTrig1Counter(int id)
Reset the counter of the trig1 scaler.
Definition: f1tdcLib.c:4900
unsigned int f1DisableLetra(int id, int chipMask)
Disable lead and trailing edges for the f1TDC chips indicated by the chipMask for the module...
Definition: f1tdcLib.c:3877
void f1EnableSoftTrig(int id)
Enable software triggers on the module.
Definition: f1tdcLib.c:3906
int f1GetRez(int id)
Return the mask of f1TDCs chips on the module that are set in high resolution mode.
Definition: f1tdcLib.c:2855
int f1Slot(unsigned int i)
Convert an index into a slot number, where the index is the element of an array of F1TDCs in the orde...
Definition: f1tdcLib.c:621
void f1GStatus(int sFlag)
Print Status of all initialized f1TDCs to standard out.
Definition: f1tdcLib.c:1536
volatile unsigned int p0_trig2_scaler
Definition: f1tdcLib.h:70
int f1Init(unsigned int addr, unsigned int addr_inc, int ntdc, int iFlag)
volatile unsigned int test_config
Definition: f1tdcLib.h:66
void f1EnableClk(int id, int cflag)
Enable the specified clock source on the module.
Definition: f1tdcLib.c:3765
volatile unsigned int adr_mb
Definition: f1tdcLib.h:44
void f1GSetWindow(int window, int latency, int chipMask)
Set the window parameters for specified f1TDC chips in chipMask for all initialized modules...
Definition: f1tdcLib.c:2996
unsigned int f1EnableLetra(int id, int chipMask)
Enable lead and trailing edges for the f1TDC chips indicated by the chipMask for the module...
Definition: f1tdcLib.c:3846
int f1DisableData(int id)
Disable data on all f1TDC chips for the module.
Definition: f1tdcLib.c:3328
volatile unsigned short stat[8]
Definition: f1tdcLib.h:45
void f1GSyncReset()
Perform a software Sync Reset for all initialized modules.
Definition: f1tdcLib.c:2539
void f1Clear(int id)
Perform a soft reset on the f1TDC module.
Definition: f1tdcLib.c:2157
int f1ConfigReadFile(char *filename)
Read in user defined (4) f1TDC chip registers from specified file.
Definition: f1tdcLib.c:1033
void f1TestSetTrigOut(int id, int mode)
Set the level of Trig Out to the SD.
Definition: f1tdcLib.c:4471
void f1SyncReset(int id)
Perform a software Sync Reset on the module.
Definition: f1tdcLib.c:2506
volatile unsigned int block_word_count_fifo
Definition: f1tdcLib.h:64
int f1TestGetStatBitB(int id)
Get the level of the StatBitB to the SD.
Definition: f1tdcLib.c:4620
int f1SetConfig(int id, int iflag, int chipMask)
Set which preset/user configuration to use for specified slot id for indicated chips in chipmask...
Definition: f1tdcLib.c:914
void f1GClearStatus(unsigned int chipMask)
Clear the latched error status of specified f1TDC chips in the chipMask in all initialized f1TDCs...
Definition: f1tdcLib.c:2241
int f1FirmwareGDownloadConfigData()
void f1Start(int id)
Issue a software Start signal to the module.
Definition: f1tdcLib.c:2647
volatile unsigned int pulser_control
Definition: f1tdcLib.h:61
int f1EnableChannel(int id, int input)
Enable an individual channel input.
Definition: f1tdcLib.c:3516
unsigned int f1ScanMask()
Return the mask of all initialized modules.
Definition: f1tdcLib.c:2832
volatile unsigned int test_scaler
Definition: f1tdcLib.h:56
volatile unsigned int block_fifo_count
Definition: f1tdcLib.h:63
unsigned int f1TestGetSyncCounter(int id)
Return the value of the SyncReset scaler.
Definition: f1tdcLib.c:4748
int f1FirmwareVerifyDownload(int id, int print_header)
volatile unsigned int block_count
Definition: f1tdcLib.h:62
int f1WriteControl(int id, unsigned int val)
Write provided value to the CTRL register of the module.
Definition: f1tdcLib.c:3049
void f1TestResetTrig2Counter(int id)
Reset the counter of the trig2 scaler.
Definition: f1tdcLib.c:4927
volatile unsigned int status_spare
Definition: f1tdcLib.h:65
volatile unsigned int trig2_scaler
Definition: f1tdcLib.h:54
void f1GEnableData(int chipMask)
Enable data on f1TDC chips specified in chipMask for all initialized modules.
Definition: f1tdcLib.c:3306
unsigned int f1TestGetTrig1Counter(int id)
Return the value of the trig1 scaler.
Definition: f1tdcLib.c:4780
int f1Disable(int id)
Disable f1TDC FPGA data fifo on the module.
Definition: f1tdcLib.c:3145
void f1TestResetSyncCounter(int id)
Reset the counter of the SyncReset scaler.
Definition: f1tdcLib.c:4872
int f1ReadBlock(int id, volatile unsigned int *data, int nwrds, int rflag)
volatile unsigned int ctrl2
Definition: f1tdcLib.h:50
volatile unsigned int p0_sync_scaler
Definition: f1tdcLib.h:68
void f1TestSetSystemTestMode(int id, int mode)
Enable/Disable System test mode.
Definition: f1tdcLib.c:4427
int f1SetPulserDAC(int id, int output, int dac)
Set the DAC level for the outgoing pulse.
Definition: f1tdcLib.c:4302
int f1FirmwareEraseEPROM(int id)
int f1SetWindow(int id, int window, int latency, int chipMask)
Set the window parameters for specified f1TDC chips in chipMask on the module.
Definition: f1tdcLib.c:2895
void f1ConfigShow(int id, int chipMask)
Print to standard out the configuration of the f1TDC chips specified by the chipmask and module in sl...
Definition: f1tdcLib.c:1081
int f1SoftPulser(int id, int output)
Trigger the pulser.
Definition: f1tdcLib.c:4369
volatile unsigned int scaler2
Definition: f1tdcLib.h:47
int f1ConfigWrite(int id, int *config_data, int chipMask)
Write the specified configuration to provided chips of the module in slot id indicated by the chipmas...
Definition: f1tdcLib.c:649
volatile unsigned int token_test
Definition: f1tdcLib.h:57
volatile unsigned int p0_trig1_scaler
Definition: f1tdcLib.h:69
volatile unsigned int intr
Definition: f1tdcLib.h:42
volatile unsigned int serial_eprom
Definition: f1tdcLib.h:53
void f1DisableClk(int id)
Disable the current clock source on the module.
Definition: f1tdcLib.c:3815
unsigned int f1GBready()
Return the mask of all initialized modules with blocks available for readout.
Definition: f1tdcLib.c:2777
int f1Enabled(int id)
Return enabled/disabled status of FPGA data fifo.
Definition: f1tdcLib.c:3192
int f1GetSerialNumber(int id, char **rval)
Fills 'rval' with a character array containing the fa250 serial number.
Definition: f1tdcLib.c:1198
void f1GSetBlockLevel(int level)
Set the block level (number of events per block) on all initialized modules.
Definition: f1tdcLib.c:4090
void f1TestResetClockCounter(int id)
Reset the counter of the 250MHz Clock scaler.
Definition: f1tdcLib.c:4843
void f1Reset(int id, int iFlag)
Perform a hard reset of the module.
Definition: f1tdcLib.c:2459
volatile unsigned int sync_scaler
Definition: f1tdcLib.h:55
volatile unsigned int config_csr
Definition: f1tdcLib.h:51
void f1DisableMultiBlock()
Disable multiblock readout for all initialized modules.
Definition: f1tdcLib.c:4158
int f1TestGetTokenIn(int id)
Get the level of the Token In from the SD.
Definition: f1tdcLib.c:4652
void f1EnableChannelMask(int id, unsigned long long int mask)
Enable inputs indicated in channel mask for the module.
Definition: f1tdcLib.c:3656
unsigned int f1TestGetTrig2Counter(int id)
Return the value of the trig2 scaler.
Definition: f1tdcLib.c:4812
int f1FirmwareReadFile(char *filename)
int f1EnableData(int id, int chipMask)
Enable data on f1TDC chips specified in chipMask for the module.
Definition: f1tdcLib.c:3223
int f1GetFirmwareVersion(int id, int pflag)
Get the firmware version of the FPGA.
Definition: f1tdcLib.c:1253
void f1TestSetSdLink(int id, int mode)
Set the level of the SD Link.
Definition: f1tdcLib.c:4546
void f1DisableSoftTrig(int id)
Disable software triggers on the module.
Definition: f1tdcLib.c:3953
int f1TestGetClockCounterStatus(int id)
Return the status of the 250Mhz Clock Counter.
Definition: f1tdcLib.c:4684
volatile unsigned int test_spare[3]
Definition: f1tdcLib.h:71
void f1EnableBusError(int id)
Enable bus error block termination on the module.
Definition: f1tdcLib.c:3980
volatile unsigned int token_test_scaler
Definition: f1tdcLib.h:58
unsigned int f1TestGetClockCounter(int id)
Return the value of the 250Mhz Clock scaler.
Definition: f1tdcLib.c:4716
void f1GEnableBusError()
Enable bus error block termination for all initialized modules.
Definition: f1tdcLib.c:4005
void f1ChipStatus(int id, int pflag)
Print Status of f1TDC chips to standard out.
Definition: f1tdcLib.c:1558
int f1SetBlockLevel(int id, int level)
Set the block level (number of events per block) on the module.
Definition: f1tdcLib.c:4058
void f1DisableBusError(int id)
Disable bus error block termination on the module.
Definition: f1tdcLib.c:4027
int f1Enable(int id)
Enable f1TDC FPGA data fifo on the module.
Definition: f1tdcLib.c:3099
int f1GDisable()
Disable f1TDC FPGA data fifo on all initialized modules.
Definition: f1tdcLib.c:3169
void f1TestSetTokenOut(int id, int mode)
Set the level of Token Out to the SD.
Definition: f1tdcLib.c:4584
int f1PrintEvent(int id, int rflag)
Readout and print event to standard out.
Definition: f1tdcLib.c:1881
int f1FirmwareGVerifyDownload()
volatile unsigned int config
Definition: f1tdcLib.h:49
volatile unsigned int ctrl
Definition: f1tdcLib.h:39
unsigned int blank0
Definition: f1tdcLib.h:48
int f1FlushEvent(int id)
Routine to flush a partial event from the FIFO. Read until a valid trailer is found.
Definition: f1tdcLib.c:2021
Definition: f1tdcLib.h:35
int f1DisableChannel(int id, int input)
Disable an individual channel input.
Definition: f1tdcLib.c:3499
int f1FirmwareGEraseEPROM()
void f1TestSetBusyOut(int id, int mode)
Set the level of Busy Out to the SD.
Definition: f1tdcLib.c:4509
void f1GClear()
Perform a soft reset on all initialized f1TDC modules.
Definition: f1tdcLib.c:2180
void f1DataDecode(int id, unsigned int data)
Decode a data word from an fADC250 and print to standard out.
Definition: f1tdcLib.c:5106
int f1Dready(int id)
Determine if an event is ready for readout on the module.
Definition: f1tdcLib.c:2722
int f1GCheckLock(int pflag)
Get Resolution lock status for all chips on all initialized f1TDCs.
Definition: f1tdcLib.c:2413
volatile unsigned int pulser_delay
Definition: f1tdcLib.h:59
void f1Trig(int id)
Issue a software trigger to the module.
Definition: f1tdcLib.c:2575
volatile unsigned int blocklevel
Definition: f1tdcLib.h:41
volatile unsigned int config_data
Definition: f1tdcLib.h:52
int f1CheckLock(int id)
Get Resolution lock status for all chips on the board.
Definition: f1tdcLib.c:2369
int f1SetPulserTriggerDelay(int id, int delay)
Set the delay between the output pulse and f1TDC trigger.
Definition: f1tdcLib.c:4251
int f1FirmwareDownloadConfigData(int id, int print_header)
void f1GWriteControl(unsigned int val)
Write provided value to the CTRL register to all initialized modules.
Definition: f1tdcLib.c:3079
volatile unsigned int clock_scaler
Definition: f1tdcLib.h:67
unsigned int f1GErrorStatus(int sflag)
Return the Error status for all the f1TDC chips on all initialized modules.
Definition: f1tdcLib.c:2318
void f1ResetToken(int id)
Reset the token for the module.
Definition: f1tdcLib.c:4188
void f1GTrig()
Issue a software trigger to all initialized modules.
Definition: f1tdcLib.c:2611
void f1GEnableSoftTrig()
Enable software triggers for all initialized modules.
Definition: f1tdcLib.c:3931
volatile unsigned int pulser_dac
Definition: f1tdcLib.h:60
volatile unsigned int adr32
Definition: f1tdcLib.h:43
volatile unsigned int version
Definition: f1tdcLib.h:37
int f1ResetPulser(int id)
Reset (initialize) pulser.
Definition: f1tdcLib.c:4213
int f1DataScan(int pflag)
Return the mask of all initialized modules with events available for readout.
Definition: f1tdcLib.c:2805
void f1GStart()
Issue a software Start signal to all initialized modules.
Definition: f1tdcLib.c:2683
void f1DisableChannelMask(int id, unsigned long long int mask)
Disable inputs indicated in channel mask for the module.
Definition: f1tdcLib.c:3640
void f1EnableMultiBlock(int tflag)
Enable multiblock readout for all initialized modules.
Definition: f1tdcLib.c:4111
int f1ConfigRead(int id, unsigned int *config_data, int chipID)
Read the f1TDC Chip Registers into user specified config_data array.
Definition: f1tdcLib.c:992
volatile unsigned int scaler1
Definition: f1tdcLib.h:46
void f1ClearStatus(int id, unsigned int chipMask)
Clear the latched error status of specified f1TDC chips in the chipMask.
Definition: f1tdcLib.c:2203
unsigned int f1ErrorStatus(int id, int sflag)
Return the Error status for all the f1TDC chips on the module.
Definition: f1tdcLib.c:2265
unsigned int f1ReadCSR(int id)
Return the value of the CSR register of the module.
Definition: f1tdcLib.c:3018
volatile unsigned int ev_count
Definition: f1tdcLib.h:40
volatile unsigned int csr
Definition: f1tdcLib.h:38
int f1GPrintEvent(int rflag)
Readout and print event from all initialized f1TDCs to standard out.
Definition: f1tdcLib.c:2114
void f1Status(int id, int sflag)
Print Status of f1TDC to standard out.
Definition: f1tdcLib.c:1291
int f1GEnable()
Enable f1TDC FPGA data fifo on all initialized modules.
Definition: f1tdcLib.c:3123
int f1GConfigWrite(int *config_data, int chipMask)
Write the specified configuration to provided chips of all initialized f1TDCs indicated by the chipma...
Definition: f1tdcLib.c:776