Skip to content

Commit

Permalink
feat: Reset the EVR fractional synth command.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzyjamroz committed Dec 5, 2024
1 parent 7d4ce53 commit 33e63d6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions evrApp/Db/evrbase.db
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ record(ao, "$(P)Link$(s=:)Clk-SP") {
info(autosaveFields_pass0, "VAL EGU ESLO HOPR LOPR DRVH DRVL PREC")
}

record(bo,"$(P)ResetFracSynth-Cmd" ) {
field(DESC, "Reset button")
field(DTYP, "Obj Prop command")
field(OUT , "@OBJ=$(OBJ), PROP=Reset Frac Synth")
field(ZNAM, "Reset")
field(ONAM, "Reset")
}

record(ai, "$(P)Link$(s=:)Clk-I") {
field(DTYP, "Obj Prop double")
field(INP , "@OBJ=$(OBJ), PROP=Clock")
Expand Down
3 changes: 2 additions & 1 deletion evrApp/src/evr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::string EVR::versionSw() const
return MRF_VERSION;
}

std::string EVR::getCommitHash() const
std::string EVR::getCommitHash() const
{
return __COMMIT_HASH;
}
Expand Down Expand Up @@ -131,6 +131,7 @@ OBJECT_BEGIN(EVR) {
OBJECT_PROP2("Timestamp Source", &EVR::SourceTSraw, &EVR::setSourceTSraw);

OBJECT_PROP2("Clock", &EVR::clock, &EVR::clockSet);
OBJECT_PROP1("Reset Frac Synth", &EVR::resetFracSynth);

OBJECT_PROP2("Timestamp Clock", &EVR::clockTS, &EVR::clockTSSet);

Expand Down
1 change: 1 addition & 0 deletions evrApp/src/evr/evr.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class epicsShareClass EVR : public mrf::ObjectInst<EVR>
*@param clk Clock rate in Hz
*/
virtual void clockSet(double clk)=0;
virtual void resetFracSynth()=0;

//! Internal PLL Status
virtual bool pllLocked() const=0;
Expand Down
7 changes: 7 additions & 0 deletions evrMrmApp/src/drvem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,13 @@ void EVRMRM::clockSet(double freq)
}
}

void
EVRMRM::resetFracSynth()
{
epicsUInt32 oldfrac=READ32(base, FracDiv);
WRITE32(base, FracDiv, oldfrac);
}

epicsUInt16
EVRMRM::clockMode() const
{
Expand Down
3 changes: 2 additions & 1 deletion evrMrmApp/src/drvem.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct eventCode {

/**@brief Modular Register Map Event Receivers
*
*
*
*/
class epicsShareClass EVRMRM : public mrf::ObjectInst<EVRMRM, EVR>,
public MRMSPI,
Expand Down Expand Up @@ -149,6 +149,7 @@ class epicsShareClass EVRMRM : public mrf::ObjectInst<EVRMRM, EVR>,
virtual double clock() const OVERRIDE FINAL
{SCOPED_LOCK(evrLock);return eventClock;}
virtual void clockSet(double) OVERRIDE FINAL;
virtual void resetFracSynth() OVERRIDE FINAL;

epicsUInt16 clockMode() const;
void clockModeSet(epicsUInt16 mode);
Expand Down

0 comments on commit 33e63d6

Please sign in to comment.