10 #define SERIAL_DATA_BIT(idx) (1 << (0+4*idx)) 11 #define SERIAL_CLOCK_BIT(idx) (1 << (1+4*idx)) 12 #define TRANSFER_LATCH_CLOCK_BIT(idx) (1 << (2+4*idx)) 13 #define OUTPUT_DISABLE_BIT(idx) (1 << (3+4*idx)) 30 if(val > 8.686)val = 8.686;
31 setDelay(
true,
false, (epicsUInt16)(val * 1023.0 / 8.686), 0);
36 return (dly0_ * 8.686 / 1023.0);
42 if(val > 8.686)val = 8.686;
43 setDelay(
false,
true, 0, (epicsUInt16)(val * 1023.0 / 8.686));
48 return (dly1_ * 8.686 / 1023.0);
53 epicsGuard<epicsMutex> g(gpio_->
lock_);
71 void DelayModule::setGpioOutput(){
72 epicsUInt32 direction;
80 void DelayModule::enable(){
89 void DelayModule::disable(){
98 void DelayModule::setDelay(
bool output0,
bool output1, epicsUInt16 value0, epicsUInt16 value1){
99 epicsUInt32 latch=0,
delay=0;
102 if(output0 | output1){
104 epicsGuard<epicsMutex> g(gpio_->
lock_);
113 delay |= ((dly1_ & 0x0ff) << 16) | (dly1_ & 0x300);
114 delay |= ((value0 & 0x00f) << 12) | (value0 >> 4);
119 delay |= ((dly0_ & 0x00f) << 12) | (dly0_ >> 4);
120 delay |= ((value1 & 0x0ff) << 16) | (value1 & 0x300);
127 pushData(
delay | latch);
132 void DelayModule::pushData(epicsUInt32 data){
133 epicsUInt32 bit, gpio;
139 for( i = 24; i; i-- ){
void setOutput(epicsUInt32)
void setDirection(epicsUInt32)
virtual void setState(bool enabled) OVERRIDE FINAL
setState Sets the enabled state of the delay module. If disabled, the module will output logic low on...
Modular Register Map Event Receivers.
virtual void setDelay1(double val) OVERRIDE FINAL
setDelay1 Sets the delay of the output 1 in the module
#define OUTPUT_DISABLE_BIT(idx)
epicsUInt32 getDirection()
virtual double getDelay0() const OVERRIDE FINAL
getDelay0 Returns the last set delay for the output 0 in the module
DelayModule(const std::string &, EVRMRM *, unsigned int)
#define TRANSFER_LATCH_CLOCK_BIT(idx)
virtual void setDelay0(double val) OVERRIDE FINAL
setDelay0 Sets the delay of the output 0 in the module
virtual double getDelay1() const OVERRIDE FINAL
getDelay1R eturns the last set delay for the output 1 in the module
virtual bool enabled() const OVERRIDE FINAL
enabled Checks if the module is enabled or not.
#define SERIAL_CLOCK_BIT(idx)
#define SERIAL_DATA_BIT(idx)