public static LedDriver Create(LedDriverSettings settings) { settings.ThrowIfNull(nameof(settings)); var controller = new GpioControllerWrapper(new GpioController(PinNumberingScheme.Logical)); var driver = new LedDriver(controller, settings); driver.ownsController = true; return(driver); }
public static void WriteByte(this LedDriver driver, byte value) { for (int i = 0; i < 8; i++) { int bit = value & 0x80; value <<= 1; driver.WriteBit(bit != 0); } }
public static void WriteBit(this LedDriver driver, bool value) { driver.WriteBit(value ? PinValue.High : PinValue.Low); }
public DisplayDriver(LedDriver ledDriver) { ledDriver.ThrowIfNull(nameof(ledDriver)); LedDriver = ledDriver; }