> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 40 Pin Low Speed Connector

The Dragonwing IQ8-EVK contains one low-speed connector (JLS1) that provides access to various GPIOs, CAN, QUPs, and other interfaces.

## Pinout

The figure below shows the default functions of the IQ-8275 EVK 40-pin LS connector.

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/40-pin-LS-details.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=28cc57f0e3d27c4f6c488d8d842dd73e" width="1639" height="1050" data-path="Ubuntu/images/peripheral-interfaces/40-pin-LS-details.png" />

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/LS-connector-functional_details.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=4b2f5975235f681668b56d5143d846d2" width="1449" height="834" data-path="Ubuntu/images/peripheral-interfaces/LS-connector-functional_details.png" />

## GPIOs

<Note>
  The following commands require root privileges. Use `sudo su` to switch to the root user.
</Note>

### Identify GPIO Subsystem Numbers

Identify the base GPIO number by running the following command and looking for `platform/f000000.pinctrl` (gpiochip4). For IQ-8275, the base is **560**.

```bash theme={null}
cat /sys/kernel/debug/gpio
```

**Example:** For LS connector Pin 5, GPIO number is 54. The GPIO subsystem number is: 560 + 54 = **614**.

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/LS-connector-subsystem_gpio.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=25c504c2b3fc0bfeecbdcec045fec543" width="921" height="893" data-path="Ubuntu/images/peripheral-interfaces/LS-connector-subsystem_gpio.png" />

### Control GPIOs via sysfs

<Steps>
  <Step title="Export the GPIO">
    ```bash theme={null}
    cd /sys/class/gpio
    echo 614 > export
    ```
  </Step>

  <Step title="Configure direction and value">
    ```bash theme={null}
    cd gpio614
    echo out > direction
    echo 1 > value
    ```

    | Attribute   | Values                              |
    | ----------- | ----------------------------------- |
    | `direction` | `in` (input), `out` (output)        |
    | `value`     | `0` (low), `1` (high)               |
    | `edge`      | `rising`, `falling`, `both`, `none` |
  </Step>

  <Step title="Unexport when done">
    ```bash theme={null}
    cd ..
    echo 614 > unexport
    ```
  </Step>
</Steps>

### GPIO Code Examples

<Tabs>
  <Tab title="C">
    Sets pin 5 as output, pin 7 as input, and loops to check the level of pin 7.

    <Steps>
      <Step title="Compile">
        ```bash theme={null}
        gcc gpio.c -o gpio
        ```
      </Step>

      <Step title="Connect pins and run">
        Short pin 5 and pin 7 with a Dupont wire.

        <Warning>
          Pay attention to pin order. Do not short power and ground pins — this may damage the board.
        </Warning>

        ```bash theme={null}
        ./gpio
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="Python">
    Install `python3-periphery`:

    ```bash theme={null}
    apt install python3-periphery
    ```

    <Steps>
      <Step title="Connect pins and run">
        Short pin 5 and pin 7 with a Dupont wire.

        <Warning>
          Pay attention to pin order. Do not short power and ground pins — this may damage the board.
        </Warning>

        ```bash theme={null}
        python3 gpio.py
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## UART

Pins 5 and 7 are configured for UART by default (GPIO lines 54 and 55, mapping to `uart12 = qup1_se5 (0xa98000)`).

Follow the [Modify serial engine node](./peripheral_interface_overview#modify-serial-engine-node) procedure to enable the UART interface. After enabling, the device node appears at `/dev/ttyHS3`.

<Tabs>
  <Tab title="Shell">
    <Steps>
      <Step title="Connect pins">
        Short pin 5 and pin 7 with a Dupont wire.
        <Warning>Do not short power and ground pins.</Warning>
      </Step>

      <Step title="Configure UART">
        ```bash theme={null}
        sudo stty -F /dev/ttyHS3 ispeed 115200 ospeed 115200
        sudo stty -F /dev/ttyHS3 115200 -echo -icanon -isig -iexten -icrnl -ixon -opost
        ```
      </Step>

      <Step title="Open two SSH terminals">
        **Terminal 1 (RX):** `sudo cat /dev/ttyHS3`

        **Terminal 2 (TX):** `echo "hello world!" > /dev/ttyHS3`
      </Step>
    </Steps>
  </Tab>
</Tabs>

## I2C

Pins 8 and 10 are configured for I2C by default (GPIO lines 32 and 33, mapping to `i2c4 = qup0_se4 (0x990000)`).

Follow the [Modify serial engine node](./peripheral_interface_overview#modify-serial-engine-node) procedure to enable the I2C interface.

```bash theme={null}
ls /dev/i2c*
sudo apt install -y i2c-tools
i2cdetect -l
i2cdetect -a -y -r 20
```

## SPI

Pins 11 and 13 are configured for SPI by default (GPIO lines 44 and 45, mapping to `spi10 = qup1_se3 (0xa8c000)`).

Follow the [Modify serial engine node](./peripheral_interface_overview#modify-serial-engine-node) procedure to enable the SPI interface.

```bash theme={null}
sudo apt install python3-spidev
```
