RaspberryIO_26/Unosquare.WiringPi/BootstrapWiringPi.cs

30 lines
1.0 KiB
C#
Raw Normal View History

2019-12-06 21:09:52 +01:00
using System;
using Swan.DependencyInjection;
using Unosquare.RaspberryIO.Abstractions;
namespace Unosquare.WiringPi {
/// <summary>
/// Represents the Bootstrap class to extract resources.
/// </summary>
/// <seealso cref="Unosquare.RaspberryIO.Abstractions.IBootstrap" />
2019-12-09 17:27:40 +01:00
public class BootstrapWiringPi : IBootstrap {
private static readonly Object SyncLock = new Object();
/// <inheritdoc />
public void Bootstrap() {
lock(SyncLock) {
Resources.EmbeddedResources.ExtractAll();
_ = DependencyContainer.Current.Register<IGpioController>(new GpioController());
_ = DependencyContainer.Current.Register<ISpiBus>(new SpiBus());
_ = DependencyContainer.Current.Register<II2CBus>(new I2CBus());
_ = DependencyContainer.Current.Register<ISystemInfo>(new SystemInfo());
_ = DependencyContainer.Current.Register<ITiming>(new Timing());
_ = DependencyContainer.Current.Register<IThreading>(new Threading());
}
}
}
2019-12-04 18:57:18 +01:00
}