Skip to content

Bridge 1.1 API - SPI Commands

See #set-bus-voltage.

  • Command Request:

    {
    "transaction_id": "1",
    "command": "spi_init",
    "params": {
    {
    "mode": "<0..3>",
    "clockFrequencyInKHz": "<Unsigned Integer>",
    "bitOrder": "<MSB|LSB>",
    "bitsPerTransfer": "<8|16>",
    "chipSelect": "<0..3>",
    "chipSelectPol": "<0,1>"
    }
    }
    }
  • Responses:

    • Immediate Promise Response:

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

      {
      "transaction_id": "1",
      "status": "success",
      "type": "command_response",
      "is_promise": false,
      "data": {
      "is_response_to": "spi_init",
      "status": "success"
      }
      }
  • Command Request:

    {
    "transaction_id": "1",
    "command": "spi_config",
    "params": {
    {
    "mode": "<0..3>",
    "clockFrequencyInKHz": "<Unsigned Integer>",
    "bitOrder": "<MSB|LSB>",
    "bitsPerTransfer": "<8|16>",
    "chipSelect": "<0..3>",
    "chipSelectPol": "<0,1>"
    }
    }
    }
  • Responses:

    • Immediate Promise Response:

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

      {
      "transaction_id": "1",
      "status": "success",
      "type": "command_response",
      "is_promise": false,
      "data": {
      "is_response_to": "spi_config",
      "status": "success"
      }
      }
  • Command Request:

    {
    "transaction_id": "1",
    "command": "spi_transfer",
    "params": {
    "bytesToRead": "<Unsigned Integer>",
    "writeBuffer": "<Hex String (e.g. DEADBEEF)>"
    }
    }
    }
  • Responses:

    • Immediate Promise Response:

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

      {
      "transaction_id": "1",
      "status": "success",
      "is_promise": false,
      "data": {
      "is_response_to": "spi_transfer",
      "status": "success",
      "payload_length": <Unsigned Integer>,
      "data": <Array of 2-Byte Hex String (e.g. "DE", "AD", "BE", "EF")>}
      }
      }