未验证 提交 1fb0794e 编写于 作者: S Stefan tischler 提交者: GitHub

Add support for RPi CM4 GPIO (#1714)

上级 f1fb5e78
......@@ -33,7 +33,7 @@ namespace System.Device.Gpio.Tests
if (File.Exists("/proc/device-tree/model"))
{
string model = File.ReadAllText("/proc/device-tree/model", Text.Encoding.ASCII);
if (model.Contains("Raspberry Pi 4"))
if (model.Contains("Raspberry Pi 4") || model.Contains("Raspberry Pi Compute Module 4"))
{
return true;
}
......
......@@ -138,7 +138,8 @@ namespace System.Device.Gpio.Drivers
RaspberryBoardInfo.Model.RaspberryPi3B or
RaspberryBoardInfo.Model.RaspberryPi3APlus or
RaspberryBoardInfo.Model.RaspberryPi3BPlus or
RaspberryBoardInfo.Model.RaspberryPi4 => new RaspberryPi3LinuxDriver(),
RaspberryBoardInfo.Model.RaspberryPi4 or
RaspberryBoardInfo.Model.RaspberryPiComputeModule4 => new RaspberryPi3LinuxDriver(),
RaspberryBoardInfo.Model.RaspberryPiComputeModule3 => new RaspberryPiCm3Driver(),
_ => null,
};
......
......@@ -96,6 +96,11 @@ namespace System.Device.Gpio
/// Pi 400
/// </summary>
RaspberryPi400,
/// <summary>
/// Compute module 4.
/// </summary>
RaspberryPiComputeModule4,
}
#region Fields
......@@ -153,6 +158,7 @@ namespace System.Device.Gpio
0x20E0 => Model.RaspberryPi3APlus,
0x20A0 or 0x2100 => Model.RaspberryPiComputeModule3,
0x3111 or 0x3112 or 0x3114 => Model.RaspberryPi4,
0x3140 => Model.RaspberryPiComputeModule4,
0x3130 => Model.RaspberryPi400,
_ => Model.Unknown,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册