Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meadow.Linux: Add support for Raspberry Pi 5 pinout #379

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Meadow.Hardware;
using System.Collections;
using System.Collections.Generic;

namespace Meadow.Pinouts
{
public class RaspberryPi5 : RaspberryPi
{
public RaspberryPi5()
{
// the sysfs base for the pinctrl-rpi1 is 53
// the gpiochip bank for pinctrl-rpi1 on rpi5 is gpiochip4
foreach (LinuxFlexiPin pin in this.AllPins) {
pin.SysFsGpio += 53;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to GpiodOffset also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @bcr , no for libgpiod what's changed is the gpiochip number, but the offset continues the same.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure -- there's an integer property called SysFsGpio that you have added 53 to. There is an additional integer property called GpiodOffset that in the base class has the exact same value as SysFsGpio but is not adjusted here. I do understand that you changed the GpiodChip field also.

pin.GpiodChip = "gpiochip4";
microhobby marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class LinuxFlexiPin : Pin
/// <summary>
/// The pin's sysfs GPIO number
/// </summary>
public int SysFsGpio { get; }
public int SysFsGpio { get; internal set; }
/// <summary>
/// The chip name for the gpiod driver
/// </summary>
public string GpiodChip { get; }
public string GpiodChip { get; internal set; }
/// <summary>
/// The pin offset for the gpiod driver
/// </summary>
Expand Down
Loading