This commit is contained in:
Erik Frojdh
2019-08-08 12:02:36 +02:00
parent e7e4bf13c3
commit 1bdff2b681
3 changed files with 116 additions and 22 deletions

View File

@ -211,42 +211,95 @@ class Detector {
// Erik
/** [CTB] */
void setPatternClockControl(uint64_t word, Positions pos = {});
/** [CTB] */
Result<uint64_t> getPatternClockControl(Positions pos = {}) const;
/**
* CTB only. Sets the wait time
* @param level 0,1,2, wait level
* @param t wait time, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
* [CTB] Writes a pattern word
* @param addr address of the word
* @param word word to be written, -1 reads the addr (same as
* executing the pattern)
* @param pos detector position
* @returns actual value
*/
uint64_t setPatternWaitTime(int level, uint64_t t = -1, int detPos = -1);
void setPatternWord(int addr, uint64_t word, Positions pos = {});
/** CTB only.Sets the mask applied to every pattern. */
// TODO! Does this have side effects?
// uint64_t getPatternWord()...
/**
* [CTB] Sets the pattern or loop limits.
* @param level -1 complete pattern, 0,1,2, loop level
* @param start start address for level 0-2
* @param stop stop address for level 0-2
* @param n number of loops for level 0-2
* @param detPos -1 for all detectors in list or specific detector position
*/
void setPatternLoops(int level, int start, int stop, int n,
Positions pos = {});
/**
* [CTB] Gets the pattern loop limits
* @param level -1 complete pattern, 0,1,2, loop level
* @param pos detector positions
* @returns array of start address, stop address and number of loops
*/
Result<std::array<int, 3>> getPatternLoops(int level,
Positions pos = {}) const;
/**
* [CTB] Sets the wait address
* @param level 0,1,2, wait level
* @param addr wait address
* @param pos detector position
* @returns actual value
*/
void setPatternWaitAddr(int level, int addr, Positions pos = {});
/* [CTB] */
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
/**
* [CTB] Sets the wait time
* @param level 0,1,2, wait level
* @param t wait time
* @param pos detector position
*/
void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
/** [CTB] */
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
/** [CTB] Sets the mask applied to every pattern. */
void setPatternMask(uint64_t mask, Positions pos = {});
/** CTB only. Gets the mask applied to every pattern. */
/** [CTB] Gets the mask applied to every pattern. */
Result<uint64_t> getPatternMask(Positions pos = {});
/**
* CTB only. Sets the bitmask that the mask will be applied to for every
* [CTB] Sets the bitmask that the mask will be applied to for every
* pattern.
* @param mask mask to select bits
*/
void setPatternBitMask(uint64_t mask, Positions pos = {});
/**
* CTB only. Gets the bits that the mask will be applied to for every
* [CTB] Gets the bits that the mask will be applied to for every
* pattern
*/
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
/** CTB only. Enable or disable the LED */
/** [CTB] Enable or disable the LED */
void setLEDEnable(bool enable, Positions pos = {});
/** CTB only. Get LED enable. */
/** [CTB] Get LED enable. */
Result<bool> getLEDEnable(Positions pos = {}) const;
/**
* CTB only. Set Digital IO Delay
* [CTB] Set Digital IO Delay
* @param digital IO mask to select the pins
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
*/