Accessing pins on Cerberus in 4.3?

Hmm, stuff has changed with OSHW other things. I am not able to access the pins with the usual usings and references.

Can you please enlighten me as to reference the pins in the most elegant and future proof way.

Thanks

STM Pin classā€¦

 public class Pin
    {
        /// <summary>A value indicating that no GPIO pin is specified.</summary>
        public const Cpu.Pin GPIO_NONE = Cpu.Pin.GPIO_NONE;

        /// <summary>Digital I/O.</summary>
        public const Cpu.Pin PA0 = (Cpu.Pin)((0 * 16) + 0);

        /// <summary>Digital I/O.</summary>
        public const Cpu.Pin PA1 = (Cpu.Pin)((0 * 16) + 1);

        /// <summary>Digital I/O.</summary>
        public const Cpu.Pin PA2 = (Cpu.Pin)((0 * 16) + 2);

        /// <summary>Digital I/O.</summary>
        public const Cpu.Pin PA3 = (Cpu.Pin)((0 * 16) + 3);

       //etc etc
1 Like

When you get to PB0 it becomes

/// <summary>Digital I/O.</summary>
public const Cpu.Pin PB0 = (Cpu.Pin)((1 * 16) + 0);

/// <summary>Digital I/O.</summary>
public const Cpu.Pin PB1 = (Cpu.Pin)((1 * 16) + 1);

// etc

Thanks. I need the usings and refs required.

Microsoft.SPOT.Hardware;

So, where is the Cerberus defined pin-names?

More specifically I would like to understand how to use the socket map http://www.ghielectronics.com/uploads/doc/item/1556_large.jpg

From code.

For Cerberus, I use the chart to find the pin name (PC0 is pin C0)
Then use the GHI call Generic.GetPin(port, number). i.e.:
static OutputPort resetOled = new OutputPort(Generic.GetPin(ā€˜Cā€™, 1), true);
will set up an OuputPort on PC1, and set it to ā€˜1ā€™.

For this, you need to add the reference GHI.Pins
and a using statement: using GHI.Pins;

1 Like

Is this really the easiest way? I have come across Cpu.Pin.GPIO_Pin0 several times and I still dont have a clue where to find the exact pin/socket/wire.

If I plug in a Gadgeteer button to Spider socket 4, how do I find out which pin is used the button input? And no cheating, I need refs to documents that leads all the way to the result.

If your using Gadgeteer why do you care?

Because I really want to try the low power stuff from https://www.ghielectronics.com/docs/141/low-power

But dont now how to instruct it to react to my button press from the button in lets say socket 4.

What to replace Cpu.Pin.GPIO_Pin0 with - in the example with interruptsā€¦

Without cheatingā€¦

Button uses Pin 4 on a G socketā€¦

https://www.ghielectronics.com/catalog/product/274

Looking at Spider Schematicā€¦Socket 4 pin 4 is IO37ā€¦

http://www.ghielectronics.com/downloads/schematic/FEZ_Spider_Mainboard_SCH.PDF

So in codeā€¦



Crystal?

In that caseā€¦it doesnt matterā€¦

Just press de button

As clear as a billabong after rain. Thanks buddy

Hmm, interessting, I was exactly thinking that it didnt matter in this case.

So what you are saying is that ANY GPIO change will wake up the sleeping beauty? And the arguments does not matter?

correct a mundo

[quote=ā€œJustinā€]Without cheatingā€¦
Button uses Pin 4 on a G socketā€¦
ā€¦
[/quote]
Perhaps cheating might have helped, since unless Iā€™m now confused, a button uses pin 3 (not 4) on either an X or Y socket, not G according to https://www.ghielectronics.com/catalog/product/274!

I labour the point, just to ensure Iā€™m following along correctly.

What say you?

1 Like

3 == 4 init? :whistle:

1 Like