RaspberryIO_26/Unosquare.WiringPi/BootstrapWiringPi.cs
2019-12-06 21:09:52 +01:00

33 lines
1.1 KiB
C#

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" />
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());
}
}
}
}