RaspberryIO_26/Unosquare.WiringPi/BootstrapWiringPi.cs
2019-12-04 18:57:18 +01:00

31 lines
1.1 KiB
C#

namespace Unosquare.WiringPi
{
using RaspberryIO.Abstractions;
using Swan.DependencyInjection;
/// <summary>
/// Represents the Bootstrap class to extract resources.
/// </summary>
/// <seealso cref="Unosquare.RaspberryIO.Abstractions.IBootstrap" />
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());
}
}
}
}