未验证 提交 a8d3e929 编写于 作者: Z Zhang Yuexin 提交者: GitHub

Add Allwinner H616 & Orange Pi Zero 2 support (#1790)

* add Allwinner H616 support

* private
上级 a2173d79
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace Iot.Device.Gpio.Drivers
{
/// <summary>
/// A GPIO driver for the Orange Pi Zero 2.
/// </summary>
/// <remarks>
/// SoC: Allwinner H616 (sun50iw9p1)
/// </remarks>
public class OrangePiZero2Driver : Sun50iw9p1Driver
{
private static readonly int[] _pinNumberConverter = new int[]
{
-1, -1, -1, MapPinNumber('H', 5), -1, MapPinNumber('H', 4), -1, MapPinNumber('C', 9), MapPinNumber('H', 2), -1,
MapPinNumber('H', 3), MapPinNumber('C', 6), MapPinNumber('C', 11), MapPinNumber('C', 5), -1, MapPinNumber('C', 8),
MapPinNumber('C', 15), -1, MapPinNumber('C', 14), MapPinNumber('H', 7), -1, MapPinNumber('H', 8), MapPinNumber('C', 7),
MapPinNumber('H', 6), MapPinNumber('H', 9), -1, MapPinNumber('C', 10)
};
/// <inheritdoc/>
protected override int PinCount => 17;
/// <inheritdoc/>
protected override int ConvertPinNumberToLogicalNumberingScheme(int pinNumber)
{
int num = _pinNumberConverter[pinNumber];
return num != -1 ? num : throw new ArgumentException($"Board (header) pin {pinNumber} is not a GPIO pin on the {GetType().Name} device.", nameof(pinNumber));
}
}
}
\ No newline at end of file
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Iot.Device.Gpio.Drivers
{
/// <summary>
/// A GPIO driver for Allwinner H616.
/// </summary>
public class Sun50iw9p1Driver : SunxiDriver
{
/// <inheritdoc/>
protected override int CpuxPortBaseAddress => 0x0300B000;
/// <inheritdoc/>
protected override int CpusPortBaseAddress => 0x07022000;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册