Skip to content

Commit

Permalink
Add pulser software set/reset
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanMaticPratnemer authored and jerzyjamroz committed Oct 12, 2023
1 parent 57cee32 commit f320283
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions evrApp/Db/evrpulser.db
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ record(bo, "$(PN)Ena-Sel") {
info(autosaveFields_pass0, "VAL")
}

# Pulser Soft set/reset
record(bo, "$(PN)Set-Cmd") {
field(DESC, "Soft set")
field(DTYP, "Obj Prop command")
field(OUT , "@OBJ=$(OBJ), PROP=SoftSet")
}

record(bo, "$(PN)Reset-Cmd") {
field(DESC, "Soft reset")
field(DTYP, "Obj Prop command")
field(OUT , "@OBJ=$(OBJ), PROP=SoftReset")
}

# Reverses the output polarity. When set, changes the Pulse Generator's
# output from normally low to normally high.
#
Expand Down
3 changes: 3 additions & 0 deletions evrApp/src/evr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2010 Brookhaven Science Associates, as Operator of
* Brookhaven National Laboratory.
* Copyright (c) 2015 Paul Scherrer Institute (PSI), Villigen, Switzerland
* Copyright (c) 2022 Cosylab d.d.
* mrfioc2 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand Down Expand Up @@ -176,6 +177,8 @@ OBJECT_BEGIN(Output) {


OBJECT_BEGIN(Pulser) {
OBJECT_PROP1("SoftSet", &Pulser::softSet);
OBJECT_PROP1("SoftReset", &Pulser::softReset);

OBJECT_PROP2("Delay", &Pulser::delay, &Pulser::setDelay);
OBJECT_PROP2("Delay", &Pulser::delayRaw, &Pulser::setDelayRaw);
Expand Down
8 changes: 8 additions & 0 deletions evrApp/src/evr/pulser.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven Science Associates, as Operator of
* Brookhaven National Laboratory.
* Copyright (c) 2022 Cosylab d.d.
* mrfioc2 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand Down Expand Up @@ -48,6 +49,13 @@ class epicsShareClass Pulser : public mrf::ObjectInst<Pulser>
virtual void enable(bool)=0;
/*@}*/

/**\defgroup soft Soft set/reset pulser.
*/
/*@{*/
virtual void softSet()=0;
virtual void softReset()=0;
/*@}*/

/**\defgroup dly Set triggered mode delay length.
*
* Units of event clock period.
Expand Down
4 changes: 4 additions & 0 deletions evrFRIBApp/src/evr_frib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* This software is Copyright by the Board of Trustees of Michigan
* State University (c) Copyright 2017.
* Copyright (c) 2022 Cosylab d.d.
*
* Author: Michael Davidsaver <[email protected]>
*/
Expand Down Expand Up @@ -61,6 +62,9 @@ struct PulserFRIB : public Pulser
virtual bool enabled() const { return true;}
virtual void enable(bool) {}

virtual void softSet() {}
virtual void softReset() {}

virtual void setDelayRaw(epicsUInt32);
virtual void setDelay(double);
virtual epicsUInt32 delayRaw() const;
Expand Down
13 changes: 13 additions & 0 deletions evrMrmApp/src/drvemPulser.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven Science Associates, as Operator of
* Brookhaven National Laboratory.
* Copyright (c) 2022 Cosylab d.d.
* mrfioc2 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand Down Expand Up @@ -56,6 +57,18 @@ MRMPulser::enable(bool s)
PulserCtrl_ena|PulserCtrl_mtrg|PulserCtrl_mset|PulserCtrl_mrst);
}

void
MRMPulser::softSet()
{
BITSET(NAT,32,owner.base, PulserCtrl(id), PulserCtrl_sset);
}

void
MRMPulser::softReset()
{
BITSET(NAT,32,owner.base, PulserCtrl(id), PulserCtrl_srst);
}

void
MRMPulser::setDelayRaw(epicsUInt32 v)
{
Expand Down
4 changes: 4 additions & 0 deletions evrMrmApp/src/drvemPulser.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven Science Associates, as Operator of
* Brookhaven National Laboratory.
* Copyright (c) 2022 Cosylab d.d.
* mrfioc2 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand Down Expand Up @@ -33,6 +34,9 @@ class MRMPulser : public mrf::ObjectInst<MRMPulser, Pulser>
virtual bool enabled() const OVERRIDE FINAL;
virtual void enable(bool) OVERRIDE FINAL;

virtual void softSet() OVERRIDE FINAL;
virtual void softReset() OVERRIDE FINAL;

virtual void setDelayRaw(epicsUInt32) OVERRIDE FINAL;
virtual void setDelay(double) OVERRIDE FINAL;
virtual epicsUInt32 delayRaw() const OVERRIDE FINAL;
Expand Down

0 comments on commit f320283

Please sign in to comment.