From f021c5f3f794ad6326a0922401a5f996db653727 Mon Sep 17 00:00:00 2001 From: jonnew Date: Tue, 2 Dec 2025 13:23:27 -0500 Subject: [PATCH] Match estim_device version 3 frame layout --- .../Headstage64ElectricalStimulatorDataFrame.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/OpenEphys.Onix1/Headstage64ElectricalStimulatorDataFrame.cs b/OpenEphys.Onix1/Headstage64ElectricalStimulatorDataFrame.cs index bf1ef7bf..52727309 100644 --- a/OpenEphys.Onix1/Headstage64ElectricalStimulatorDataFrame.cs +++ b/OpenEphys.Onix1/Headstage64ElectricalStimulatorDataFrame.cs @@ -23,8 +23,8 @@ public unsafe Headstage64ElectricalStimulatorDataFrame(oni.Frame frame) HubClock = payload->HubClock; Origin = (Headstage64StimulatorTriggerOrigin)(payload->DelayAndOrigin & 0x000F); Delay = (payload->DelayAndOrigin & 0xFFF0) >> 8; - RestCurrent = Headstage64ElectricalStimulator.CodeToMicroamps(payload->RestCurrent); PhaseOneCurrent = Headstage64ElectricalStimulator.CodeToMicroamps(payload->PhaseOneCurrent); + InterPhaseCurrent = Headstage64ElectricalStimulator.CodeToMicroamps(payload->RestCurrent); PhaseTwoCurrent = Headstage64ElectricalStimulator.CodeToMicroamps(payload->PhaseTwoCurrent); PhaseOneDuration = payload->PhaseOneDuration; InterPhaseInterval = payload->InterPhaseInterval; @@ -47,14 +47,14 @@ public unsafe Headstage64ElectricalStimulatorDataFrame(oni.Frame frame) public uint Delay { get; } /// - /// Gets the rest current in microamps. + /// Gets the phase one current in microamps. /// - public double RestCurrent { get; } + public double PhaseOneCurrent { get; } /// - /// Gets the phase one current in microamps. + /// Gets the inter-phase current in microamps. /// - public double PhaseOneCurrent { get; } + public double InterPhaseCurrent { get; } /// /// Gets the phase two current in microamps. @@ -95,7 +95,6 @@ public unsafe Headstage64ElectricalStimulatorDataFrame(oni.Frame frame) /// Gets the number of bursts per train. /// public uint BurstsPerTrain { get; } - } [StructLayout(LayoutKind.Sequential, Pack = 1)] @@ -103,8 +102,8 @@ unsafe struct Headstage64ElectricalStimulatorPayload { public ulong HubClock; public uint DelayAndOrigin; - public uint RestCurrent; public uint PhaseOneCurrent; + public uint RestCurrent; public uint PhaseTwoCurrent; public uint PhaseOneDuration; public uint InterPhaseInterval; @@ -124,7 +123,7 @@ public enum Headstage64StimulatorTriggerOrigin : byte /// /// Specifies the source of the trigger is unknown. /// - Unknown = 0, + Unknown = 0x0, /// /// Specifies the source of the trigger is a local Gpio pin.