Skip to content

Re-factor UART pin assignments. #70

@ZZ-Cat

Description

@ZZ-Cat

The situation

CRSF for Arduino defaults to Serial1 for UART.
For most targets, this means pins 0 and 1 for Rx and Tx, respectively.
This is okay if you're using Arduino or Adafruit Metro or Adafruit Feather targets, however this is problematic for targets that don't use pins 0 and 1 for UART - Especially Seeed Xiao and Adafruit QtPy boards that are built around ESP32 chipsets.

Possible solutions

Use hardware-dependent default pin-outs instead of arbitrary pin-outs

Looking at the pins_arduino.h header in each target's variants subfolder, there are references to RX and TX which set the default pin-outs for the first UART port. CRSF for Arduino could take advantage of this instead of defaulting to pins 0 and 1.

Use arbitrary UART port and pin assignments

This could effectively grant you the ability to tell CRSF for Arduino what particular pins your receiver is connected to and what UART port the pins are using. IE Customisable port and pin assignments.
The limiting factor here is the number of UART ports is hardware-dependent. Some targets have two possible UART ports, while others may have up to six possible UART configurations.

For targets that have only one UART port, you will not be able to take advantage of customisable UART pin-outs.
This is a hardware limitation that is outside the scope of CRSF for Arduino.

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions