Skip to content

Commit d9e6795

Browse files
committed
added default values for SPI settings
1 parent f1923b9 commit d9e6795

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Microsoft.PowerShell.IoT/SPI/SPIData.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class SPIData : SPIDevice
2323
{
2424
public byte[] Data { get; set; }
2525
public byte[] Response { get; set; }
26-
2726
public SPIData(SpiDevice device, int busId, int chipSelectLine, int frequency,
2827
int dataBitLength, SpiMode mode, DataFlow dataFlow,
2928
PinValue chipSelectLineActiveState, byte[] data, byte[] response

src/Microsoft.PowerShell.IoT/SPI/Send/SendSPIData.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public SendSPIData()
3838
this.BusId = 0;
3939
this.ChipSelectLine = 0;
4040
this.Frequency = 500_000; // 500 KHz default speed
41+
//use the same defaults as .NET core team is using
42+
this.Mode = SpiMode.Mode0;
43+
this.DataBitLength = 8;
44+
this.DataFlow = DataFlow.MsbFirst;
45+
this.ChipSelectLineActiveState = PinValue.Low;
4146
}
4247

4348
protected override void ProcessRecord()
@@ -50,7 +55,7 @@ protected override void ProcessRecord()
5055
DataFlow = this.DataFlow,
5156
ChipSelectLineActiveState = this.ChipSelectLineActiveState
5257
};
53-
58+
5459
using (var spiDevice = SpiDevice.Create(settings))
5560
{
5661
var response = new byte[this.Data.Length];

0 commit comments

Comments
 (0)