1# Copyright (c) 2024 NXP Semiconductors
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  SBUS input driver using
6  This driver implements the SBUS protocol used on RC radio's
7  to send out analogue joystick and switches output.
8  SBUS is an single-wire inverted serial protocol so either you need to use
9  the rx-invert feature of your serial driver or use an external signal inverter.
10  The driver binds this to the Zephyr input system using INPUT_EV_CODES.
11
12  The following examples defines a binding of 2 joysticks and a button using 5 channels.
13
14  &lpuart6 {
15    status = "okay";
16
17    sbus {
18        compatible = "futaba,sbus";
19        right_stick_x {
20            channel = <1>;
21            type = <INPUT_EV_ABS>;
22            zephyr,code = <INPUT_ABS_RX>;
23        };
24        right_stick_y {
25            channel = <2>;
26            type = <INPUT_EV_ABS>;
27            zephyr,code = <INPUT_ABS_RY>;
28        };
29        left_stick_x {
30            channel = <3>;
31            type = <INPUT_EV_ABS>;
32            zephyr,code = <INPUT_ABS_X>;
33        };
34        left_stick_y {
35            channel = <4>;
36            type = <INPUT_EV_ABS>;
37            zephyr,code = <INPUT_ABS_Y>;
38        };
39        kill_switch {
40            channel = <5>;
41            type = <INPUT_EV_KEY>;
42            zephyr,code = <INPUT_KEY_0>;
43        };
44    };
45  };
46
47compatible: "futaba,sbus"
48
49include: [base.yaml, uart-device.yaml]
50
51child-binding:
52  description: |
53    SBUS Channel to input-event-code binding
54    INPUT_EV_ABS & INPUT_EV_MSC gives raw input value
55    INPUT_EV_KEY emulates a key
56  properties:
57    channel:
58      type: int
59      required: true
60      description: |
61        SBUS input channel
62        Valid range: 1 - 16
63    type:
64      type: int
65      required: true
66      description: Input event types see INPUT_EV_CODES
67    zephyr,code:
68      type: int
69      required: true
70      description: Code to emit.
71