NetBurner 3.5.0
PDF Version
 
General Purpose I/O Service

Example to control GPIO pins though command interface.

This is a general purpose GPIO example and a large portion of the code is dedicated to a parser and command structure. Most platforms have additional GPIO examples in the Platform Specific example directory which focus on GPIO specifics.

This example sets up a command parser on the default serial port to configure and control GPIO signals on the NetBurner module. For devices with multiple connectors the example uses the peripheral connector, such as P2 or J2, or the main connector for devices with a single connector. Depending on your specific device, not all signals can be GPIO. Please consult the device data sheet for additional information.

To run the example build and load the project into your device. Then run the MTTTY serial terminal and connect to your device's debug/status port.

The menu options are:

  • HI Set a pin high
  • LO Set a pin low
  • TGL Toggle a pin
  • OUT Configure a pin to be an output
  • IN Configure a pin to be an input
  • RD Tristate and read a pin

For example, to set pin 5 high use the command: "HI 5".

Please refer to the "Example Applications > Platform Specific" section of the NetBurner Documentation for additional GPIO examples specific to your particular NetBurner platform.