/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <remarks>By default, both edges may be detected on input pins.</remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { var edgePath = Path.Combine(gpioPath, string.Format("gpio{0}/edge", (int)pin)); using (var streamWriter = new StreamWriter(edgePath, false)) streamWriter.Write(ToString(edges)); }
private static string ToString(PinDetectedEdges edges) { switch (edges) { case PinDetectedEdges.Both: return("both"); case PinDetectedEdges.Rising: return("rising"); case PinDetectedEdges.Falling: return("falling"); case PinDetectedEdges.None: return("none"); default: throw new ArgumentOutOfRangeException("edges", edges, string.Format(CultureInfo.InvariantCulture, "{0} is not a valid value for edge detection", edges)); } }
private static string ToString(PinDetectedEdges edges) { switch (edges) { case PinDetectedEdges.Both: return("both"); case PinDetectedEdges.Rising: return("rising"); case PinDetectedEdges.Falling: return("falling"); case PinDetectedEdges.None: return("none"); default: throw new ArgumentOutOfRangeException("edges"); } }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <exception cref="NotSupportedException">Edge detection is not supported by file GPIO connection driver.</exception> /// <remarks> /// By default, both edges may be detected on input pins. /// </remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { throw new NotSupportedException("Edge detection is not supported by file GPIO connection driver"); }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <exception cref="System.NotImplementedException"></exception> /// <remarks> /// By default, both edges may be detected on input pins. /// </remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { throw new NotSupportedException(); }
private static string ToString(PinDetectedEdges edges) { switch (edges) { case PinDetectedEdges.Both: return "both"; case PinDetectedEdges.Rising: return "rising"; case PinDetectedEdges.Falling: return "falling"; case PinDetectedEdges.None: return "none"; default: throw new ArgumentOutOfRangeException("edges", edges, string.Format(CultureInfo.InvariantCulture, "{0} is not a valid value for edge detection", edges)); } }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <remarks>By default, both edges may be detected on input pins.</remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { var edgePath = Path.Combine(gpioPath, string.Format("gpio{0}/edge", (int)pin)); using (var streamWriter = new StreamWriter(edgePath, false)) streamWriter.Write(ToString(edges)); }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <remarks>By default, both edges may be detected on input pins.</remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { var edgePath = Path.Combine(gpioPath, string.Format("gpio{0}/edge", (int)pin)); HelperFileStream.SaveToFile(edgePath, ToString(edges)); }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <exception cref="System.NotImplementedException"></exception> /// <remarks> /// By default, both edges may be detected on input pins. /// </remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { throw new NotSupportedException("Edge detection is not supported by file GPIO connection driver"); }
/// <summary> /// Sets the detected edges on an input pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="edges">The edges.</param> /// <exception cref="System.NotImplementedException"></exception> /// <remarks> /// By default, both edges may be detected on input pins. /// </remarks> public void SetPinDetectedEdges(ProcessorPin pin, PinDetectedEdges edges) { throw new NotSupportedException(); }
private static string ToString(PinDetectedEdges edges) { switch (edges) { case PinDetectedEdges.Both: return "both"; case PinDetectedEdges.Rising: return "rising"; case PinDetectedEdges.Falling: return "falling"; case PinDetectedEdges.None: return "none"; default: throw new ArgumentOutOfRangeException("edges"); } }