SHIP:Port:gpio

From Serious Documentation
Jump to: navigation, search

GPIO ports are used to either read or control various hardware elements of the SIM and are usually referred to in the format "platform.GPIO". It should be noted that each platform may or may not implement any of the portvars listed below and you should refer to your SIM's GRM for the exact specifications of available GPIO portvars supported by your platform.

Complete List of GPIO Portvars

Note: The GPIO portvars in this comprehensive list were collected from all SIM platforms and may not appear on every platform. However, when a portvar is implemented on your platform, it will function as described below. Refer to you platform's GRM.

Portvar Data Type Permissions Description
SW1 Boolean Read Only Reflects the logical state of the pushbutton designated as SW1 by the platform. Reads true when pressed.
LEDR Boolean Read/Write Turns a SIM's red LED on when set to true. Can be combined with LEDG to make the LED look orange.
LEDG Boolean Read/Write Turns a SIM's green LED on when set to true. Can be combined with LEDR to make the LED look orange.
LEDRR Boolean Read/Write Turns a SIM's right red LED on when set to true. Can be combined with LEDRG to make the right LED look orange.
LEDRG Boolean Read/Write Turns a SIM's right green LED on when set to true. Can be combined with LEDRR to make the right LED look orange.
LEDLR Boolean Read/Write Turns a SIM's left red LED on when set to true. Can be combined with LEDLR to make the left LED look orange.
LEDLG Boolean Read/Write Turns a SIM's left green LED on when set to true. Can be combined with LEDLR to make the left LED look orange.
pcbTemp Temperature Read Only Value of the on-board temperature sensor if present.
tempPrecision Byte Read/Write Controls the number of bits of precision of the pcbTemperature (SHIPv4) or pcbTemp (SHIPv5) reading. A value between 0 and 8; default value is 0.
hasExtPower Boolean Read Only Reflects the status of the +5V_EXT signal on the 26-pin Baseboard connector. Reads true when power is applied.
hasUSBFPower Boolean Read Only Reflects the status of the +5V_USBF signal via the USB-Device Mini-B or the 26-pin Baseboard connector. Reads true when power is applied.
batLevel Byte Read Only Reflects the remaining percentage of the connected LiPo battery or 0 if not connected.
batStatus BAT_STATUS Read Only Reflects the status of the LiPo battery.
audioPowerGood Boolean Read Only Reports whether the platform has enough power to support the on-board audio speaker/amplifier circuitry. Reads true when the SIM is supplied with sufficient power.

see GRM