]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
new trigger info, now 24-Bit
authorhadaq <hadaq>
Wed, 28 Oct 2009 16:27:10 +0000 (16:27 +0000)
committerhadaq <hadaq>
Wed, 28 Oct 2009 16:27:10 +0000 (16:27 +0000)
libtrbnet/trbcmd.c
libtrbnet/trbnet.c
libtrbnet/trbnet.h

index 0f22d155bec5307b7aab812fc84674be02c7121c..fd64caa5b7c2741e3c687007753e74bdf9c84dae 100644 (file)
@@ -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);
         }
index 095c5598f0dced4969d881c61394b67b097fd4b8..f56f3f19585490c21387ba2b62b370c2a2ef4578 100644 (file)
@@ -1,4 +1,4 @@
-const char trbnet_version[] = "$Revision: 2.46 $";
+const char trbnet_version[] = "$Revision: 2.47 $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -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);
index 64ff78083a13f12febbfd94bc54384f10d7f8e9b..5d9c83d965ad3befd850f7a2234db208cb843889 100644 (file)
@@ -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);
 */