Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions OpenEphys.Onix1/Headstage64ElectricalStimulatorDataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,14 +47,14 @@ public unsafe Headstage64ElectricalStimulatorDataFrame(oni.Frame frame)
public uint Delay { get; }

/// <summary>
/// Gets the rest current in microamps.
/// Gets the phase one current in microamps.
/// </summary>
public double RestCurrent { get; }
public double PhaseOneCurrent { get; }

/// <summary>
/// Gets the phase one current in microamps.
/// Gets the inter-phase current in microamps.
/// </summary>
public double PhaseOneCurrent { get; }
public double InterPhaseCurrent { get; }

/// <summary>
/// Gets the phase two current in microamps.
Expand Down Expand Up @@ -95,16 +95,15 @@ public unsafe Headstage64ElectricalStimulatorDataFrame(oni.Frame frame)
/// Gets the number of bursts per train.
/// </summary>
public uint BurstsPerTrain { get; }

}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
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;
Expand All @@ -124,7 +123,7 @@ public enum Headstage64StimulatorTriggerOrigin : byte
/// <summary>
/// Specifies the source of the trigger is unknown.
/// </summary>
Unknown = 0,
Unknown = 0x0,

/// <summary>
/// Specifies the source of the trigger is a local Gpio pin.
Expand Down