/// <summary> /// Initializes a new instance of the <see cref="Mcp23008OutputBinaryPin"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="pin">The pin.</param> /// <param name="resistor">The resistor.</param> /// <param name="polarity">The polarity.</param> public Mcp23008OutputBinaryPin( Mcp23008Device connection, Mcp23008Pin pin, Mcp23008PinResistor resistor = Mcp23008PinResistor.None, Mcp23008PinPolarity polarity = Mcp23008PinPolarity.Normal) { this.connection = connection; this.pin = pin; connection.SetDirection(pin, Mcp23008PinDirection.Output); connection.SetResistor(pin, resistor); connection.SetPolarity(pin, polarity); }
/// <summary> /// Creates an input binary pin. /// </summary> /// <param name="connection">The connection.</param> /// <param name="pin">The pin.</param> /// <param name="resistor">The resistor.</param> /// <param name="polarity">The polarity.</param> /// <returns>The input pin.</returns> public static Mcp23008InputBinaryPin In(this Mcp23008Device connection, Mcp23008Pin pin, Mcp23008PinResistor resistor = Mcp23008PinResistor.None, Mcp23008PinPolarity polarity = Mcp23008PinPolarity.Normal) { return(new Mcp23008InputBinaryPin(connection, pin, resistor, polarity)); }