Skip to content

Commit

Permalink
Regenerate devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Gukov committed May 21, 2021
1 parent e640577 commit eb48cf4
Show file tree
Hide file tree
Showing 460 changed files with 20,083 additions and 1,111 deletions.
2 changes: 1 addition & 1 deletion src/devices_generated/AD5328/AD5328.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}</ProjectGuid>
<ProjectGuid>{A5551D3E-755B-4D8B-BC17-60F771D68741}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
Expand Down
16 changes: 8 additions & 8 deletions src/devices_generated/AD5328/AD5328.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "AD5328", "AD5328.nfproj", "{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}"
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "AD5328", "AD5328.nfproj", "{A5551D3E-755B-4D8B-BC17-60F771D68741}"
EndProject
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "AD5328.Samples", "samples\\AD5328.Samples.nfproj", "{264ADA55-EBE3-48CB-A3D6-C9F00183CE8C}"
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "AD5328.Samples", "samples\\AD5328.Samples.nfproj", "{EE379A0B-F0CB-45D1-B99E-D93A0023C11F}"
EndProject
<!-- SAMPLES PROJECT PLACEHOLDER -->
<!-- UNIT TESTS PROJECT PLACEHOLDER -->
Expand All @@ -16,11 +16,11 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Release|Any CPU.Build.0 = Release|Any CPU
{9BA0D0ED-ADE3-4A2D-97F0-7A31A282668E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Release|Any CPU.Build.0 = Release|Any CPU
{A5551D3E-755B-4D8B-BC17-60F771D68741}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
EndGlobal
186 changes: 186 additions & 0 deletions src/devices_generated/AD5328/SpanByte.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
namespace System
{
/// <summary>
/// Provides a type- and memory-safe representation of a contiguous region of arbitrary array.
/// </summary>
[Serializable, CLSCompliant(false)]
public readonly ref struct SpanByte
{
private readonly byte[] _array;
private readonly int _start;
private readonly int _length;

/// <summary>
/// Creates a new Span object over the entirety of a specified array.
/// </summary>
/// <param name="array">The array from which to create the System.Span object.</param>
public SpanByte(byte[] array)
{
_array = array;
_length = array?.Length ?? 0;
_start = 0;
}

/// <summary>
/// Creates a new Span object that includes a specified number of elements
/// of an array starting at a specified index.
/// </summary>
/// <param name="array">The source array.</param>
/// <param name="start">The index of the first element to include in the new System.Span</param>
/// <param name="length">The number of elements to include in the new System.Span</param>
/// <exception cref="System.ArgumentOutOfRangeException">
/// array is null, but start or length is non-zero. -or- start is outside the bounds
/// of the array. -or- start and length exceeds the number of elements in the array.
/// </exception>
public SpanByte(byte[] array, int start, int length)
{
if (array != null)
{
if ((start + length > array.Length) || (start >= array.Length))
{
// Array length too small
throw new ArgumentOutOfRangeException();
}
}
else
{
if ((start != 0) || (length != 0))
{
// Array is null but start and length are not 0
throw new ArgumentOutOfRangeException();
}
}

_array = array;
_start = start;
_length = length;
}

/// <summary>
/// Gets the element at the specified zero-based index.
/// </summary>
/// <param name="index">The zero-based index of the element.</param>
/// <returns>The element at the specified index.</returns>
// public ref byte this[int index] => ref _array[_start + index]; // <= this is not working and raises exception after few access
public byte this[int index]
{
get
{
int realIndex = _start + index;

if (realIndex >= _length)
{
throw new ArgumentOutOfRangeException();
}

return _array[realIndex];
}

set
{
int realIndex = _start + index;

if (realIndex >= _length)
{
throw new ArgumentOutOfRangeException();
}

_array[realIndex] = value;
}
}

/// <summary>
/// Returns an empty System.Span object.
/// </summary>
public static SpanByte Empty => new SpanByte();

/// <summary>
/// Returns the length of the current span.
/// </summary>
public int Length => _length;

/// <summary>
/// Returns a value that indicates whether the current System.Span is empty.
/// true if the current span is empty; otherwise, false.
/// </summary>
public bool IsEmpty => _length == 0;

/// <summary>
/// Copies the contents of this System.Span into a destination System.Span.
/// </summary>
/// <param name="destination"> The destination System.Span object.</param>
/// <exception cref="System.ArgumentException">
/// destination is shorter than the source System.Span.
/// </exception>
public void CopyTo(SpanByte destination)
{
if (destination.Length < _length)
{
throw new ArgumentException();
}

for (int i = 0; i < _length; i++)
{
destination[i] = _array[_start + i];
}
}

/// <summary>
/// Forms a slice out of the current span that begins at a specified index.
/// </summary>
/// <param name="start">The index at which to begin the slice.</param>
/// <returns>A span that consists of all elements of the current span from start to the end of the span.</returns>
/// <exception cref="System.ArgumentOutOfRangeException">start is less than zero or greater than System.Span.Length.</exception>
public SpanByte Slice(int start)
{
return Slice(start, _length - start);
}

/// <summary>
/// Forms a slice out of the current span starting at a specified index for a specified length.
/// </summary>
/// <param name="start">The index at which to begin this slice.</param>
/// <param name="length">The desired length for the slice.</param>
/// <returns>A span that consists of length elements from the current span starting at start.</returns>
/// <exception cref="System.ArgumentOutOfRangeException">start or start + length is less than zero or greater than System.Span.Length.</exception>
public SpanByte Slice(int start, int length)
{
if ((start < 0) || (length < 0) || (start + length > _length))
{
// start or start + length is less than zero or greater than length
throw new ArgumentOutOfRangeException();
}

return new SpanByte(_array, _start + start, length);
}

/// <summary>
/// Copies the contents of this span into a new array.
/// </summary>
/// <returns> An array containing the data in the current span.</returns>
public byte[] ToArray()
{
var array = new byte[_length];
for (int i = 0; i < _length; i++)
{
array[i] = _array[_start + i];
}

return array;
}

public static implicit operator SpanByte(byte[] array)
{
return new(array);
}

/// <summary>
/// Defines an implicit conversion of a System.Span to a System.ReadOnlySpan.
/// </summary>
/// <param name="span">The object to convert to a System.ReadOnlySpan.</param>
public static implicit operator ReadOnlySpanByte(SpanByte span)
{
return span;
}
}
}
2 changes: 1 addition & 1 deletion src/devices_generated/AD5328/samples/AD5328.Samples.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{264ADA55-EBE3-48CB-A3D6-C9F00183CE8C}</ProjectGuid>
<ProjectGuid>{EE379A0B-F0CB-45D1-B99E-D93A0023C11F}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
Expand Down
2 changes: 1 addition & 1 deletion src/devices_generated/Ads1115/Ads1115.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{07AC0697-656E-44CB-AF14-3A1942C782FD}</ProjectGuid>
<ProjectGuid>{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
Expand Down
16 changes: 8 additions & 8 deletions src/devices_generated/Ads1115/Ads1115.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Ads1115", "Ads1115.nfproj", "{07AC0697-656E-44CB-AF14-3A1942C782FD}"
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Ads1115", "Ads1115.nfproj", "{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}"
EndProject
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Ads1115.Samples", "samples\\Ads1115.Samples.nfproj", "{DB46D7A9-617C-4C54-801A-08450BC6D855}"
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Ads1115.Samples", "samples\\Ads1115.Samples.nfproj", "{2FD7AE6C-0DDF-41E8-8A53-0098BF5C9006}"
EndProject
<!-- SAMPLES PROJECT PLACEHOLDER -->
<!-- UNIT TESTS PROJECT PLACEHOLDER -->
Expand All @@ -16,11 +16,11 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Release|Any CPU.Build.0 = Release|Any CPU
{07AC0697-656E-44CB-AF14-3A1942C782FD}.Release|Any CPU.Deploy.0 = Release|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Release|Any CPU.Build.0 = Release|Any CPU
{DE0F1E3E-2B67-4690-BE31-0E54A4B50BD4}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Loading

0 comments on commit eb48cf4

Please sign in to comment.