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

PropertyValue
gpio_pin_nameLinux exported GPIO pin names. Multiple, comma separated values are allowed. Examples of pin names are e.g. PY.00, PZ.01
metadata_nameA customizable name for the values read from the specified GPIO pin. Multiple, comma separated values are allowed. This will be accessible in downstream metadata, with delta and state fields. Number of metadata_names should match the number of gpio_pin_names. Only alphanumeric characters and underscores are allowed.
activityActivity mode of the pin. For raw wire signal, use 'high' (default). If the pin's logic is inverted, use 'low'.

Metadata

Access this metadata using the Function Node or using the API, from the snapshot or clip saved downstream of this node.

Metadata PropertyDescription
<node_id>.node_typegpio_read
<node_id>.all_pin_deltaTrue if all pin's have a non zero delta value ie. have changed since the last frame.
<node_id>.all_pin_stateLogical AND across all monitored pins
<node_id>.any_pin_deltaTrue if any pin's have a non zero delta value ie have changed since the last frame.
<node_id>.any_pin_stateLogical OR across all monitored pins
<node_id>.pins.<metadata_name>.deltaChange in the state of a single pin identified by metadata_name.
<node_id>.pins.<metadata_name>.stateState of a single pin identified by metadata_name.
"nodes": {
  "[node_id]": {
    "node_type": "gpio_read",
    "all_pin_delta": 1,
    "all_pin_state": 0,
    "any_pin_delta": 1,
    "any_pin_state": 0,
    "pins": {
      "[_metadata_name]": {
        "delta": 1,
        "state": 0
      }
    }
  }
}

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 IdentifierGPIO Pin Name (use in Node)Function
1-VDD_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
15-GND