This project is read-only.

ResistorMode for Emulation and Documentation only?

Oct 7, 2014 at 11:46 PM
I have read in several places online that the ResistorMode (e.g., passed into GTI.InterruptInputFactory.Create and GTI.DigitalInputFactory.Create) is purely for the emulator and for documentation purposes, and has no effect on the actual behavior of the device.

Is this correct, or does ResistorMode need to be correctly specified for the hardware to function as expected?

Oct 8, 2014 at 1:08 AM
Edited Oct 8, 2014 at 1:09 AM
So as you know in .NET Gadgeteer 2.43.800 onwards, there is this new indirection capability, so we have two options here that might be happening.

In the normal case (i.e. input is not indirected, and you end up with NativeDigitalInput), you need to correctly specify the resistor mode for the hardware. You can follow the parameter in code: the factory passes the parameter to NativeDigitalInput which directly uses the parameter in .NET Micro Framework's InputPort class. So unless your hardware's firmware is ignoring this parameter, you need to set it correctly.

In the indirected case, it depends on the indirector (i.e. Socket.DigitalInputIndirector delegate), what it does with the parameter, it can ignore it, or use it when creating the indirected input class. That's on the manufacturer of the hardware/driver.

The same holds for the bi-directional and interrupt input related classes.

Also note that .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown.
Oct 8, 2014 at 2:15 AM
Thanks for the clarification.