public MCP23008LcdTransferProvider(I2CBus bus, ushort address, ShifterSetup setup) : base(setup) { _expander = new MCP23008Expander(bus, address); Thread.Sleep(10); // make sure bus initializes _expander.SetPinMode(setup.Enable, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.RS, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D4, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D5, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D6, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D7, MCP23008Expander.PinMode.Output); if (setup.RW != ShifterPin.None) _expander.SetPinMode(setup.RW, MCP23008Expander.PinMode.Output); if (setup.BL != ShifterPin.None) _expander.SetPinMode(setup.BL, MCP23008Expander.PinMode.Output); }
public MCP23008LcdTransferProvider(I2CBus bus, ushort address, ShifterSetup setup) : base(setup) { _expander = new MCP23008Expander(bus, address); Thread.Sleep(10); // make sure bus initializes _expander.SetPinMode(setup.Enable, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.RS, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D4, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D5, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D6, MCP23008Expander.PinMode.Output); _expander.SetPinMode(setup.D7, MCP23008Expander.PinMode.Output); if (setup.RW != ShifterPin.None) { _expander.SetPinMode(setup.RW, MCP23008Expander.PinMode.Output); } if (setup.BL != ShifterPin.None) { _expander.SetPinMode(setup.BL, MCP23008Expander.PinMode.Output); } }