# Settings related to the readout loop
# #####################################
# Trigger output via IRQ-lines at Backplane; MDPP-16
# Implemented since March 2021.
# 0x6300 0b1111'1111'1111'1111  IRQ 1
# 0x6304 0b1111'1111'1111'1111  IRQ 2 ; example: all channels add their triggers to this IRQ line
# 0x6308 0b1111'1111'1111'1111  IRQ 3
# 0x630C 0b1111'1111'1111'1111  IRQ 4
# 0x6310 0b1111'1111'1111'1111  IRQ 5
# 0x6314 0b1111'1111'1111'1111  IRQ 6
# 0x6318 0b1111'1111'1111'1111  IRQ 7
#######################################

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
