#!/bin/bash

# After calling wr2rf_init.sh for both tx and rx wr2rf_vme cards. The sequence outlined below
# can be used to "simulate" an injection cycle of the sps at two different. The slot numbers used 
#are specific to cfv-774-celma4 card configuration and should be adapted...
# slot 2 is TX, slots 4 RX

ftw_SFTPRO2_hex=0016b0bbb3c4
echo "FTW SFT protons: $ftw_SFTPRO2_hex"

ftw_LHCPILOT_hex=0016b9f306de
echo "FTW LHC protons: $ftw_LHCPILOT_hex"

ftw_SFTION1_hex=00168b5cbff4
echo "FTW SFT ion    : $ftw_SFTION1_hex"

###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_SFTPRO2_hex reset

###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_LHCPILOT_hex reset

###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_SFTION1_hex reset

