M3readout (#209)

* m3: readout command
This commit is contained in:
Dhanya Thattil
2020-10-26 16:13:48 +01:00
committed by GitHub
parent 91ad7b0594
commit 47018b61cd
14 changed files with 106 additions and 7 deletions

View File

@ -132,7 +132,7 @@
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
#define CONTROL_STRT_PATTERN_OFST (2)
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
#define CONTROL_STRT_READOUT_OFST (3) // not connected in software yet
#define CONTROL_STRT_READOUT_OFST (3)
#define CONTROL_STRT_READOUT_MSK (0x00000001 << CONTROL_STRT_READOUT_OFST)
#define CONTROL_STRT_SW_TRIGGER_OFST (4)
#define CONTROL_STRT_SW_TRIGGER_MSK (0x00000001 << CONTROL_STRT_SW_TRIGGER_OFST)

View File

@ -2407,6 +2407,22 @@ int softwareTrigger() {
return OK;
}
int startReadOut() {
LOG(logINFOBLUE, ("Starting Readout\n"));
#ifdef VIRTUAL
// cannot set #frames and exptiem temporarily to 1 and 0,
// because have to set it back after readout (but this is non blocking)
return startStateMachine();
#endif
cleanFifos();
// start readout
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_READOUT_MSK);
LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
return OK;
}
enum runStatus getRunStatus() {
LOG(logDEBUG1, ("Getting status\n"));
// scan error or running