Cobra III and G120 Pins Definition for Ldr0, Ldr1 and SdCardDetect

I am tinkering with both the Cobra III and the G120 module on a custom board, and noticed that the Cobra III pins definition includes the references for the onboard buttons and the card detect, below. The same information on pins, in not provided in the G120 pins definition file.

I understand that the Ldr pins on the G120 can be used for another purpose but was wondering if they will be added to the Pins definitions with the next update or not?

Here is what is the FezPandaIII pins definition has, that is not in the G120 pins file.

/// <summary>The Cpu.Pin for the LDR0 button.</summary>
public const Cpu.Pin Ldr0 = G120.P2_10;
/// <summary>The Cpu.Pin for the LDR1 button.</summary>
public const Cpu.Pin Ldr1 = G120.P0_22;
/// <summary>The SD card detect pin.</summary>
public const Cpu.Pin SdCardDetect = G120.P2_11;

I have made a detailed document of all Cobra III pins and their name associations in a single document. This single document also covers the GXP connector and its Gadgeteer connector pins. It also documents some errors in signal names on the Schematic for the Cobra III board, for which it was said corrections will be made, but I don’t know if that is true yet.

If someone would tell me how to post my document on the forum, I would do so to make this information available to the community.


@ srogers - to publish that document you can do one of a couple of things. You could host the raw document on a file sharing site (OneDrive, G Docs, dropbox, whoever is your choice). You could create a new post here with the contents of the file. You could create a new post on the codeshare site.

@ Zan - the SD Card Detect pin is not special in the firmware, any pin can be used for it. On the Cobra III, GHI.Pins includes the specific pin we chose to use for that function. We will take a look at adding the LDR pins to the SoM though.

@ John - thanks for the clarifications. I figured at least the buttons could be added in the pin definitions.

It just makes code writing more consistent, and of course if any of the pin mappings change in the future, the abstraction behind the definition would make code portable with no issues.