# 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

# data_len_format
0x6032  3                                           # 0 -> 8 bit, 1 -> 16 bit, 2 -> 32 bit, 3 -> 64 bit
                                                    # At 3 a fill word may be added to the buffer to get an
                                                    # even number of 32 bit words.
                                                    # For MBLT readout (default in the supplied readout script)
                                                    # a value of 3 is required!

# 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
