30 lines
1.0 KiB
C#
30 lines
1.0 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());
|
|
}
|
|
}
|
|
}
|
|
}
|