Ejemplo n.º 1
0
        private void GeneratePinConfiguration()
        {
            List <Pin> pinConfigs = new List <Pin>();

            for (int i = 0; i < Constants.BcmGpioPins.Length; i++)
            {
                pinConfigs.Add(PinController.GetDriver().GetPinConfig(Constants.BcmGpioPins[i]));
                Logger.Trace($"Generated pin config for '{Constants.BcmGpioPins[i]}' gpio pin.");
            }

            PinConfig = new PinConfig(pinConfigs, Core.Config.GpioConfiguration.GpioSafeMode);
        }
Ejemplo n.º 2
0
 internal GpioCore(PinsWrapper pins, Core core, bool shouldGracefullyShutdown = true)
 {
     Core = core ?? throw new ArgumentNullException(nameof(core));
     Pins = pins;
     IsGracefullShutdownRequested = shouldGracefullyShutdown;
     PinController       = new PinController(this);
     EventGenerator      = new InternalEventGenerator(Core, PinController.GetDriver());
     MorseTranslator     = new MorseRelayTranslator(this);
     BluetoothController = new BluetoothController(this);
     SoundController     = new SoundController(this);
     PinConfig           = new PinConfig();
 }