# Settings related to the readout loop
# #####################################
0x6010  ${sys_irq}                          # irq level

# IRQ_source and thresholds
#0x601C 1                                   # 1 -> specifies number of words
#0x6018 100                                 # IRQ-FIFO threshold, words
0x601C 0                                    # 0 -> the following register specifies the number of events
0x601E $(${mesy_readout_num_events} + 2)    # IRQ-FIFO threshold, events

# marking_type
0x6038 ${mesy_eoe_marker}                   # End Of Event marking
                                            # 0 -> event counter
                                            # 1 -> time stamp
                                            # 3 -> extended time stamp

# multi event mode:
0x6036 0xb                                  # 0x0 -> single event
                                            # 0x3 -> multi event, number of words
                                            # 0xb -> multievent, transmits number of events specified

# max_transfer_data
0x601A ${mesy_readout_num_events}           # multi event mode == 0x3 -> Berr is emitted when more or equal the
                                            #   specified number of words have been sent and "End Of Event" is detected.
                                            # multi event mode == 0xb -> Berr is emitted when the specified number
                                            #   of events has been transmitted.

# Stop the module from accepting triggers and clear the readout FIFO.
# Acquisition will be started simultaneously for all modules in the parent
# event by the "Multicast DAQ Start" script.
0x603a 0   # stop acq
0x603c 1   # FIFO reset
0x6034 1   # readout reset

# MCST - Multicast Setup
# #####################################
0x6020 0x80                                 # Enable multicast
0x6024 0x${mesy_mcst}                       # Set 8 high bits of MCST address

# Immediately activate the single-shot test pulser (gen_event).
#writeabs a32 d16 0x${mesy_mcst}00604A      1
