Gadgeteer Adapter for Netduino Go

Chris, I guess my mental block is how the GoBus stack knows how to configure the Virtual I/O for the intended device.

What tells it the type of device that has been plugged-in, the Gadgeteer devices do not announce themselves or do they? My initial thought was that the Adapter module (actually it’s driver I guess) would invoke the ‘Socket.EnsureTypeIsSupported’ of the Gadgeteer module driver to determine the correct Virtual I/O configuration.

I am sure I am going to have that Ah-ah moment soon :slight_smile:

The designer specifies the topology?

I think about it a little differently. The designer is little more than a convenient editor for generating code, there is nothing special about the designer in terms of the runtime functionality. Writing the same code without the designer works just as well, albeit more work of course. From that perspective it is the code that defines the topology and this is where I am getting stuck, what is that code doing extra to ensure the correct configuration of the virtual I/Os, an all I can think is that when the GTM is constructed with the Adapter socket id the Adapter socket that is instantiated queries the module (Socket.EnsureTypeIsSupported?) to determine the correct configuration of the virtual I/O for that socket. Unfortunately, Chris has already indicated that it is not this complex, but I am not yet getting past this :slight_smile:

NB: It is not my intent to sell the designer short, I use it all the time. I am just trying identify for myself which parts of the solution are pertinent to the Adapter and how it might work.

The Gadgeteer Adapter advertises its pins/features automatically via GoBus.

The Gadgeteer Adapter has 26 GPIOs, 6 ADC channels, 1 DAC channel, 1 I2C bus, 2 UARTs (with flow control), 6 PWM channels, and 1 SPI bus.

These features are mapped to the Gadgeteer Adapter’s sockets as follows:
Socket 1 – AIKU X
Socket 2 – AI X
Socket 3 – OPS Y
Socket 4 – KPU Y

The Gadgeteer designer matches up modules to the Gadgeteer Adapters’ sockets the same way as other mainboards.

Chris

Ah, thank you!!! Now I can go sleep… :slight_smile:

So the sockets on the Adapter are pre-defined as supporting specific socket types. That is where I went wrong, I assumed (my first mistake) that the adapter sockets would dynamically configure themselves to match the socket requirement of the attached GTM ie. any socket could act like a U socket if a U device was plugged into it.

Hi taylorza,

Oh sure, you can also use the Gadgeteer Adapter without the designer. Here’s a quick example:


// connect to the first Gadgeteer Adapter on the GoBus; you can optionally specify what GoBus port it connects to.
NetduinoGo.GadgeteerAdapter gadgeteerAdapter = new NetduinoGo.GadgeteerAdapter();

// use a GHI MulticolorLed module on this Gadgeteer Adapter's socket #4
var led = new GTM.GHIElectronics.MulticolorLed(gadgeteerAdapter.GadgeteerSockets.Socket4);

Chris

Hi Chris,

It was nice meeting you and Stefan too! I remember you have mentioned Designer support. I see you guys made very good progress. That would make easy for Go users to enjoy vast amount of Gadgetter modules that exist already.