mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
gotthard2: inejct channel done
This commit is contained in:
Binary file not shown.
@ -1074,17 +1074,18 @@ int setInjectChannel(int offset, int increment) {
|
||||
int startCh = 4; // 4 due to padding
|
||||
int ich = 0;
|
||||
for (ich = startCh + offset; ich < startCh + NCHAN; ich = ich + increment) {
|
||||
buffer[ich] = 1;
|
||||
int byteIndex = ich / 8;
|
||||
int bitIndex = ich % 8;
|
||||
buffer[byteIndex] |= (1 << (8 - 1 - bitIndex));
|
||||
}
|
||||
|
||||
for (ich = 0; ich < sizeof(buffer); ++ich) {
|
||||
printf("%d : 0x%02hhx\n", ich, buffer[ich]);
|
||||
}
|
||||
// address at the end
|
||||
buffer[16] |= (ASIC_CURRENT_INJECT_ADDR);
|
||||
|
||||
//int chipIndex = -1; // for all chips
|
||||
//if (ASIC_Driver_Set(chipIndex, sizeof(buffer), buffer) == FAIL) {
|
||||
// return FAIL;
|
||||
//}
|
||||
int chipIndex = -1; // for all chips
|
||||
if (ASIC_Driver_Set(chipIndex, sizeof(buffer), buffer) == FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
injectedChannelsOffset = offset;
|
||||
injectedChannelsIncrement = increment;
|
||||
|
@ -78,6 +78,11 @@ enum CLKINDEX {READOUT_C0, READOUT_C1, SYSTEM_C0, SYSTEM_C
|
||||
|
||||
enum PLLINDEX {READOUT_PLL, SYSTEM_PLL};
|
||||
|
||||
|
||||
/** Chip Definitions */
|
||||
#define ASIC_CURRENT_INJECT_ADDR (0x9)
|
||||
|
||||
|
||||
/* Struct Definitions */
|
||||
typedef struct udp_header_struct {
|
||||
uint32_t udp_destmac_msb;
|
||||
|
Reference in New Issue
Block a user