示例#1
0
 public void Disconnect()
 {
     if (ConnectedPin != null)
     {
         if (!IsRecursion)
         {
             ConnectedPin.Disconnect();
         }
     }
     ConnectedPin = null;
 }
        public FormBatteryGauge()
        {
            //ushort d = 0x7fff;
            //byte[] byteArray = BitConverter.GetBytes(d).Reverse().ToArray();

            //var p = 0.34E-3;

            InitializeComponent();
            _LTC2943Service = new LTC2943Service();
            _LTC2943Service.OnGaugeChanged += _LTC2943Service_OnGaugeChanged;
            _LTC2943Service.OnUnderCharge  += _LTC2943Service_OnUnderCharge;

            _gpioConnectionGlobalPin = new GpioConnection();
            OutputPinConfiguration opc = ProcessorPin.Gpio06.Output();

            _gpioConnectionGlobalPin.Add(opc);
            _modemResetPin = _gpioConnectionGlobalPin.Pins[ProcessorPin.Gpio06];
        }