Bridge 1.1 API - GPIO Commands

Set Voltage

See Set Bus Voltage.

GPIO Configuration

  • Command Request:

    {
      "transaction_id": "1",
      "command": "gpio_config_pin",
      "params": {
        "pinNumber": "<1..6>",
        "functionality": "<DIN|DOUT>"
      }
    }
  • Responses:

    • Immediate Promise Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": true,
        "data": {
          "command": "gpio_config_pin"
        }
      }
    • Final Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": false,
        "data": {
          "is_response_to": "gpio_config_pin",
          "status": "success"
        }
      }

GPIO Read

  • Command Request:

    {
      "transaction_id": "1",
      "command": "gpio_digital_read",
      "params": {
        "pinNumber": "1..6"
      }
    }
  • Responses:

    • Immediate Promise Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": true,
        "data": {
          "command": "gpio_digital_read"
        }
      }
    • Final Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": false,
        "data": {
          "is_response_to": "gpio_digital_read",
          "status": "success",
          "logic_level": "<LOW|HIGH>"
        }
      }

GPIO Write

  • Command Request:

    {
      "transaction_id": "1",
      "command": "gpio_digital_write",
      "params": {
        "pinNumber": "<1..6>",
        "logicLevel": "<0|1>"
      }
    }
  • Responses:

    • Immediate Promise Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": true,
        "data": {
          "command": "gpio_digital_write"
        }
      }
    • Final Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": false,
        "data": {
          "is_response_to": "gpio_digital_write",
          "status": "success"
        }
      }

Configure GPIO Interruptions

  • Command Request:

    {
      "transaction_id": "1",
      "command": "gpio_set_interrupt",
      "params": {
        "pinNumber": "<1..6>",
        "edgeTrigger": "<RISING|FALLING|BOTH>"
      }
    }
  • Responses:

    • Immediate Promise Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": true,
        "data": {
          "command": "gpio_set_interrupt"
        }
      }
    • Final Response:

      {
        "transaction_id": "1",
        "status": "success",
        "type": "command_response",
        "is_promise": false,
        "data": {
          "is_response_to": "gpio_set_interrupt",
          "status": "success"
        }
      }

GPIO Interruption Notification Message

{
  "transaction_id": "0",
  "status": "success",
  "type": "notification",
  "is_promise": false,
  "data": {
    "payload": {
      "pin": "<1..6>"
    }
  }
}

Last updated