Skip to content

Commit 81adfc8

Browse files
authored
Migrated Tsl256x to nano (#189)
1 parent 6cc8aef commit 81adfc8

26 files changed

+117
-73
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/devices_generated/Tsl256x/Properties/AssemblyInfo.cs devices/Tsl256x/Properties/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
[assembly: AssemblyTitle("Iot.Device.Tsl256x")]

src/devices_generated/Tsl256x/README.md devices/Tsl256x/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ clears it.
1212

1313
- TSL256x [datasheet](https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf)
1414

15+
## Board
16+
17+
![image](./Tsl256xBoard.png)
18+
1519
## Usage
1620

1721
### Basic usage
File renamed without changes.
File renamed without changes.

src/devices_generated/Tsl256x/Tsl256x.nfproj devices/Tsl256x/Tsl256x.nfproj

+16-10
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,29 @@
2020
</PropertyGroup>
2121
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
2222
<ItemGroup>
23-
<Reference Include="mscorlib">
24-
<HintPath>packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
23+
<Reference Include="mscorlib, Version=1.10.5.4, Culture=neutral, PublicKeyToken=c07d481e9758c731">
24+
<HintPath>packages\nanoFramework.CoreLibrary.1.10.5\lib\mscorlib.dll</HintPath>
2525
<Private>True</Private>
26+
<SpecificVersion>True</SpecificVersion>
2627
</Reference>
2728
<Reference Include="System.Device.I2c">
28-
<HintPath>packages\nanoFramework.System.Device.I2c.1.0.1-preview.33\lib\System.Device.I2c.dll</HintPath>
29+
<HintPath>packages\nanoFramework.System.Device.I2c.1.0.1\lib\System.Device.I2c.dll</HintPath>
2930
<Private>True</Private>
3031
</Reference>
3132
<Reference Include="UnitsNet.Illuminance">
32-
<HintPath>packages\UnitsNet.nanoFramework.Illuminance.4.92.0\lib\UnitsNet.Illuminance.dll</HintPath>
33+
<HintPath>packages\UnitsNet.nanoFramework.Illuminance.4.102.0\lib\UnitsNet.Illuminance.dll</HintPath>
3334
<Private>True</Private>
3435
</Reference>
3536
<Reference Include="System.Math">
36-
<HintPath>packages\nanoFramework.System.Math.1.4.0-preview.7\lib\System.Math.dll</HintPath>
37+
<HintPath>packages\nanoFramework.System.Math.1.4.1\lib\System.Math.dll</HintPath>
38+
<Private>True</Private>
39+
</Reference>
40+
<Reference Include="System.Buffers.Binary.BinaryPrimitives">
41+
<HintPath>packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.0.160\lib\System.Buffers.Binary.dll</HintPath>
42+
<Private>True</Private>
43+
</Reference>
44+
<Reference Include="System.Device.Model">
45+
<HintPath>packages\nanoFramework.System.Device.Model.1.0.176\lib\System.Device.Model.dll</HintPath>
3746
<Private>True</Private>
3847
</Reference>
3948
</ItemGroup>
@@ -47,19 +56,16 @@
4756
<None Include="*.md" />
4857
</ItemGroup>
4958
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
50-
<Import Project="..\..src\BinaryPrimitives\BinaryPrimitives.projitems" Label="Shared" />
51-
<Import Project="..\..\src\System.Device.Model\System.Device.Model.projitems" Label="Shared" />
52-
<Import Project="..\..\src\System.Runtime.CompilerService\System.Runtime.CompilerService.projitems" Label="Shared" />
5359
<ProjectExtensions>
5460
<ProjectCapabilities>
5561
<ProjectConfigurationsDeclaredAsItems />
5662
</ProjectCapabilities>
5763
</ProjectExtensions>
58-
<Import Project="packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets" Condition="Exists('packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets')" />
64+
<Import Project="packages\Nerdbank.GitVersioning.3.4.240\build\Nerdbank.GitVersioning.targets" Condition="Exists('packages\Nerdbank.GitVersioning.3.4.240\build\Nerdbank.GitVersioning.targets')" />
5965
<Target Name = "EnsureNuGetPackageBuildImports" BeforeTargets = "PrepareForBuild">
6066
<PropertyGroup>
6167
<ErrorText> This project references NuGet package(s) that are missing on this computer.Enable NuGet Package Restore to download them.For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
6268
</PropertyGroup>
63-
<Error Condition = "!Exists('packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets')" Text = "$([System.String]::Format('$(ErrorText)', 'packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets'))" />
69+
<Error Condition = "!Exists('packages\Nerdbank.GitVersioning.3.4.240\build\Nerdbank.GitVersioning.targets')" Text = "$([System.String]::Format('$(ErrorText)', 'packages\Nerdbank.GitVersioning.3.4.240\build\Nerdbank.GitVersioning.targets'))" />
6470
</Target>
6571
</Project>

src/devices_generated/Tsl256x/Tsl256x.nuspec devices/Tsl256x/Tsl256x.nuspec

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
<summary>Iot.Device.Tsl256x assembly for .NET nanoFramework C# projects</summary>
2121
<tags>nanoFramework C# csharp netmf netnf Iot.Device.Tsl256x</tags>
2222
<dependencies>
23-
<dependency id="nanoFramework.CoreLibrary" version="1.10.4-preview.11" />
23+
<dependency id="nanoFramework.CoreLibrary" version="1.10.5" />
24+
<dependency id="nanoFramework.System.Device.I2c" version="1.0.1" />
25+
<dependency id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.0.160" />
26+
<dependency id="nanoFramework.System.Device.Model" version="1.0.176" />
2427
</dependencies>
2528
</metadata>
2629
<files>
@@ -30,7 +33,7 @@
3033
<file src="bin\Release\Iot.Device.Tsl256x.pe" target="lib\Iot.Device.Tsl256x.pe" />
3134
<file src="bin\Release\Iot.Device.Tsl256x.xml" target="lib\Iot.Device.Tsl256x.xml" />
3235
<file src="readme.md" target="" />
33-
<file src="..\assets\nf-logo.png" target="images" />
34-
<file src="..\LICENSE.md" target="" />
36+
<file src="..\..\assets\nf-logo.png" target="images" />
37+
<file src="..\..\LICENSE.md" target="" />
3538
</files>
3639
</package>

devices/Tsl256x/Tsl256x.sln

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.30717.126
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tsl256x", "Tsl256x.nfproj", "{F23D823C-C993-1112-6EFC-C259FD71E9E9}"
6+
EndProject
7+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tsl256x.sample", "samples\Tsl256x.sample.nfproj", "{B11F494E-00C1-7AEF-FB7D-D9F213CB0A73}"
8+
EndProject
9+
Global
10+
GlobalSection(SharedMSBuildProjectFiles) = preSolution
11+
..\..\src\BinaryPrimitives\BinaryPrimitives.projitems*{b11f494e-00c1-7aef-fb7d-d9f213cb0a73}*SharedItemsImports = 5
12+
..\..\src\BinaryPrimitives\BinaryPrimitives.projitems*{f23d823c-c993-1112-6efc-c259fd71e9e9}*SharedItemsImports = 5
13+
..\..\src\System.Device.Model\System.Device.Model.projitems*{f23d823c-c993-1112-6efc-c259fd71e9e9}*SharedItemsImports = 5
14+
EndGlobalSection
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Release|Any CPU = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{F23D823C-C993-1112-6EFC-C259FD71E9E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{F23D823C-C993-1112-6EFC-C259FD71E9E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{F23D823C-C993-1112-6EFC-C259FD71E9E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{F23D823C-C993-1112-6EFC-C259FD71E9E9}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{B11F494E-00C1-7AEF-FB7D-D9F213CB0A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{B11F494E-00C1-7AEF-FB7D-D9F213CB0A73}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{B11F494E-00C1-7AEF-FB7D-D9F213CB0A73}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{B11F494E-00C1-7AEF-FB7D-D9F213CB0A73}.Release|Any CPU.Build.0 = Release|Any CPU
28+
EndGlobalSection
29+
GlobalSection(SolutionProperties) = preSolution
30+
HideSolutionNode = FALSE
31+
EndGlobalSection
32+
GlobalSection(ExtensibilityGlobals) = postSolution
33+
SolutionGuid = {E89174EF-A269-49C1-90BC-9F1A122D4E43}
34+
EndGlobalSection
35+
EndGlobal

devices/Tsl256x/Tsl256xBoard.png

171 KB
Loading
File renamed without changes.

devices/Tsl256x/packages.config

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="nanoFramework.CoreLibrary" version="1.10.5" targetFramework="netnanoframework10" />
4+
<package id="nanoFramework.System.Device.I2c" version="1.0.1" targetFramework="netnanoframework10" />
5+
<package id="UnitsNet.nanoFramework.Illuminance" version="4.102.0" targetFramework="netnanoframework10" />
6+
<package id="nanoFramework.System.Math" version="1.4.1" targetFramework="netnanoframework10" />
7+
<package id="Nerdbank.GitVersioning" version="3.4.240" developmentDependency="true" targetFramework="netnanoframework10" />
8+
<package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.0.160" targetFramework="netnanoframework10" />
9+
<package id="nanoFramework.System.Device.Model" version="1.0.176" targetFramework="netnanoframework10" />
10+
</packages>

src/devices_generated/Tsl256x/samples/Program.cs devices/Tsl256x/samples/Program.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Buffers.Binary;
64
using System.Device.Gpio;
75
using System.Device.I2c;
6+
using System.Diagnostics;
87
using System.Threading;
98
using IoT.Device.Tsl256x;
9+
using nanoFramework.Hardware.Esp32;
10+
11+
// Must specify pin functions on ESP32, not needed for most other boards
12+
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
13+
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);
1014

1115
const int PinInterrupt = 4;
1216

@@ -22,7 +26,7 @@
2226

2327
Debug.WriteLine("This will get the illuminance with the standard period of 402 ms integration and normal gain");
2428

25-
while (!Console.KeyAvailable)
29+
for (var j = 0; j < 20; j++)
2630
{
2731
var lux = tsl256X.MeasureAndGetIlluminance();
2832
Debug.WriteLine($"Illuminance is {lux.Lux} Lux");

src/devices_generated/Tsl256x/samples/Properties/AssemblyInfo.cs devices/Tsl256x/samples/Properties/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
[assembly: AssemblyTitle("Iot.Device.Tsl256x.sample")]

src/devices_generated/Tsl256x/samples/Tsl256x.sample.nfproj devices/Tsl256x/samples/Tsl256x.sample.nfproj

+27-8
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,43 @@
2121
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
2222
<ItemGroup>
2323
<Reference Include="mscorlib">
24-
<HintPath>..\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
24+
<HintPath>..\packages\nanoFramework.CoreLibrary.1.10.5\lib\mscorlib.dll</HintPath>
2525
<Private>True</Private>
2626
</Reference>
27+
<Reference Include="nanoFramework.Hardware.Esp32, Version=1.3.3.3, Culture=neutral, PublicKeyToken=c07d481e9758c731">
28+
<HintPath>..\packages\nanoFramework.Hardware.Esp32.1.3.3\lib\nanoFramework.Hardware.Esp32.dll</HintPath>
29+
<Private>True</Private>
30+
<SpecificVersion>True</SpecificVersion>
31+
</Reference>
32+
<Reference Include="nanoFramework.Runtime.Events, Version=1.9.1.3, Culture=neutral, PublicKeyToken=c07d481e9758c731">
33+
<HintPath>..\packages\nanoFramework.Runtime.Events.1.9.1\lib\nanoFramework.Runtime.Events.dll</HintPath>
34+
<Private>True</Private>
35+
<SpecificVersion>True</SpecificVersion>
36+
</Reference>
2737
<Reference Include="System.Device.Gpio">
28-
<HintPath>..\packages\nanoFramework.System.Device.Gpio.1.0.0-preview.40\lib\System.Device.Gpio.dll</HintPath>
38+
<HintPath>..\packages\nanoFramework.System.Device.Gpio.1.0.1\lib\System.Device.Gpio.dll</HintPath>
2939
<Private>True</Private>
3040
</Reference>
31-
<Reference Include="nanoFramework.Runtime.Events">
41+
<!-- <Reference Include="nanoFramework.Runtime.Events">
3242
<HintPath>..\packages\nanoFramework.Runtime.Events.1.9.0-preview.26\lib\nanoFramework.Runtime.Events.dll</HintPath>
3343
<Private>True</Private>
34-
</Reference>
44+
</Reference> -->
3545
<Reference Include="System.Device.I2c">
36-
<HintPath>..\packages\nanoFramework.System.Device.I2c.1.0.1-preview.33\lib\System.Device.I2c.dll</HintPath>
46+
<HintPath>..\packages\nanoFramework.System.Device.I2c.1.0.1\lib\System.Device.I2c.dll</HintPath>
3747
<Private>True</Private>
3848
</Reference>
3949
<Reference Include="UnitsNet.Illuminance">
40-
<HintPath>..\packages\UnitsNet.nanoFramework.Illuminance.4.92.0\lib\UnitsNet.Illuminance.dll</HintPath>
50+
<HintPath>..\packages\UnitsNet.nanoFramework.Illuminance.4.102.0\lib\UnitsNet.Illuminance.dll</HintPath>
4151
<Private>True</Private>
4252
</Reference>
53+
<Reference Include="System.Buffers.Binary.BinaryPrimitives">
54+
<HintPath>packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.0.160\lib\System.Buffers.Binary.dll</HintPath>
55+
<Private>True</Private>
56+
</Reference>
57+
<Reference Include="System.Device.Model">
58+
<HintPath>packages\nanoFramework.System.Device.Model.1.0.176\lib\System.Device.Model.dll</HintPath>
59+
<Private>True</Private>
60+
</Reference>
4361
</ItemGroup>
4462
<ItemGroup>
4563
<None Include="packages.config" />
@@ -50,9 +68,10 @@
5068
<Compile Include="*.cs" />
5169
<None Include="*.md" />
5270
</ItemGroup>
71+
<ItemGroup>
72+
<ProjectReference Include="..\Tsl256x.nfproj" />
73+
</ItemGroup>
5374
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
54-
<Import Project="..\..src\BinaryPrimitives\BinaryPrimitives.projitems" Label="Shared" />
55-
<Import Project="..\..\src\System.Runtime.CompilerService\System.Runtime.CompilerService.projitems" Label="Shared" />
5675
<ProjectExtensions>
5776
<ProjectCapabilities>
5877
<ProjectConfigurationsDeclaredAsItems />
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="nanoFramework.CoreLibrary" version="1.10.5" targetFramework="netnanoframework10" />
4+
<package id="nanoFramework.Hardware.Esp32" version="1.3.3" targetFramework="netnanoframework10" />
5+
<package id="nanoFramework.Runtime.Events" version="1.9.1" targetFramework="netnanoframework10" />
6+
<package id="nanoFramework.System.Device.Gpio" version="1.0.1" targetFramework="netnanoframework10" />
7+
<package id="nanoFramework.System.Device.I2c" version="1.0.1" targetFramework="netnanoframework10" />
8+
<package id="nanoFramework.System.Math" version="1.4.1" targetFramework="netnanoframework10" />
9+
<package id="UnitsNet.nanoFramework.Illuminance" version="4.102.0" targetFramework="netnanoframework10" />
10+
<package id="nanoFramework.System.Buffers.Binary.BinaryPrimitives" version="1.0.160" targetFramework="netnanoframework10" />
11+
<package id="nanoFramework.System.Device.Model" version="1.0.176" targetFramework="netnanoframework10" />
12+
</packages>

devices/Tsl256x/tsl256x.fzz

39.1 KB
Binary file not shown.
File renamed without changes.

src/devices_generated/Tsl256x/Tsl256x.sln

-31
This file was deleted.

src/devices_generated/Tsl256x/packages.config

-8
This file was deleted.

src/devices_generated/Tsl256x/samples/packages.config

-8
This file was deleted.

0 commit comments

Comments
 (0)