示例#1
0
        public Hal()
        {
            _battery             = new BatteryDriver();
            _com                 = new ComDriver();
            _serial              = new SerialDriver();
            _spi                 = new SpiDriver();
            _time                = new TimeDriver();
            _lcd                 = new LcdDriver();
            _gpio                = new GpioDriver();
            _events              = new EventsDriver();
            _usb                 = new UsbDriver();
            _memory              = new MemoryDriver();
            _sockets             = new SocketsDriver();
            _ssl                 = new SslDriver((SocketsDriver)_sockets);
            _i2c                 = new I2cDriver();
            _touchPanel          = new TouchPanelDriver();
            _fileSystem          = new FSDriver();
            _blockStorageDevices = new BlockStorageDriver();
            _watchdog            = new WatchdogDriver();

            _session           = new SessionDriver();
            _encryption        = new EncryptionDriver();
            _digest            = new DigestDriver();
            _signature         = new SignatureDriver();
            _keyManagement     = new KeyManagementDriver();
            _cryptokiObjectMgr = new CryptokiObjectMgrDriver();
            _random            = new RandomDriver();

            _updateProvider   = new UpdateProvider();
            _updateStorage    = new UpdateStorageProvider();
            _updateBackup     = new UpdateBackupProvider();
            _updateValidation = new UpdateValidationProvider();
        }
示例#2
0
        public static async Task <OutputPort> Create(int pin, InitialValue initial, IGpioDriver driver = null)
        {
            var port = await Create(pin, driver ?? new FileDriver());

            await port.SetDirection(initial == InitialValue.High?GpioDirection.High : GpioDirection.Low);

            return(port);
        }
示例#3
0
        public static async Task <OutputPort> Create(int pin, IGpioDriver driver = null)
        {
            var port = new OutputPort(pin, driver ?? new FileDriver());

            // If port already exists delete and recreate it
            if (Directory.Exists(GpioPath.Path(pin)))
            {
                await port.UnAssignPin();
            }
            await port.AssignPin();

            await port.SetDirection(GpioDirection.Out);

            return(port);
        }
示例#4
0
        public static async Task <InputPort> Create(int pin, GpioEdge edge, IGpioDriver driver = null)
        {
            var port = new InputPort(pin, driver ?? new FileDriver());

            // If port already exists delete and recreate it
            if (Directory.Exists(GpioPath.Path(pin)))
            {
                await port.UnAssignPin();
            }
            await port.AssignPin();

            await port.SetDirection();

            await port.SetEdge(edge);

            port.SetupInterrupt();

            return(port);
        }
示例#5
0
文件: Hal.cs 项目: yisea123/NETMF-LPC
 public Hal()
 {
     _battery             = new BatteryDriver();
     _com                 = new ComDriver();
     _serial              = new SerialDriver();
     _spi                 = new SpiDriver();
     _time                = new TimeDriver();
     _lcd                 = new LcdDriver();
     _gpio                = new GpioDriver();
     _events              = new EventsDriver();
     _usb                 = new UsbDriver();
     _memory              = new MemoryDriver();
     _sockets             = new SocketsDriver();
     _ssl                 = new SslDriver((SocketsDriver)_sockets);
     _i2c                 = new I2cDriver();
     _touchPanel          = new TouchPanelDriver();
     _fileSystem          = new FSDriver();
     _blockStorageDevices = new BlockStorageDriver();
     _watchdog            = new WatchdogDriver();
 }
示例#6
0
 private OutputPort(int pin, IGpioDriver driver)
 {
     _driver = driver;
     _pin    = pin.ToString(CultureInfo.InvariantCulture);
 }
示例#7
0
        public static async Task <GpioTrigger> Create(IGpioDriver driver, int gpioPin)
        {
            var port = await InputPort.Create(gpioPin, GpioEdge.Both, driver);

            return(new GpioTrigger(port));
        }
示例#8
0
        public static async Task <GpioSwitch> Create(IGpioDriver driver, int gpioPin, bool lowIsOff, IObservable <bool> onOffTrigger)
        {
            var port = await OutputPort.Create(gpioPin, lowIsOff?OutputPort.InitialValue.Low : OutputPort.InitialValue.High, driver);

            return(new GpioSwitch(port, onOffTrigger));
        }