Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit 44bae93

Browse files
update readme
2 parents ba857ab + 32ebbd3 commit 44bae93

File tree

4 files changed

+102
-11
lines changed

4 files changed

+102
-11
lines changed

README.md

+22-9
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,39 @@ For example, a cmdlet stack to turn on a light bulb might be:
2828

2929
To see some examples of modules built on top of PowerShell IoT, see the [modules folder](/modules).
3030

31+
### Supported platforms
32+
33+
#### Supported devices
34+
35+
* Raspberry Pi 3
36+
37+
#### Supported operating systems
38+
39+
* Raspbian Trusty
40+
41+
### Documentation & Examples
42+
43+
Please see our [docs folder here](/docs) for an API reference, pin layout and other docs. For examples, checkout our [examples folder](/Examples).
44+
3145
### Dependencies
3246

3347
This project relies on [RaspberryIO](https://github.com/unosquare/raspberryio).
3448
It's an easy-to-use .NET library for interacting with Raspberry Pi's IO functionality.
3549
RaspberryIO is built on [Wiring Pi](http://wiringpi.com/) -
3650
a pin based GPIO access library written in C.
3751

38-
### Supported devices
39-
40-
* Raspberry Pi 3
41-
42-
### Supported operating systems
52+
## Installation
4353

44-
* Raspbian Trusty
54+
### PowerShell Gallery & GitHub releases
4555

46-
## Installation
56+
_Installation from the PowerShell Gallery and download from GitHub releases coming soon._
4757

48-
### PowerShell Gallery
58+
### AppVeyor
4959

50-
_Installation from the PowerShell Gallery coming soon._
60+
You can download the latest CI build from our [AppVeyor build here](https://ci.appveyor.com/project/PowerShell/powershell-iot).
61+
Go to the latest build, click on either of the images, then click on the artifacts tab.
62+
From there, you can download a zip of the latest CI build.
63+
>>>>>>> 32ebbd385a46f29eea44208d3f5f94234f73e1c3
5164
5265
### From Source
5366

appveyor.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
image:
2+
- Visual Studio 2015
3+
- Ubuntu
4+
15
build: off
26

37
# Ignore testing a commit if only the README.md file changed
@@ -15,5 +19,5 @@ test_script:
1519
- pwsh: Install-Module InvokeBuild -Force -Scope CurrentUser; Invoke-Build
1620

1721
artifacts:
18-
- path: out\PSIoT
19-
name: PSIoT
22+
- path: out\Microsoft.PowerShell.IoT
23+
name: Microsoft.PowerShell.IoT

src/Microsoft.PowerShell.IoT/Microsoft.PowerShell.IoT.cs

+63
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ public GpioPinData(int id, SignalLevel value, Unosquare.RaspberryIO.Gpio.GpioPin
8383
this.Value = value;
8484
this.PinInfo = pinInfo;
8585
}
86+
}
87+
88+
public class SPIData
89+
{
90+
public uint Channel { get; set; }
91+
public uint Frequency { get; set; }
92+
public byte[] Data { get; set; }
93+
public byte[] Responce { get; set; }
94+
95+
public SPIData(uint channel, uint frequency, byte[] data, byte[] responce)
96+
{
97+
this.Channel = channel;
98+
this.Frequency = frequency;
99+
this.Data = data;
100+
this.Responce = responce;
101+
}
86102
}
87103

88104
[Cmdlet(VerbsCommon.Get, "I2CDevice")]
@@ -276,4 +292,51 @@ protected override void ProcessRecord()
276292
}
277293
}
278294
}
295+
296+
[Cmdlet(VerbsCommunications.Send, "SPIData")]
297+
public class SendSPIData : Cmdlet
298+
{
299+
[Parameter(Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, Position = 0)]
300+
public byte[] Data { get; set; }
301+
302+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 1)]
303+
public uint Channel { get; set; }
304+
305+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 2)]
306+
public uint Frequency { get; set; }
307+
308+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)]
309+
public SwitchParameter Raw { get; set; }
310+
311+
public SendSPIData()
312+
{
313+
this.Channel = 0;
314+
this.Frequency = Unosquare.RaspberryIO.Gpio.SpiChannel.MinFrequency;
315+
}
316+
317+
protected override void ProcessRecord()
318+
{
319+
var spiChannel = Unosquare.RaspberryIO.Pi.Spi.Channel0;
320+
if (this.Channel == 1)
321+
{
322+
spiChannel = Unosquare.RaspberryIO.Pi.Spi.Channel1;
323+
Unosquare.RaspberryIO.Pi.Spi.Channel1Frequency = (int)this.Frequency;
324+
}
325+
else
326+
{
327+
Unosquare.RaspberryIO.Pi.Spi.Channel0Frequency = (int)this.Frequency;
328+
};
329+
330+
var responce = spiChannel.SendReceive(this.Data);
331+
if (this.Raw)
332+
{
333+
WriteObject(responce);
334+
}
335+
else
336+
{
337+
SPIData spiData = new SPIData(this.Channel, this.Frequency, this.Data, responce);
338+
WriteObject(spiData);
339+
}
340+
}
341+
}
279342
}

vsts.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resources:
2+
- repo: self
3+
queue:
4+
name: PowerShell IoT
5+
demands: DotNetFramework
6+
steps:
7+
- task: PowerShell@1
8+
displayName: Run Build
9+
inputs:
10+
scriptType: inlineScript
11+
inlineScript: pwsh -c ./build.ps1

0 commit comments

Comments
 (0)