コード例 #1
0
        public override IAvrChannel CreateChannel()
        {
            var port      = ComPortSettings.CreateSerialPort();
            var spiMaster = new SpiMaster(port, ClkPin.CreatePin(port), MosiPin.CreatePin(port), MisoPin.CreatePin(port));

            return(new SpiMasterChannel(spiMaster, ResetPin.CreatePin(port)));
        }
コード例 #2
0
        protected override async Task ResetDevice()
        {
            ResetPin.Write(GpioPinValue.Low);
            await Task.Delay(200);

            ResetPin.Write(GpioPinValue.High);
            await Task.Delay(200);
        }
コード例 #3
0
        public void Close()
        {
            ResetPin = Pi.Gpio[_specification.RST_PIN];
            ResetPin.Write(false);

            DcPin = Pi.Gpio[_specification.DC_PIN];
            DcPin.Write(false);

            CsPin = Pi.Gpio[_specification.CS_PIN];
            CsPin.Write(false);



            /******* System.Device.Gpio Alternative *********/
            //Gpio.Write(_specification.RST_PIN, PinValue.Low);
            //Gpio.Write(_specification.DC_PIN, PinValue.Low);
            //Gpio.Write(_specification.CS_PIN, PinValue.Low);
            //Gpio.Dispose();
        }
コード例 #4
0
ファイル: BNO055.cs プロジェクト: yaksplat/FireFlySunset
        private void Reset(int RSTPin)
        {
            if (-1 == RSTPin)
            {
                WriteRegister(BNO055_SYS_TRIGGER_ADDR, 0x20, false); //do a soft reset
            }
            else  //do a hard reset
            {
                var gpio = GpioController.GetDefault();

                if (gpio != null)
                {
                    ResetPin = gpio.OpenPin(RSTPin);
                    ResetPin.Write(GpioPinValue.High);
                    ResetPin.SetDriveMode(GpioPinDriveMode.Output);

                    ResetPin.Write(GpioPinValue.Low);
                    Task.Delay(10).Wait();
                    ResetPin.Write(GpioPinValue.High);
                }
            }
            Task.Delay(650).Wait();     //wait 650ms after reset for the device to become ready, as
                                        // suggested in the datasheet
        }
コード例 #5
0
        public override IAvrChannel CreateChannel()
        {
            var port = ComPortSettings.CreateSerialPort();

            return(new SerialPortChannel(port, ResetPin.CreatePin(port)));
        }