AlcapDAQ  1
Functions.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * CAEN SpA - Front End Division
4 * Via Vetraia, 11 - 55049 - Viareggio ITALY
5 * +390594388398 - www.caen.it
6 *
7 ***************************************************************************/
17 #ifndef READOUT_TEST_FUNCTIONS
18 #define READOUT_TEST_FUNCTIONS
19 
20 #include "keyb.h"
21 #include "CAENDigitizerType.h"
22 #ifdef WIN32
23 
24  #include <time.h>
25  #include <sys/timeb.h>
26  #include <conio.h>
27  #include <process.h>
28  #define getch _getch /* redefine POSIX 'deprecated' */
29  #define kbhit _kbhit /* redefine POSIX 'deprecated' */
30 
31 #else
32  #include <unistd.h>
33  #include <stdint.h> /* C99 compliant compilers: uint64_t */
34  #include <ctype.h> /* toupper() */
35  #include <sys/time.h>
36 #endif
37 
38 typedef struct
39 {
41  uint32_t VMEBaseAddress;
42  uint32_t RecordLength;
43  uint32_t ChannelMask;
44  int EventAggr;
49 
50 
51 /* ###########################################################################
52 * Functions
53 * ########################################################################### */
57 long get_time();
58 
59 /* --------------------------------------------------------------------------------------------------------- */
63 /* --------------------------------------------------------------------------------------------------------- */
64 int DataConsistencyCheck(uint32_t *buff32, int NumWords);
65 
66 
67 /* --------------------------------------------------------------------------------------------------------- */
71 /* --------------------------------------------------------------------------------------------------------- */
72 
73 int SaveHistogram(char *basename, int b, int ch, uint32_t *EHisto);
74 
75 /* --------------------------------------------------------------------------------------------------------- */
79 /* --------------------------------------------------------------------------------------------------------- */
80 int SaveWaveform(int b, int ch, int trace, int size, int16_t *WaveData);
81 
82 /* --------------------------------------------------------------------------------------------------------- */
86 /* --------------------------------------------------------------------------------------------------------- */
87 int SaveDigitalProbe(int b, int ch, int trace, int size, uint8_t *WaveData);
88 
89 /* --------------------------------------------------------------------------------------------------------- */
94 void PrintInterface();
95 
96 #endif