AlcapDAQ  1
X742CorrectionRoutines.h
Go to the documentation of this file.
1 #include <string.h>
2 #include "CAENDigitizer.h"
3 
4 #define MAX_X742_CHANNELS 0x08
5 #define MAX_X742_CHANNEL_SIZE 9
6 #define FLASH(n) (0x10D0 | ( n << 8)) // base address of the flash memory (first byte)
7 #define SEL_FLASH(n) (0x10CC | ( n << 8)) // flash enable/disable
8 #define STATUS(n) (0x1088 | ( n << 8)) // status register
9 #define MAIN_MEM_PAGE_READ 0x00D2
10 #define MAIN_MEM_PAGE_PROG_TH_BUF1 0x0082
11 
12 typedef struct {
13  int16_t cell[MAX_X742_CHANNELS+1][1024];
14  int8_t nsample[MAX_X742_CHANNELS+1][1024];
15  float time[1024];
17 
18 int32_t LoadCorrectionTables(int handle, DataCorrection_t *Table, uint8_t group, uint32_t frequency);
19 void ApplyDataCorrection(DataCorrection_t* CTable, CAEN_DGTZ_DRS4Frequency_t frequency, int CorrectionLevelMask, CAEN_DGTZ_X742_GROUP_t *data);