diff --git a/.gitignore b/.gitignore index c0075d1..050b8ce 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ packages/* *.vsp *.vspx +RaspberrySharp.IO.userprefs diff --git a/Raspberry.IO.Components/Raspberry.IO.Components.csproj b/Raspberry.IO.Components/Raspberry.IO.Components.csproj index e875fb8..fa8e4a6 100644 --- a/Raspberry.IO.Components/Raspberry.IO.Components.csproj +++ b/Raspberry.IO.Components/Raspberry.IO.Components.csproj @@ -30,10 +30,6 @@ 4 - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - @@ -47,6 +43,9 @@ $(SolutionDir)packages\UnitsNet.3.46.1\lib\net35\UnitsNet.dll True + + ..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + diff --git a/Raspberry.IO.Components/packages.config b/Raspberry.IO.Components/packages.config index 5b70f76..1c15bd4 100644 --- a/Raspberry.IO.Components/packages.config +++ b/Raspberry.IO.Components/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/GpioConnectionDriver.cs b/Raspberry.IO.GeneralPurpose/GpioConnectionDriver.cs index 8cef799..97b8ab2 100644 --- a/Raspberry.IO.GeneralPurpose/GpioConnectionDriver.cs +++ b/Raspberry.IO.GeneralPurpose/GpioConnectionDriver.cs @@ -291,6 +291,7 @@ private static uint GetProcessorBaseAddress(Processor processor) { switch (processor) { + case Processor.Bcm2835: case Processor.Bcm2708: return Interop.BCM2835_GPIO_BASE; diff --git a/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs b/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs index a44bc13..4a71941 100644 --- a/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs +++ b/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs @@ -27,14 +27,23 @@ public class GpioConnectionSettings /// /// Initializes a new instance of the class. /// - public GpioConnectionSettings() + /// The driver to use. + public GpioConnectionSettings(IGpioConnectionDriver driver) { - Driver = DefaultDriver; + Driver = driver; BlinkDuration = DefaultBlinkDuration; PollInterval = DefaultPollInterval; Opened = true; } + /// + /// Initializes a new instance of the class + /// using the configured or default driver. + /// + public GpioConnectionSettings() + : this(DefaultDriver) + {} + #endregion #region Constants diff --git a/Raspberry.IO.GeneralPurpose/MemoryGpioConnectionDriver.cs b/Raspberry.IO.GeneralPurpose/MemoryGpioConnectionDriver.cs index 98af11f..8a6b528 100644 --- a/Raspberry.IO.GeneralPurpose/MemoryGpioConnectionDriver.cs +++ b/Raspberry.IO.GeneralPurpose/MemoryGpioConnectionDriver.cs @@ -247,7 +247,10 @@ private static uint GetProcessorBaseAddress(Processor processor) { switch (processor) { - case Processor.Bcm2708: + // Bcm2835 not supported + //case Processor.Bcm2835: + + case Processor.Bcm2708: return Interop.BCM2835_GPIO_BASE; case Processor.Bcm2709: diff --git a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj index cabdaa4..206acc8 100644 --- a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj +++ b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj @@ -32,13 +32,12 @@ bin\Release\Raspberry.IO.GeneralPurpose.XML - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - + + ..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + @@ -92,9 +91,6 @@ Raspberry.IO - - - + + + \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/packages.config b/Raspberry.IO.GeneralPurpose/packages.config index 0f101ec..d3a85e6 100644 --- a/Raspberry.IO.GeneralPurpose/packages.config +++ b/Raspberry.IO.GeneralPurpose/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Raspberry.IO.InterIntegratedCircuit/I2cDriver.cs b/Raspberry.IO.InterIntegratedCircuit/I2cDriver.cs index e224193..d0a9187 100644 --- a/Raspberry.IO.InterIntegratedCircuit/I2cDriver.cs +++ b/Raspberry.IO.InterIntegratedCircuit/I2cDriver.cs @@ -299,6 +299,7 @@ private static uint GetProcessorBscAddress(Processor processor) { switch (processor) { + case Processor.Bcm2835: case Processor.Bcm2708: return Interop.BCM2835_BSC1_BASE; @@ -314,6 +315,7 @@ private static uint GetProcessorGpioAddress(Processor processor) { switch (processor) { + case Processor.Bcm2835: case Processor.Bcm2708: return Interop.BCM2835_GPIO_BASE; diff --git a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj index 2d629a4..db02257 100644 --- a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj +++ b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj @@ -32,13 +32,12 @@ bin\Release\Raspberry.IO.InterIntegratedCircuit.XML - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - + + ..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + @@ -59,9 +58,6 @@ Raspberry.IO.GeneralPurpose - - - + + + \ No newline at end of file diff --git a/Raspberry.IO.InterIntegratedCircuit/packages.config b/Raspberry.IO.InterIntegratedCircuit/packages.config index 0f101ec..d3a85e6 100644 --- a/Raspberry.IO.InterIntegratedCircuit/packages.config +++ b/Raspberry.IO.InterIntegratedCircuit/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj index 13fa724..77b6a42 100644 --- a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj +++ b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj @@ -32,13 +32,12 @@ bin\Release\Raspberry.IO.SerialPeripheralInterface.XML - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - + + ..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + @@ -82,9 +81,6 @@ Raspberry.IO - - - + + + \ No newline at end of file diff --git a/Raspberry.IO.SerialPeripheralInterface/packages.config b/Raspberry.IO.SerialPeripheralInterface/packages.config index 0f101ec..d3a85e6 100644 --- a/Raspberry.IO.SerialPeripheralInterface/packages.config +++ b/Raspberry.IO.SerialPeripheralInterface/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Tests/Test.Gpio.Chaser/CommandLineExtensionMethods.cs b/Tests/Test.Gpio.Chaser/CommandLineExtensionMethods.cs index 11b8006..f2cda3f 100644 --- a/Tests/Test.Gpio.Chaser/CommandLineExtensionMethods.cs +++ b/Tests/Test.Gpio.Chaser/CommandLineExtensionMethods.cs @@ -49,14 +49,12 @@ private static IGpioConnectionDriver GetDriver(string driverName) { switch (driverName) { - case "default": - return new GpioConnectionDriver(); case "memory": return new MemoryGpioConnectionDriver(); case "file": return new FileGpioConnectionDriver(); case "": - return null; + return new GpioConnectionDriver(); default: throw new ArgumentOutOfRangeException("driverName", driverName, diff --git a/Tests/Test.Gpio.Chaser/Program.cs b/Tests/Test.Gpio.Chaser/Program.cs index 61a0dbb..4fbf178 100644 --- a/Tests/Test.Gpio.Chaser/Program.cs +++ b/Tests/Test.Gpio.Chaser/Program.cs @@ -83,7 +83,7 @@ static void Main(string[] args) }); // Create connection - var settings = new GpioConnectionSettings {Driver = driver}; + var settings = new GpioConnectionSettings (driver); using (var connection = new GpioConnection(settings, leds)) { diff --git a/Tests/Test.Gpio.DHT11/Test.Gpio.DHT11.csproj b/Tests/Test.Gpio.DHT11/Test.Gpio.DHT11.csproj index de43d32..67263cc 100644 --- a/Tests/Test.Gpio.DHT11/Test.Gpio.DHT11.csproj +++ b/Tests/Test.Gpio.DHT11/Test.Gpio.DHT11.csproj @@ -33,10 +33,6 @@ 4 - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - @@ -49,6 +45,9 @@ $(SolutionDir)packages\UnitsNet.3.46.1\lib\net35\UnitsNet.dll True + + ..\..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + diff --git a/Tests/Test.Gpio.DHT11/packages.config b/Tests/Test.Gpio.DHT11/packages.config index 67e0cf0..2cd3b40 100644 --- a/Tests/Test.Gpio.DHT11/packages.config +++ b/Tests/Test.Gpio.DHT11/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Tests/Test.Gpio.HCSR04/Test.Gpio.HCSR04.csproj b/Tests/Test.Gpio.HCSR04/Test.Gpio.HCSR04.csproj index 7709dd7..9cc4d29 100644 --- a/Tests/Test.Gpio.HCSR04/Test.Gpio.HCSR04.csproj +++ b/Tests/Test.Gpio.HCSR04/Test.Gpio.HCSR04.csproj @@ -55,16 +55,15 @@ 4 - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - $(SolutionDir)packages\UnitsNet.3.46.1\lib\net35\UnitsNet.dll True + + ..\..\packages\Raspberry.System.3B.2.1.1\lib\net40\Raspberry.System.dll + diff --git a/Tests/Test.Gpio.HCSR04/packages.config b/Tests/Test.Gpio.HCSR04/packages.config index 67e0cf0..2cd3b40 100644 --- a/Tests/Test.Gpio.HCSR04/packages.config +++ b/Tests/Test.Gpio.HCSR04/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/packages/repositories.config b/packages/repositories.config new file mode 100644 index 0000000..645067f --- /dev/null +++ b/packages/repositories.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +