<commit_before># Interfaces

<div class="alert"> While developing custom ODrive control code it is recommend that your motors are free to spin continuously and are not connected to a drivetrain with limited travel. </div>

The ODrive can be controlled over various ports and protocols. If you're comfortable with embedded systems development, you can also run custom code directly on the ODrive. For that refer to the [developer documentation](developer-guide.md).

### Table of contents
<!-- TOC depthFrom:2 depthTo:2 -->

- [Interfaces](#interfaces)
    - [Table of contents](#table-of-contents)
  - [Pinout](#pinout)
  - [Native Protocol](#native-protocol)
    - [Python](#python)
    - [Other languages](#other-languages)
  - [ASCII protocol](#ascii-protocol)
    - [Arduino](#arduino)
  - [Step/direction](#stepdirection)
  - [RC PWM input](#rc-pwm-input)
  - [Analog input](#analog-input)
  - [Ports](#ports)
    - [USB](#usb)
    - [UART](#uart)
  - [CAN Simple Protocol](#can-simple-protocol)

<!-- /TOC -->

## Pinout

| #  | Label         | `GPIO_MODE_DIGITAL`    | `GPIO_MODE_ANALOG_IN` | `GPIO_MODE_UART0` | `GPIO_MODE_PWM0` | `GPIO_MODE_CAN0` | `GPIO_MODE_I2C0` | `GPIO_MODE_ENC0` | `GPIO_MODE_ENC1` | `GPIO_MODE_MECH_BRAKE` |
|----|---------------|------------------------|-----------------------|-------------------|------------------|------------------|------------------|------------------|------------------|------------------------|
|  0 | _not a pin_   |                        |                       |                   |                  |                  |                  |                  |                  |                        |
|  1 | GPIO1 (+)     | general purpose        | analog input          | **UART0.TX**      | PWM0.0           |                  |                  |                  |                  | mechanical brake       |
|  2 | GPIO2 (+)     | general purpose        | analog input          | **UART0.RX**      | PWM0.1           |                  |                  |                  |                  | mechanical brake       |
|  3 | GPIO3         | general purpose        | **analog input**      |                   | PWM0.2           |                  |                  |                  |                  | mechanical brake       |
|  4 | GPIO4         | general purpose        | **analog input**      |                   | PWM0.3           |                  |                  |                  |                  | mechanical brake       |
|  5 | GPIO5         | general purpose        | **analog input** (*)  |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  6 | GPIO6 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  7 | GPIO7 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  8 | GPIO8 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  9 | M0.A          | general purpose        |                       |                   |                  |                  |                  | **ENC0.A**       |                  |                        |
| 10 | M0.B          | general purpose        |                       |                   |                  |                  |                  | **ENC0.B**       |                  |                        |<commit_msg>undo autoformatting of md file<commit_after># Interfaces

<div class="alert"> While developing custom ODrive control code it is recommend that your motors are free to spin continuously and are not connected to a drivetrain with limited travel. </div>

The ODrive can be controlled over various ports and protocols. If you're comfortable with embedded systems development, you can also run custom code directly on the ODrive. For that refer to the [developer documentation](developer-guide.md).

### Table of contents
<!-- TOC depthFrom:2 depthTo:2 -->

- [Pinout](#pinout)
- [Native Protocol](#native-protocol)
- [ASCII protocol](#ascii-protocol)
- [Step/direction](#stepdirection)
- [RC PWM input](#rc-pwm-input)
- [Ports](#ports)

<!-- /TOC -->

## Pinout

| #  | Label         | `GPIO_MODE_DIGITAL`    | `GPIO_MODE_ANALOG_IN` | `GPIO_MODE_UART0` | `GPIO_MODE_PWM0` | `GPIO_MODE_CAN0` | `GPIO_MODE_I2C0` | `GPIO_MODE_ENC0` | `GPIO_MODE_ENC1` | `GPIO_MODE_MECH_BRAKE` |
|----|---------------|------------------------|-----------------------|-------------------|------------------|------------------|------------------|------------------|------------------|------------------------|
|  0 | _not a pin_   |                        |                       |                   |                  |                  |                  |                  |                  |                        |
|  1 | GPIO1 (+)     | general purpose        | analog input          | **UART0.TX**      | PWM0.0           |                  |                  |                  |                  | mechanical brake       |
|  2 | GPIO2 (+)     | general purpose        | analog input          | **UART0.RX**      | PWM0.1           |                  |                  |                  |                  | mechanical brake       |
|  3 | GPIO3         | general purpose        | **analog input**      |                   | PWM0.2           |                  |                  |                  |                  | mechanical brake       |
|  4 | GPIO4         | general purpose        | **analog input**      |                   | PWM0.3           |                  |                  |                  |                  | mechanical brake       |
|  5 | GPIO5         | general purpose        | **analog input** (*)  |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  6 | GPIO6 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  7 | GPIO7 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  8 | GPIO8 (*) (+) | **general purpose**    |                       |                   |                  |                  |                  |                  |                  | mechanical brake       |
|  9 | M0.A          | general purpose        |                       |                   |                  |                  |                  | **ENC0.A**       |                  |                        |
| 10 | M0.B          | general purpose        |                       |                   |                  |                  |                  | **ENC0.B**       |                  |                        |
{'fraction_non_alphanumeric': 0.1554248187166507, 'fraction_numerical': 0.011766315501436584, 'mean_word_length': 0.7297681022243256, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 117, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6769942', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1568, 'n_words': 363}