Skip to content

Commit 0a0c866

Browse files
authored
Adding readme to new nuget, categories, regenerating manually readmed, fixing exceptions (#137)
***NO_CI***
1 parent 733b17b commit 0a0c866

File tree

19 files changed

+206
-4
lines changed

19 files changed

+206
-4
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ Most of the bindings have been migrated from [.NET IoT repository](https://githu
3939
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Hcsr501.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Hcsr501/) [HC-SR501 - PIR Motion Sensor](devices/Hcsr501)
4040
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Hmc5883l.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Hmc5883l/) [HMC5883L - 3 Axis Digital Compass](devices/Hmc5883l)
4141
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Hts221.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Hts221/) [HTS221 - Capacitive digital sensor for relative humidity and temperature](devices/Hts221)
42+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Multiplexing.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Multiplexing/) [Iot.Device.Multiplexing](devices/Multiplexing)
43+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Common.NumberHelper.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Common.NumberHelper/) [Iot.Device.NumberHelper](devices/NumberHelper)
44+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Common.WeatherHelper.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Common.WeatherHelper/) [Iot.Device.WeatherHelper](devices/WeatherHelper)
4245
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.KeyMatrix.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.KeyMatrix/) [Key Matrix](devices/KeyMatrix)
4346
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.LidarLiteV3.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.LidarLiteV3/) [LidarLiteV3 - LIDAR Time of Flight Sensor](devices/LidarLiteV3)
4447
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Lm75.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Lm75/) [LM75 - Digital Temperature Sensor](devices/Lm75)
@@ -65,12 +68,17 @@ Most of the bindings have been migrated from [.NET IoT repository](https://githu
6568
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.RadioReceiver.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.RadioReceiver/) [Radio Receiver](devices/RadioReceiver)
6669
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.RadioTransmitter.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.RadioTransmitter/) [Radio Transmitter](devices/RadioTransmitter)
6770
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Rtc.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Rtc/) [Realtime Clock](devices/Rtc)
68-
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Card.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Card/) [RFID shared elements](devices/Card)
71+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.CardRfid.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.CardRfid/) [RFID shared elements](devices/Card)
6972
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Sht3x.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Sht3x/) [SHT3x - Temperature & Humidity Sensor](devices/Sht3x)
7073
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Shtc3.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Shtc3/) [SHTC3 - Temperature & Humidity Sensor](devices/Shtc3)
7174
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Si7021.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Si7021/) [Si7021 - Temperature & Humidity Sensor](devices/Si7021)
7275
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Sn74hc595.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Sn74hc595/) [SN74HC595 -- 8-bit shift register](devices/Sn74hc595)
7376
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Ssd13xx.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Ssd13xx/) [Solomon Systech Ssd1306 OLED display](devices/Ssd13xx)
77+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Buffers.Binary.BinaryPrimitives.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Buffers.Binary.BinaryPrimitives/) [System.Buffers.Binary.BinaryPrimitives](devices/System.Buffers.Binary.BinaryPrimitives)
78+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Device.Model.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Device.Model/) [System.Device.Model - attributes for device bindings](devices/System.Device.Model)
79+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Diagnostics.Stopwatch.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Diagnostics.Stopwatch/) [System.Diagnostics.Stopwatch and DelayHelper](devices/System.Diagnostics.Stopwatch)
80+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Drawing.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Drawing/) [System.Drawing](devices/System.Drawing)
81+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Numerics.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Numerics/) [System.Numerics](devices/System.Numerics)
7482
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Vl53L0X.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Vl53L0X/) [VL53L0X - distance sensor](devices/Vl53L0X)
7583
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Yx5300.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Yx5300/) [YX5200/YX5300 - MP3 Player](devices/Yx5300)
7684
</devices>

devices/Multiplexing/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Iot.Device.Multiplexing
2+
3+
Generic helper implementation for pin multiplexing. See [ShiftRegister](../ShiftRegister) or [Sn74hc595](../Sn74hc595).

devices/Multiplexing/category.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
helper

devices/NumberHelper/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Iot.Device.NumberHelper
2+
3+
Generic helper implementation for DEC to BCD and BCD to DEC.

devices/NumberHelper/category.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
helper

devices/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Mfrc522.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Mfrc522/) [MFRC522 - RFID reader](Mfrc522)
165165
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Pn5180.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Pn5180/) [PN5180 - RFID and NFC reader](Pn5180)
166166
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Pn532.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Pn532/) [PN532 - RFID and NFC reader](Pn532)
167-
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Card.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Card/) [RFID shared elements](Card)
167+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.CardRfid.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.CardRfid/) [RFID shared elements](Card)
168168

169169
## Media libraries
170170

@@ -188,4 +188,22 @@
188188

189189
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.At24C128C.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.At24C128C/) [AT24C128C - I2C EEPROM read/write](At24C128C)
190190

191+
## Iot.Device helpers and common
192+
193+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Multiplexing.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Multiplexing/) [Iot.Device.Multiplexing](Multiplexing)
194+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Common.NumberHelper.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Common.NumberHelper/) [Iot.Device.NumberHelper](NumberHelper)
195+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.Common.WeatherHelper.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.Common.WeatherHelper/) [Iot.Device.WeatherHelper](WeatherHelper)
196+
197+
## .NET System libraries
198+
199+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Buffers.Binary.BinaryPrimitives.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Buffers.Binary.BinaryPrimitives/) [System.Buffers.Binary.BinaryPrimitives](System.Buffers.Binary.BinaryPrimitives)
200+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Device.Model.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Device.Model/) [System.Device.Model - attributes for device bindings](System.Device.Model)
201+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Diagnostics.Stopwatch.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Diagnostics.Stopwatch/) [System.Diagnostics.Stopwatch and DelayHelper](System.Diagnostics.Stopwatch)
202+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Drawing.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Drawing/) [System.Drawing](System.Drawing)
203+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Numerics.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Numerics/) [System.Numerics](System.Numerics)
204+
205+
## Lidar
206+
207+
* [![NuGet](https://img.shields.io/nuget/v/nanoFramework.IoT.Device.LidarLiteV3.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.IoT.Device.LidarLiteV3/) [LidarLiteV3 - LIDAR Time of Flight Sensor](LidarLiteV3)
208+
191209
</categorizedDevices>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# System.Buffers.Binary.BinaryPrimitives
2+
3+
`BinaryPrimitives` implementation for .NET nanoFramewok.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
system
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# System.Device.Model - attributes for device bindings
2+
3+
**This library is experimental, it may change and it may be moved to a different package in the future. Avoid taking direct dependency on it.**
4+
5+
This library provides a set of attributes which allow to annotate devices.
6+
7+
They can be used for:
8+
9+
- implementation of Azure Plug & Play
10+
- providing extra metadata about sensors (we can i.e. generate some parts of the README file or add extra checks)
11+
12+
Model is representing language independent description of the device. The attributes represent a C# mapping from C# types into the model.
13+
14+
## InterfaceAttribute
15+
16+
Every class producing telemetry or exposing some commands should put a telemetry attribute on it
17+
18+
```csharp
19+
[Interface("LPS25H - Piezoresistive pressure and thermometer sensor")]
20+
public class Lps25h : IDisposable
21+
```
22+
23+
- if class derives from class annotated with `[Interface(...)]` attribute:
24+
- class will inherit all annotations from the base class(es)
25+
- if class provides extra telemetry/command/properties it should add another InterfaceAttribute on itself
26+
- if class doesn't provide any extra annotations it should not have extra interface
27+
- display name must be provided to the InterfaceAttribute
28+
29+
## TelemetryAttribute
30+
31+
Every method or property producing telemetry should have `[Telemetry]` attribute on it.
32+
For properties providing name of the `Telemetry` is optional as it can be deduced from the property name.
33+
34+
Telemetry can be put on:
35+
36+
- properties
37+
- methods returning value but not taking any arguments
38+
- methods returning bool and taking one `out` argument
39+
- multiple `out` arguments are currently out of scope but are considered
40+
41+
```csharp
42+
[Telemetry]
43+
public Temperature Temperature => Temperature.FromDegreesCelsius(42.5f + ReadInt16(Register.Temperature) / 480f);
44+
45+
[Telemetry("Humidity")]
46+
public bool TryReadHumidity(out RelativeHumidity humidity) => TryReadHumidityCore(out humidity);
47+
48+
[Telemetry("Pressure")]
49+
public Pressure ReadPressure() { /*...*/ }
50+
```
51+
52+
- if telemetry is not producing typed unit (i.e. `Vector3`) it should have additional `displayName` provided
53+
- optional arguments are treated as if they were not there
54+
- it's not allowed to have more than one `Telemetry` attribute with the same name on the same `Interface`
55+
56+
## PropertyAttribute
57+
58+
Properties should be put on properties or methods which describe the device or change its functioning.
59+
They should only be used on things which don't change value between calls (unless it's been written to or a command has been executed on the device).
60+
Specifially reading (telemetry) from the device should not change the state of the property.
61+
62+
Usage is similar to Telemetry with some additions:
63+
64+
- they can be writable
65+
- if same name (i.e. `PowerMode`) is used on i.e. `SetPowerMode` and `ReadPowerMode` they will be merged into a single model property
66+
- they can be put on methods without return value taking one argument (it must not be be passed by reference)
67+
- it's not allowed for more than one writers or readers with the same name to be present on the same interface
68+
69+
```csharp
70+
[Property]
71+
public Sampling HumiditySampling { get { /*...*/ } set { /* ... */ } }
72+
73+
[Property("PowerMode")]
74+
public void SetPowerMode(Bme680PowerMode powerMode) { /*...*/ }
75+
[Property("PowerMode")]
76+
public Bme680PowerMode ReadPowerMode() { /*...*/ }
77+
```
78+
79+
## ComponentAttribute
80+
81+
Components represent references to other (instances) of interfaces.
82+
They can only be put on the properties, the return type of the property or its ancestor class should have an `Interface` attribute.
83+
84+
```csharp
85+
[Component]
86+
public SenseHatTemperatureAndHumidity TemperatureAndHumidity { get; private set; }
87+
88+
// ...
89+
public class SenseHatTemperatureAndHumidity : Hts221.Hts221 { /* ... */ }
90+
// ...
91+
[Interface("HTS221 - Capacitive digital sensor for relative humidity and temperature")]
92+
public class Hts221 : IDisposable { /* ... */ }
93+
```
94+
95+
## CommandAttribute
96+
97+
Commands can be something which can be executed on the device and they can be put only on methods.
98+
99+
```csharp
100+
[Command]
101+
public void PlayTone(double frequency, int duraton) { /* ... */ }
102+
[Command]
103+
protected override void SetDefaultConfiguration() { /* ... */ }
104+
```
105+
106+
## Type serialization
107+
108+
Only simple types can be serialized:
109+
110+
- enums (without Flags attribute)
111+
- values out of enum range are not permitted (i.e. bitwise combination)
112+
- UnitsNet units
113+
- basic C# types
114+
- System.Numerics.Vector2, System.Numerics.Vector3, System.Numerics.Vector4
115+
- System.Drawing.Color
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
system

0 commit comments

Comments
 (0)