blob: 75fd1127c1c6a09d06b8784e5c87450b56ec2109 [file] [edit]
# Copyright (c) 2026 NXP Semiconductors
# SPDX-License-Identifier: Apache-2.0
title: TBS CRSF
description: |
CRSF (Crossfire), originally developed by Team BlackSheep (TBS) and used by
ExpressLRS (ELRS) and others, is a bidirectional UART-based serial protocol
that can be used to receive analog joystick and switch inputs from RC
transmitters.
CRSF uses a non-inverted signal and therefore does not require an external
inverter or RX pin inversion support. It operates over a standard UART
interface (RX/TX) at 420000 baud, 8N1.
The binding allows mapping of up to 16 CRSF channels to Zephyr input events.
Each channel can be configured to generate either absolute position events
(for joysticks and sliders) or key events (for switches).
The following example shows how to configure 2 joysticks and a button using 5 channels:
&lpuart6 {
status = "okay";
crsf {
compatible = "tbs,crsf";
right_stick_x {
channel = <1>;
type = <INPUT_EV_ABS>;
zephyr,code = <INPUT_ABS_RX>;
};
right_stick_y {
channel = <2>;
type = <INPUT_EV_ABS>;
zephyr,code = <INPUT_ABS_RY>;
};
left_stick_x {
channel = <3>;
type = <INPUT_EV_ABS>;
zephyr,code = <INPUT_ABS_X>;
};
left_stick_y {
channel = <4>;
type = <INPUT_EV_ABS>;
zephyr,code = <INPUT_ABS_Y>;
};
kill_switch {
channel = <5>;
type = <INPUT_EV_KEY>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
compatible: "tbs,crsf"
include: [base.yaml, uart-device.yaml]
child-binding:
description: |
CRSF Channel to input-event-code binding
INPUT_EV_ABS & INPUT_EV_MSC gives raw input value
INPUT_EV_KEY emulates a key
properties:
channel:
type: int
required: true
description: |
CRSF input channel
min: 1
max: 16
type:
type: int
required: true
description: Input event types see INPUT_EV_CODES
zephyr,code:
type: int
required: true
description: Code to emit.