mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Dac (#67)
* dac WIP * dacs WIP * DACs are working with names * namechanges of vrfsh->vshaper, vrfshnpol->vshaperneg * pattern for MY3, configure MAC for MY3
This commit is contained in:

committed by
Dhanya Thattil

parent
16f7b42533
commit
5f94b5c246
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#define REQRD_FRMWRE_VRSN 0x190000
|
||||
#define MIN_REQRD_VRSN_T_RD_API 0x190000
|
||||
|
||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||
|
||||
@ -11,6 +13,8 @@
|
||||
#define HV_SOFT_MAX_VOLTAGE (200)
|
||||
#define HV_HARD_MAX_VOLTAGE (530)
|
||||
#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac")
|
||||
#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac")
|
||||
#define DAC_MAX_MV (2048)
|
||||
|
||||
/** Default Parameters */
|
||||
#define DEFAULT_NUM_FRAMES (1)
|
||||
@ -23,29 +27,58 @@
|
||||
#define DEFAULT_TICK_CLK (20) // will be fixed later. Not configurable
|
||||
#define DEFAULT_SAMPLING_CLK (80)
|
||||
|
||||
/* Firmware Definitions */
|
||||
#define IP_HEADER_SIZE (20)
|
||||
|
||||
/** Other Definitions */
|
||||
#define BIT16_MASK (0xFFFF)
|
||||
|
||||
/* Enums */
|
||||
enum CLKINDEX {RUN_CLK, TICK_CLK, SAMPLING_CLK, NUM_CLOCKS};
|
||||
enum DACINDEX {VIBIASSH, VTRIM, VIPRE, VRFSHNPOL, VTH1, VIPREOUT, VRF, VTH2, CAS, CASSH, VPL, VDCSH, VICIN, VICINSH, VICBIAS, VPH, VTH3, VRFSH};
|
||||
#define DEFAULT_DAC_VALS {1200, /* vIbiasSh */ \
|
||||
2300, /* vTrim */ \
|
||||
2150, /* vIpre */ \
|
||||
2300, /* VrfShNpol */ \
|
||||
900, /* Vth1 */ \
|
||||
1000, /* vIpreOut */ \
|
||||
900, /* Vrf */ \
|
||||
900, /* Vth2 */ \
|
||||
1474, /* cas */ \
|
||||
983, /* casSh */ \
|
||||
900, /* VPL */ \
|
||||
655, /* VdcSh */ \
|
||||
1400, /* vIcin */ \
|
||||
1400, /* vIcinSh */ \
|
||||
1200, /* vIcbias */ \
|
||||
960, /* VPH */ \
|
||||
900, /* Vth3 */ \
|
||||
1100 /* VrfSh */ \
|
||||
enum DACINDEX {CASSH, VTH2, VRFSH, VRFSHNPOL, VIPREOUT, VTH3, VTH1, VICIN, CAS, VRF, VPH, VIPRE, VIINSH, VPL, VTRIM, VDCSH};
|
||||
#define DEFAULT_DAC_VALS {1200, /* casSh */ \
|
||||
2800, /* Vth2 */ \
|
||||
1280, /* VrfSh */ \
|
||||
2800, /* VrfShNpol */ \
|
||||
1220, /* vIpreOut */ \
|
||||
2800, /* Vth3 */ \
|
||||
2800, /* Vth1 */ \
|
||||
1708, /* vIcin */ \
|
||||
1800, /* cas */ \
|
||||
1100, /* Vrf */ \
|
||||
1712, /* VPH */ \
|
||||
2624, /* vIpre */ \
|
||||
1708, /* vIinSh */ \
|
||||
1100, /* VPL */ \
|
||||
2800, /* vTrim */ \
|
||||
800 /* VdcSh */ \
|
||||
};
|
||||
|
||||
|
||||
/* Defines in the Firmware */
|
||||
#define MAX_PATTERN_LENGTH (0x8192) // maximum number of words (64bit)
|
||||
#define MAX_PATTERN_LENGTH (0x2000) // maximum number of words (64bit)
|
||||
|
||||
/* Struct Definitions */
|
||||
typedef struct udp_header_struct {
|
||||
uint32_t udp_destmac_msb;
|
||||
uint16_t udp_srcmac_msb;
|
||||
uint16_t udp_destmac_lsb;
|
||||
uint32_t udp_srcmac_lsb;
|
||||
uint8_t ip_tos;
|
||||
uint8_t ip_ihl: 4, ip_ver: 4;
|
||||
uint16_t udp_ethertype;
|
||||
uint16_t ip_identification;
|
||||
uint16_t ip_totallength;
|
||||
uint8_t ip_protocol;
|
||||
uint8_t ip_ttl;
|
||||
uint16_t ip_fragmentoffset: 13, ip_flags: 3;
|
||||
uint16_t ip_srcip_msb;
|
||||
uint16_t ip_checksum;
|
||||
uint16_t ip_destip_msb;
|
||||
uint16_t ip_srcip_lsb;
|
||||
uint16_t udp_srcport;
|
||||
uint16_t ip_destip_lsb;
|
||||
uint16_t udp_checksum;
|
||||
uint16_t udp_destport;
|
||||
} udp_header;
|
||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
Reference in New Issue
Block a user