mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
8.0.0.rc jf: reconfigure chip when touching electron collection mode bit (#830)
* jf: if bit 14 in reg 0x5d (electron mode collection bit) is changed, configure chip if v1.1 and powered on. so touch writeregister (setbit/clearbit also calls write register in the end). replace when electroncollectionmode command introduced
This commit is contained in:
parent
601249cc71
commit
e5ee27dbfa
Binary file not shown.
@ -15,6 +15,11 @@ u_int32_t *csp0base = 0;
|
||||
#define CSP0 0x20200000
|
||||
#define MEM_SIZE 0x100000
|
||||
|
||||
#ifdef JUNGFRAUD
|
||||
|
||||
extern void configureChip();
|
||||
#endif
|
||||
|
||||
void bus_w16(u_int32_t offset, u_int16_t data) {
|
||||
volatile u_int16_t *ptr1;
|
||||
ptr1 = (u_int16_t *)(csp0base + offset / 2);
|
||||
@ -80,7 +85,21 @@ u_int32_t readRegister(u_int32_t offset) {
|
||||
}
|
||||
|
||||
u_int32_t writeRegister(u_int32_t offset, u_int32_t data) {
|
||||
// if electron mode bit touched
|
||||
#ifdef JUNGFRAUD
|
||||
int electronCollectionModeChange = 0;
|
||||
if ((offset << MEM_MAP_SHIFT) == DAQ_REG) {
|
||||
if ((readRegister(offset) ^ data) & DAQ_ELCTRN_CLLCTN_MDE_MSK) {
|
||||
electronCollectionModeChange = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
bus_w(offset << MEM_MAP_SHIFT, data);
|
||||
#ifdef JUNGFRAUD
|
||||
if (electronCollectionModeChange) {
|
||||
configureChip();
|
||||
}
|
||||
#endif
|
||||
return readRegister(offset);
|
||||
}
|
||||
|
||||
|
@ -10,4 +10,4 @@
|
||||
#define APIMYTHEN3 "developer 0x230922"
|
||||
#define APIMOENCH "developer 0x230922"
|
||||
#define APIEIGER "developer 0x230922"
|
||||
#define APIJUNGFRAU "developer 0x231013"
|
||||
#define APIJUNGFRAU "developer 0x231018"
|
||||
|
Loading…
x
Reference in New Issue
Block a user