Jetson GPIO Pin Read

Reads a GPIO pin and inserts its state and delta as customizable metadata entries.

Overview

Read GPIO pins on Jetson devices.

Inputs & Outputs

  • Inputs : 1, Media Format : Any
  • Outputs : 1, Media Format: Same as Input
  • Output Metadata : See below.

Properties

PropertyDescriptionTypeDefaultRequired
gpio_pin_nameComma separated list of GPIO pin names in the kernel naming scheme. The pins will be configured in the IN direction.stringnullYes
metadata_nameCustomizable name for the values read from the specified GPIO pin. This will be accessible in downstream metadata, with 'delta' and 'state' fields. Alphanumeric characters and underscores only.stringnullYes
activityPin activity mode. Options: Active high (high): For raw wire signal; Active low (low): For pins with inverted logic.enumhighYes

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
nodes.<node_id>.all_pin_deltabooleanWhen all pins have a change in state
nodes.<node_id>.all_pin_statebooleanBoolean indicating whether all configured input pins are active.
nodes.<node_id>.any_pin_deltabooleanWhen any pin has a change in state
nodes.<node_id>.any_pin_statebooleanBoolean indicating whether any configured input pin is active.
nodes.<node_id>.pins.<pin_or_metadata_name>.deltaintegerWhen the specified pin has a change in state
nodes.<node_id>.pins.<pin_or_metadata_name>.stateintegerCurrent numeric state reported for this input pin.
nodes.<node_id>.typestringIdentifies the node type that produced this metadata.

JSON example

{
  "nodes": {
    "gpio_read1": {
      "all_pin_delta": 1,
      "all_pin_state": 1,
      "any_pin_delta": 0,
      "any_pin_state": 0,
      "pins": {
        "pin_or_metadata_name": {
          "delta": 1,
          "state": 0
        }
      },
      "type": "gpio_read"
    }
  }
}

PIN Names

This node refers to pins using their kernel-assigned names, e.g. PQ.01, PAA.16, etc.

AIMobile

AIMobile Jetson NX (NCX1), Orin Nano and NX Devices (NCOX, NCON)

For these devices, there two exposed DIO pin that can be configured in Output direction on the xcon devices (Orin Nano 4/8GB, Orin NX 8/16GB). The pin mapping is below.

PIN Identifier (see image below)GPIO Pin Name
GPIO1PQ.05
GPIO2PQ.06
CN30 Connector, Pins Numbered 1 through 15 sequentially starting from top left.

GPIO1 and GPIO2 are the two pins exposed on AIMobile device.

AIMobile Orin Multi-IO Devices (PSOX, PSON)

PIN Identifier (see image below)GPIO Pin NameNotes
DI1PZ.03Input only
DI2PZ.04Input only
DI3PZ.05Input only
DI4PZ.06Input only
DO1PY.00Output only
DO2PY.01Output only
DO3PY.02Output only
DO4PY.03Output only
DI 1-4 and DO 1-4 are the pins exposed on the PSON and PSOX devices.

DI 1-4 and DO 1-4 are the pins exposed on the PSON and PSOX devices.

Aaeon

Aaeon Boxer 8652AI

For the Aaeon Boxer 6852AI - Orin devices, there 13 exposed DIO pin that can be configured. The pin mapping is below.

CN30 Connector, Pins Numbered 1 through 15 sequentially starting from top left.

CN30 Connector, Pins Numbered 1 through 15 sequentially starting from top left.

Pin NumberGPIO Pin Name (for Node)Function
1VDD_3V.3_SYS
2PY.0237P_SPI1_MOSI_LS
3PY.0122P_SPI1_MISO_LS
4PY.0013P_SPI1_SCK_LS
5PY.0318P_SPI1_CS0_LS
6PZ.0519P_SPI0_MOSI_LS
7PZ.0421P_SPI0_MISO_LS
8PZ.0323P_SPI0_SCK_LS
9PZ.0624P_SPI0_CS0_LS
10PZ.0726P_SPI0_CS1_LS
11PI.0235P_I2S0_LRCK_LS
12PI.0138P_I2S0_SDIN_LS
13PI.0040P_I2S0_SDOUT_LS
14PH.0712P_I2S0_SCLK_LS
15GND

Did this page help you?