From: hadaq Date: Wed, 28 Oct 2009 16:27:10 +0000 (+0000) Subject: new trigger info, now 24-Bit X-Git-Tag: v6.0~314 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=3edf885396f1748135f84b2f37adc763c4c9e16c;p=trbnettools.git new trigger info, now 24-Bit --- diff --git a/libtrbnet/trbcmd.c b/libtrbnet/trbcmd.c index 0f22d15..fd64caa 100644 --- a/libtrbnet/trbcmd.c +++ b/libtrbnet/trbcmd.c @@ -16,7 +16,7 @@ static int hexMode = HEXMODE; -static const char trbcmd_version[] = "$Revision: 2.35 $"; +static const char trbcmd_version[] = "$Revision: 2.36 $"; /* ---- User Buffer Size ----------------------------------------------- */ @@ -625,7 +625,7 @@ int main(int argc, char ** argv) uint8_t type; uint8_t random = 0; - uint8_t info = 0; + uint32_t info = 0; uint16_t number = 0; if (cmdLen != 5) { @@ -656,7 +656,7 @@ int main(int argc, char ** argv) "Command: SEND_TRIGGER: " "type: 0x%01x, " "random: 0x%02x, " - "info: 0x%02x, " + "info: 0x%06x, " "number: 0x%04x\n", type, random, info, number); } @@ -777,7 +777,7 @@ int main(int argc, char ** argv) uint8_t input = 0; uint8_t type = 0; uint8_t random = 0; - uint8_t info = 0; + uint32_t info = 0; uint16_t number = 0; if (cmdLen != 6) { @@ -811,7 +811,7 @@ int main(int argc, char ** argv) "input: 0x%01x, " "type: 0x%01x, " "random: 0x%02x, " - "info: 0x%02x, " + "info: 0x%06x, " "number: 0x%04x\n", input, type, random, info, number); } diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 095c559..f56f3f1 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,4 +1,4 @@ -const char trbnet_version[] = "$Revision: 2.46 $"; +const char trbnet_version[] = "$Revision: 2.47 $"; #include #include @@ -72,6 +72,7 @@ const char trbnet_version[] = "$Revision: 2.46 $"; #define CHANNEL_0_SENDER_ERROR 0x0112 #define CHANNEL_0_SENDER_DATA 0x0113 #define CHANNEL_0_SENDER_FIFO_STATUS 0x0114 +#define CHANNEL_0_SENDER_TRIGGER_INFO 0x0115 #define CHANNEL_0_SENDER_STATUS 0x011f #define CHANNEL_0_RECEIVER_DATA 0x0213 #define CHANNEL_0_RECEIVER_FIFO_STATUS 0x0214 @@ -1371,7 +1372,7 @@ int trb_ipu_data_read(uint8_t type, int trb_send_trigger(uint8_t type, - uint8_t trg_info, + uint32_t trg_info, uint8_t trg_random, uint16_t trg_number) { @@ -1393,10 +1394,14 @@ int trb_send_trigger(uint8_t type, } /* Prepare trigger channel */ - write32_to_FPGA(CHANNEL_0_SENDER_ERROR, (((uint32_t)trg_info << 24) | + write32_to_FPGA(CHANNEL_0_SENDER_ERROR, (((trg_info & 0xff) << 24) | ((uint32_t)trg_random << 16) | ((uint32_t)trg_number) )); + + write32_to_FPGA(CHANNEL_0_SENDER_TRIGGER_INFO, (trg_info >> 8) & 0xffff); + + /* Send trigger */ write32_to_FPGA(CHANNEL_0_SENDER_CONTROL, @@ -1418,7 +1423,7 @@ int trb_send_trigger(uint8_t type, int trb_send_trigger_rich(uint8_t trg_input, uint8_t type, - uint8_t trg_info, + uint32_t trg_info, uint8_t trg_random, uint16_t trg_number) { @@ -1450,11 +1455,13 @@ int trb_send_trigger_rich(uint8_t trg_input, } /* Prepare trigger channel */ - write32_to_FPGA(CHANNEL_0_SENDER_ERROR, (((uint32_t)trg_info << 24) | + write32_to_FPGA(CHANNEL_0_SENDER_ERROR, (((trg_info & 0xff) << 24) | ((uint32_t)trg_random << 16) | ((uint32_t)trg_number) )); - + + write32_to_FPGA(CHANNEL_0_SENDER_TRIGGER_INFO, (trg_info >> 8) & 0xffff); + /* Prepare slowcontrol channel */ write32_to_FPGA(CHANNEL_3_TARGET_ADDRESS, 0x0000fffb); /* RICH Subnet only */ write32_to_FPGA(CHANNEL_3_SENDER_ERROR, 0x00000000); diff --git a/libtrbnet/trbnet.h b/libtrbnet/trbnet.h index 64ff780..5d9c83d 100644 --- a/libtrbnet/trbnet.h +++ b/libtrbnet/trbnet.h @@ -53,13 +53,13 @@ int trb_ipu_data_read(uint8_t type, unsigned int dsize); int trb_send_trigger(uint8_t type, - uint8_t info, + uint32_t info, uint8_t random, uint16_t number); int trb_send_trigger_rich(uint8_t input, uint8_t type, - uint8_t info, + uint32_t info, uint8_t random, uint16_t number); @@ -225,7 +225,7 @@ int trb_fifo_flush(uint8_t channel); /************************************************************************/ /* int trb_send_trigger(uint8_t type, - uint8_t info, + uint32_t info, uint8_t random, uint16_t number); */