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

Updated to work on all revisions (Rev1, Rev2, B+ and above) #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
178 changes: 143 additions & 35 deletions src/PiSharp.LibGpio/Entities/BroadcomPinNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,159 @@
// </copyright>
//-----------------------------------------------------------------------

namespace PiSharp.LibGpio.Entities
namespace PiSharp.LibGpio
{
/// <summary>
/// The Broadcom GPIO ID
/// </summary>
public enum BroadcomPinNumber
public partial class LibGpio
{
/// <summary>
/// GPIO Pin 4
/// The Broadcom GPIO ID
/// </summary>
Four = 4,
public enum BroadcomPinNumber
{
/// <summary>
/// GPIO Pin 0 (B Rev1 only)
/// </summary>
Zero = 0,

/// <summary>
/// GPIO Pin 17
/// </summary>
Seventeen = 17,
/// <summary>
/// GPIO Pin 1 (B Rev1 only)
/// </summary>
One = 1,

/// <summary>
/// GPIO Pin 18
/// </summary>
Eighteen = 18,
/// <summary>
/// GPIO Pin 2 (A/B Rev2 and above)
/// </summary>
Two = 2,

/// <summary>
/// GPIO Pin 21
/// </summary>
TwentyOne = 21,
/// <summary>
/// GPIO Pin 3 (A/B Rev2 and above)
/// </summary>
Three = 3,

/// <summary>
/// GPIO Pin 22
/// </summary>
TwentyTwo = 22,
/// <summary>
/// GPIO Pin 4
/// </summary>
Four = 4,

/// <summary>
/// GPIO Pin 23
/// </summary>
TwentyThree = 23,
/// <summary>
/// GPIO Pin 5 (B+ and above)
/// </summary>
Five = 5,

/// <summary>
/// GPIO Pin 24
/// </summary>
TwentyFour = 24,
/// <summary>
/// GPIO Pin 6 (B+ and above)
/// </summary>
Six = 6,

/// <summary>
/// GPIO Pin 25
/// </summary>
TwentyFive = 25,
/// <summary>
/// GPIO Pin 7
/// </summary>
Seven = 7,

/// <summary>
/// GPIO Pin 8
/// </summary>
Eight = 8,

/// <summary>
/// GPIO Pin 9
/// </summary>
Nine = 9,

/// <summary>
/// GPIO Pin 10
/// </summary>
Ten = 10,

/// <summary>
/// GPIO Pin 11
/// </summary>
Eleven = 11,

/// <summary>
/// GPIO Pin 12 (B+ and above)
/// </summary>
Twelve = 12,

/// <summary>
/// GPIO Pin 13 (B+ and above)
/// </summary>
Thirteen = 13,

/// <summary>
/// GPIO Pin 14
/// </summary>
Fourteen = 14,

/// <summary>
/// GPIO Pin 15
/// </summary>
Fifteen = 15,

/// <summary>
/// GPIO Pin 16 (B+ and above)
/// </summary>
Sixteen = 16,

/// <summary>
/// GPIO Pin 17
/// </summary>
Seventeen = 17,

/// <summary>
/// GPIO Pin 18
/// </summary>
Eighteen = 18,

/// <summary>
/// GPIO Pin 19 (B+ and above)
/// </summary>
Nineteen = 19,

/// <summary>
/// GPIO Pin 20 (B+ and above)
/// </summary>
Twenty = 20,

/// <summary>
/// GPIO Pin 21 (Rev1)
/// </summary>
TwentyOne = 21,

/// <summary>
/// GPIO Pin 22
/// </summary>
TwentyTwo = 22,

/// <summary>
/// GPIO Pin 23
/// </summary>
TwentyThree = 23,

/// <summary>
/// GPIO Pin 24
/// </summary>
TwentyFour = 24,

/// <summary>
/// GPIO Pin 25
/// </summary>
TwentyFive = 25,

/// <summary>
/// GPIO Pin 26 (B+ and above)
/// </summary>
TwentySix = 26,

/// <summary>
/// GPIO Pin 27 (A/B Rev2 and above)
/// </summary>
TwentySeven = 27,

/// <summary>
/// Undefined pin number
/// </summary>
Undefined = -1
}
}
}
23 changes: 23 additions & 0 deletions src/PiSharp.LibGpio/Entities/GpioLayout.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace PiSharp.LibGpio.Entities
{
/// <summary>
/// The Raspberry Pi GPIO ID
/// </summary>
public enum GpioLayout
{
/// <summary>
/// Revision numbers : [Beta, 0003]
/// </summary>
LayoutOne = 1,

/// <summary>
/// Revision numbers : [0004, 000f]
/// </summary>
LayoutTwo = 2,

/// <summary>
/// Revision numbers : [0010, ...]
/// </summary>
LayoutThree = 3
}
}
93 changes: 92 additions & 1 deletion src/PiSharp.LibGpio/Entities/PhysicalPinNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,31 @@ public enum PhysicalPinNumber
/// </summary>
Undefined = 0,

/// <summary>
/// GPIO Pin 3
/// </summary>
Three = 3,

/// <summary>
/// GPIO Pin 5
/// </summary>
Five = 5,

/// <summary>
/// GPIO Pin 7
/// </summary>
Seven = 7,

/// <summary>
/// GPIO Pin 8
/// </summary>
Eight = 8,

/// <summary>
/// GPIO Pin 10
/// </summary>
Ten = 10,

/// <summary>
/// GPIO Pin 11
/// </summary>
Expand Down Expand Up @@ -64,9 +84,80 @@ public enum PhysicalPinNumber
/// </summary>
Eighteen = 18,

/// <summary>
/// GPIO Pin 19
/// </summary>
Nineteen = 19,

/// <summary>
/// GPIO Pin 21
/// </summary>
TwentyOne = 21,

/// <summary>
/// GPIO Pin 22
/// </summary>
TwentyTwo = 22
TwentyTwo = 22,

/// <summary>
/// GPIO Pin 23
/// </summary>
TwentyThree = 23,

/// <summary>
/// GPIO Pin 24
/// </summary>
TwentyFour = 24,

/// <summary>
/// GPIO Pin 26
/// </summary>
TwentySix = 26,

/// <summary>
/// GPIO Pin 29 (B+ and above)
/// </summary>
TwentyNine = 29,

/// <summary>
/// GPIO Pin 31 (B+ and above)
/// </summary>
ThirtyOne = 31,

/// <summary>
/// GPIO Pin 32 (B+ and above)
/// </summary>
ThirtyTwo = 32,

/// <summary>
/// GPIO Pin 33 (B+ and above)
/// </summary>
ThirtyThree = 33,

/// <summary>
/// GPIO Pin 35 (B+ and above)
/// </summary>
ThirtyFive = 35,

/// <summary>
/// GPIO Pin 36 (B+ and above)
/// </summary>
ThirtySix = 36,

/// <summary>
/// GPIO Pin 37 (B+ and above)
/// </summary>
ThirtySeven = 37,

/// <summary>
/// GPIO Pin 38 (B+ and above)
/// </summary>
ThirtyEight = 38,

/// <summary>
/// GPIO Pin 40 (B+ and above)
/// </summary>
Fourty = 40

}
}
Loading