Netduino.Foundation Unified GPIO Architecture
Netduino.Foundation incorporates an architecture that was designed to extend peripheral support seamlessly across expansion peripherals such as the I2C/SPI/etc. I/O expansion chips. For example, you can connect an MCP23x or 74x595 I/O expansion chip to a Netduino, and then drive a
Relay via one of the pins on the expansion chip, just as if it were connected directly to the Netduino!
This is possible through the use of GPIO interface and base classes that define GPIO port contracts and provide base level implementation.
For instance, the following code illustrates the use of a
Relay connected to an
// create our MCP23008 MCP23008 mcp = new MCP23008(39); // all address pins pulled high // create a digital output port from that mcp DigitalOutputPort relayPort = mcp.CreateOutputPort(1, false); // create a new relay using that digital output port Relay relay = new Relay(relayPort); // toggle the relay relay.Toggle();
Preview Release Version
This API is in preview release. Only the output ports are in this version (there is no
DigitalInputPort for instance), and the API is subject to change as we validate it.
IPort- The base interface for all port classes.
IPortand is the base interface for all analog port classes.
IPortand is the base interface for all digital port classes.
IDigitalPortand is the interface for all digital output port classes.
IDigitalInputPort- In Development
DigitalPortBase- Provides a base implementation for much of the common tasks of classes implementing
DigitalOutputPortBase- Inherits from
DigitalPortBaseand provides a base implementation for much of the common tasks of classes implementing