mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 08:39:21 +01:00
posisibility to read adnd write registers in the front end board for eiger
This commit is contained in:
@@ -1921,4 +1921,35 @@ int Feb_Control_GetRightFPGATemp(){
|
||||
}
|
||||
|
||||
|
||||
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
|
||||
uint32_t value=0;
|
||||
if(Module_TopAddressIsValid(&modules[1])){
|
||||
if(!Feb_Interface_WriteRegister(Module_GetTopRightAddress (&modules[1]),offset, data,0, 0)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
} else {
|
||||
if(!Feb_Interface_WriteRegister(Module_GetBottomRightAddress (&modules[1]),offset, data,0, 0)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
return Feb_Control_ReadRegister(offset);
|
||||
}
|
||||
|
||||
|
||||
uint32_t Feb_Control_ReadRegister(uint32_t offset) {
|
||||
uint32_t value=0;
|
||||
if(Module_TopAddressIsValid(&modules[1])){
|
||||
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
} else {
|
||||
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -198,4 +198,6 @@ int Feb_Control_GetModuleNumber();
|
||||
int Feb_Control_GetLeftFPGATemp();
|
||||
int Feb_Control_GetRightFPGATemp();
|
||||
|
||||
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
|
||||
uint32_t Feb_Control_ReadRegister(uint32_t offset);
|
||||
#endif
|
||||
|
||||
Binary file not shown.
@@ -342,7 +342,14 @@ void setupDetector() {
|
||||
|
||||
|
||||
|
||||
/* advanced read/write reg */
|
||||
uint32_t writeRegister(uint32_t offset, uint32_t data) {
|
||||
return Feb_Control_WriteRegister(offset, data);
|
||||
}
|
||||
|
||||
uint32_t readRegister(uint32_t offset) {
|
||||
return Feb_Control_ReadRegister(offset);
|
||||
}
|
||||
|
||||
|
||||
/* set parameters - nmod, dr, roi */
|
||||
|
||||
Reference in New Issue
Block a user