/// <summary> /// Sets the down source for the counter as a <see cref="AnalogTrigger"/>. /// </summary> /// <param name="analogTrigger">The AnalogTrigger object that is used for the down source.</param> /// <param name="triggerType">The anlog trigger output that will trigger the counter.</param> public void SetDownSource(AnalogTrigger analogTrigger, AnalogTriggerType triggerType) { if (analogTrigger == null) { throw new ArgumentNullException(nameof(analogTrigger), "Analog Trigger given was null"); } SetDownSource(analogTrigger.CreateOutput(triggerType)); m_allocatedDownSource = true; }
/// <summary> /// Create an object that represents one of the four outputs from an analog trigger. /// </summary> /// <remarks>Because this class derives from DigitalSource, it can be passed into /// routing functions for Counter, Encoder, etc.</remarks> /// <param name="trigger">The trigger for which this is an output.</param> /// <param name="outputType">An enum that specifies the output on the trigger to represent.</param> public AnalogTriggerOutput(AnalogTrigger trigger, AnalogTriggerType outputType) { if (trigger == null) throw new ArgumentNullException(nameof(trigger), "Analog Trigger given was null"); m_trigger = trigger; m_outputType = outputType; HAL.Base.HAL.Report(ResourceType.kResourceType_AnalogTriggerOutput, (byte)trigger.Index, (byte)outputType); }
/// <summary> /// Create an object that represents one of the four outputs from an analog trigger. /// </summary> /// <remarks>Because this class derives from DigitalSource, it can be passed into /// routing functions for Counter, Encoder, etc.</remarks> /// <param name="trigger">The trigger for which this is an output.</param> /// <param name="outputType">An enum that specifies the output on the trigger to represent.</param> public AnalogTriggerOutput(AnalogTrigger trigger, AnalogTriggerType outputType) { if (trigger == null) throw new NullReferenceException("Analog Trigger give was null"); m_trigger = trigger; m_outputType = outputType; HAL.Report(ResourceType.kResourceType_AnalogTriggerOutput, (byte) trigger.Index, (byte) outputType); }
/// <summary> /// Create an object that represents one of the four outputs from an analog trigger. /// </summary> /// <remarks>Because this class derives from DigitalSource, it can be passed into /// routing functions for Counter, Encoder, etc.</remarks> /// <param name="trigger">The trigger for which this is an output.</param> /// <param name="outputType">An enum that specifies the output on the trigger to represent.</param> public AnalogTriggerOutput(AnalogTrigger trigger, AnalogTriggerType outputType) { if (trigger == null) { throw new ArgumentNullException(nameof(trigger), "Analog Trigger given was null"); } m_trigger = trigger; m_outputType = outputType; HAL.Base.HAL.Report(ResourceType.kResourceType_AnalogTriggerOutput, (byte)trigger.Index, (byte)outputType); }
public void TestAnalogTriggerOutputRoutings(AnalogTriggerType type) { using (AnalogTrigger trigger = new AnalogTrigger(0)) { using (AnalogTriggerOutput output = new AnalogTriggerOutput(trigger, type)) { Assert.That(output.AnalogTriggerForRouting, Is.True); int routingChannel = (trigger.Index << 2) + (int)type; byte routingModule = (byte)(trigger.Index >> 2); Assert.That(output.ChannelForRouting, Is.EqualTo(routingChannel)); Assert.That(output.ModuleForRouting, Is.EqualTo(routingModule)); } } }
public static void SetExternalTrigger(int handle, int digitalSourceHandle, AnalogTriggerType analogTriggerType, int rising, int falling) { lowLevel.HAL_SetDMAExternalTrigger(handle, digitalSourceHandle, analogTriggerType, rising, falling); }
public static bool GetOutput(int analogTriggerHandle, AnalogTriggerType type) { return(lowLevel.HAL_GetAnalogTriggerOutput(analogTriggerHandle, type) != 0); }
public static bool getAnalogTriggerOutput(IntPtr analog_trigger_pointer, AnalogTriggerType type, ref int status) { if (type == AnalogTriggerType.InWindow) return Base.HALAnalog.GetAnalogTriggerInWindow(analog_trigger_pointer, ref status); if (type == AnalogTriggerType.State) return Base.HALAnalog.GetAnalogTriggerTriggerState(analog_trigger_pointer, ref status); else { status = HALErrorConstants.ANALOG_TRIGGER_PULSE_OUTPUT_ERROR; return false; } }
public void SetDownSource(AnalogTrigger analogTrigger, AnalogTriggerType triggerType) { if (analogTrigger == null) throw new NullReferenceException("Analog Trigger given was null"); SetDownSource(analogTrigger.CreateOutput(triggerType)); m_allocatedDownSource = true; }
public static void SetDownSource(int counterHandle, int digitalSourceHandle, AnalogTriggerType analogTriggerType) { lowLevel.HAL_SetCounterDownSource(counterHandle, digitalSourceHandle, analogTriggerType); }
/// <summary> /// Gets the trigger value. /// </summary> /// <param name="type">The type.</param> /// <param name="status">The status.</param> /// <returns></returns> public bool GetTriggerValue(AnalogTriggerType type, ref int status) { return SimulatorHAL.HALAnalog.getAnalogTriggerOutput((IntPtr) TriggerPointer, type, ref status); }
public static int Initialize(int digitalSourceHandleA, AnalogTriggerType analogTriggerTypeA, int digitalSourceHandleB, AnalogTriggerType analogTriggerTypeB, int reverseDirection, EncoderEncodingType encodingType) { return(lowLevel.HAL_InitializeEncoder(digitalSourceHandleA, analogTriggerTypeA, digitalSourceHandleB, analogTriggerTypeB, reverseDirection, encodingType)); }
public static void SetIndexSource(int encoderHandle, int digitalSourceHandle, AnalogTriggerType analogTriggerType, EncoderIndexingType type) { lowLevel.HAL_SetEncoderIndexSource(encoderHandle, digitalSourceHandle, analogTriggerType, type); }
/// <summary> /// Creates an <see cref="AnalogTriggerOutput">analog trigger output</see>. /// </summary> /// <param name="type">The type of object to create.</param> /// <returns>A pointer to a new <see cref="AnalogTriggerOutput"/></returns> public AnalogTriggerOutput CreateOutput(AnalogTriggerType type) { return(new AnalogTriggerOutput(this, type)); }
public static void StartAutoTrigger(SPIPort port, int digitalSourceHandle, AnalogTriggerType analogTriggerType, int triggerRising, int triggerFalling) { lowLevel.HAL_StartSPIAutoTrigger(port, digitalSourceHandle, analogTriggerType, triggerRising, triggerFalling); }
/// <summary> /// Creates an <see cref="AnalogTriggerOutput">analog trigger output</see>. /// </summary> /// <param name="type">The type of object to create.</param> /// <returns>A pointer to a new <see cref="AnalogTriggerOutput"/></returns> public AnalogTriggerOutput CreateOutput(AnalogTriggerType type) { return new AnalogTriggerOutput(this, type); }
public static void Request(int interruptHandle, int digitalSourceHandle, AnalogTriggerType analogTriggerType) { lowLevel.HAL_RequestInterrupts(interruptHandle, digitalSourceHandle, analogTriggerType); }
/// <summary> /// Sets the down source for the counter as a <see cref="AnalogTrigger"/>. /// </summary> /// <param name="analogTrigger">The AnalogTrigger object that is used for the down source.</param> /// <param name="triggerType">The anlog trigger output that will trigger the counter.</param> public void SetDownSource(AnalogTrigger analogTrigger, AnalogTriggerType triggerType) { if (analogTrigger == null) throw new ArgumentNullException(nameof(analogTrigger), "Analog Trigger given was null"); SetDownSource(analogTrigger.CreateOutput(triggerType)); m_allocatedDownSource = true; }
public static int Initialize(int digitalSourceHandle, AnalogTriggerType triggerType) { return(lowLevel.HAL_InitializeDutyCycle(digitalSourceHandle, triggerType)); }
public static extern bool getAnalogTriggerOutput(IntPtr analog_trigger_pointer, AnalogTriggerType type, ref int status);