Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fcfb669
New target: Flydragon Pro
functionpointer Nov 22, 2025
0c66d07
FlyDragon Pro: USE_DSHOT_DMAR, limit to 8 motors
functionpointer Nov 23, 2025
113f1f4
FlyDragon Pro: Add MAG support
functionpointer Dec 3, 2025
3bbc0ae
Passthrough, USB Improvements
jlpoltrack Jan 17, 2026
2773f2f
fix sitl warning
jlpoltrack Jan 20, 2026
2a28ff0
at32 lineCoding
jlpoltrack Jan 20, 2026
20bd706
msp bind message
jlpoltrack Jan 20, 2026
f3f6831
add payloads
jlpoltrack Jan 26, 2026
3228406
update cli command to send port
jlpoltrack Jan 27, 2026
4f5f37c
Merge remote-tracking branch 'origin/maintenance-9.x' into msp-bind-m…
jlpoltrack Feb 12, 2026
fef10b8
Add SIMPLIFLYH7 target
Mar 6, 2026
4ca527a
Merge pull request #11256 from jlpoltrack/feature/passthrough-encodin…
sensei-hacker Mar 7, 2026
b985960
Merge pull request #11126 from functionpointer/flydragon_pro
sensei-hacker Mar 8, 2026
bfb3f27
Fix warnings
Mar 9, 2026
d85686c
Merge pull request #11413 from iNavFlight/dzikuvx-simply-flying-h7
DzikuVx Mar 10, 2026
e0d4627
Merge pull request #11267 from jlpoltrack/msp-bind-message
sensei-hacker Mar 12, 2026
74b4aef
PINIO: add PWM duty control and unify output mode handling
sensei-hacker Feb 28, 2026
4e29b1d
Remove legacy LED pin PWM modes, consolidate PINIO PWM interface
sensei-hacker Feb 28, 2026
5097e9e
PINIO: fix operand order for backward compat, unify pinioSet/pinioSet…
sensei-hacker Mar 7, 2026
5ca5b49
pinio pwm: Settings.md small update for osd_joystick_pinio_channel
sensei-hacker Mar 8, 2026
cdc42c7
Add TIM_USE_PINIO flag and label LED/PINIO outputs in output mapping
sensei-hacker Mar 10, 2026
ec835c4
pinio/pwm: Share user-assigned pins between box modes and programming…
sensei-hacker Mar 12, 2026
15f0827
pinio/pwm: First round simplify most recent commits
sensei-hacker Mar 12, 2026
39ebba5
pinio/pwm: better integrate LED pin, simplify
sensei-hacker Mar 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/Cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ While connected to the CLI, all Logical Switches are temporarily disabled (5.1.0
| `batch` | Start or end a batch of commands |
| `battery_profile` | Change battery profile |
| `beeper` | Show/set beeper (buzzer) [usage](Buzzer.md) |
| `bind_msp_rx` | Initiate binding for MSP receivers (mLRS) |
| `bind_rx` | Initiate binding for SRXL2 or CRSF receivers |
| `blackbox` | Configure blackbox fields |
| `bootlog` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) |
Expand Down Expand Up @@ -99,6 +100,7 @@ While connected to the CLI, all Logical Switches are temporarily disabled (5.1.0
| `msc` | Enter USB Mass storage mode. See [USB MSC documentation](USB_Mass_Storage_(MSC)_mode.md) for usage information. |
| `osd_layout` | Get or set the layout of OSD items |
| `pid` | Configurable PID controllers |
| `piniopwm` | Set PINIO PWM duty cycle. See [PINIO PWM](PINIO%20PWM.md) |
| `play_sound` | `<index>`, or none for next item |
| `control_profile` | Change profile |
| `resource` | View currently used resources |
Expand Down
96 changes: 0 additions & 96 deletions docs/LED pin PWM.md

This file was deleted.

18 changes: 9 additions & 9 deletions docs/OSD Joystick.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# OSD joystick

LED pin can be used to emulate 5key OSD joystick for OSD camera pin, while still driving ws2812 LEDs (shared functionality).
A PINIO channel can be used to emulate a 5-key OSD joystick for OSD camera control.

See [LED pin PWM](LED%20pin%20PWM.md) for more details.
See [PINIO PWM](PINIO%20PWM.md) for more details.

Note that for cameras which support RuncamDevice protocol, there is alternative functionality using serial communication: [Runcam device](Runcam%20device.md)

Expand All @@ -22,17 +22,17 @@ To simulate 5key joystick, it is sufficient to generate correct voltage on camer

# Enabling OSD Joystick emulation

```set led_pin_pwm_mode=shared_high```

```set osd_joystick_enabled=on```

Also enable "Multi-color RGB LED Strip support" in Configuration tab.
```set osd_joystick_pinio_channel=<N>```

Where `<N>` is the PINIO channel (0-3) connected to the camera OSD pin.

# Connection diagram

We use LED pin PWM functionality with RC filter to generate voltage:
We use PINIO PWM with an RC filter to generate voltage:

![alt text](/docs/assets/images/ledpinpwmfilter.png "led pin pwm filter")
![alt text](/docs/assets/images/ledpinpwmfilter.png "PINIO PWM filter")

# Example PCB layout (SMD components)

Expand All @@ -48,7 +48,7 @@ If default voltages does not work with your camera model, then you have to measu
2. Measure voltages on OSD pin while each key is pressed.
3. Connect camera to FC throught RC filter as shown on schematix above.
4. Enable OSD Joystick emulation (see "Enabling OSD Joystick emulation" above)
4. Use cli command ```led_pin_pwm <value>```, value = 0...100 to find out PWM values for each voltage.
4. Use CLI command `piniopwm <channel> <value>`, value = 0...100 to find out PWM values for each voltage.
5. Specify PWM values in configuration and save:

```set osd_joystick_down=0```
Expand Down Expand Up @@ -87,7 +87,7 @@ There are 3 RC Boxes which can be used in armed and unarmed state:
- Camera 2 - Up
- Camera 3 - Down

Other keys can be emulated using Programming framework ( see [LED pin PWM](LED%20pin%20PWM.md) for more details ).
Other keys can be emulated using the Programming framework (see [PINIO PWM](PINIO%20PWM.md) for more details).

# Behavior on boot

Expand Down
93 changes: 93 additions & 0 deletions docs/PINIO PWM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# PINIO PWM

INAV provides two mechanisms for generating output signals on GPIO pins:

1. **PINIO channels (1-4)** — PWM-capable timer outputs, either defined in the target (`PINIOx_PIN`) or assigned by the user in the configurator's Output tab. Supports full 0-100% duty cycle PWM at 24 kHz.
2. **LED strip idle level (channel 0)** — The WS2812 LED strip pin can be switched between idle-LOW and idle-HIGH between LED update bursts. Binary on/off only.

## PINIO PWM channels

PINIO channels can come from two sources:

1. **Target-defined:** `PINIO1_PIN` through `PINIO4_PIN` in `target.h`. These are always available on supported boards.
2. **User-assigned:** Any timer output pad can be set to PINIO mode in the configurator's Output tab (timer_output_mode = PINIO). No target.h changes needed.

When a PINIO pin has a hardware timer, it is automatically configured as a 24 kHz PWM output. Pins without a timer fall back to GPIO on/off.

PWM duty cycle can be controlled via:
- **CLI:** `piniopwm <channel> <duty>` (channel = 1-4, duty = 0-100)
- **Programming framework:** Operation 52, Operand A = duty (0-100), Operand B = channel (1-4)
- **Mode boxes:** USER1-USER4 in the Modes tab toggle the channel on/off

Setting duty to 0 stops PWM generation (pin goes LOW, or HIGH if `PINIO_FLAGS_INVERTED` is set in target.h).

Feature can be used to drive external devices such as a VTX power switch. Setting the PWM duty cycle to 100% or 0% effectively provides a digital on/off output. It is also used to simulate [OSD joystick](OSD%20Joystick.md) to control cameras.

PWM frequency is fixed to 24kHz with duty ratio between 0 and 100%:

![alt text](/docs/assets/images/led_pin_pwm.png "PINIO PWM signal")

## Mode box and programming framework interaction

PINIO channels can be controlled by both mode boxes (Modes tab) and the programming framework (Programming tab). When both are used:

- The **programming framework** sets the duty cycle (0-100%).
- The **mode box** gates the output on or off. When the mode is active, the programmed duty is output. When inactive, the pin is driven to 0%.

If no RC channel range is assigned to the USERx mode in the Modes tab, the programming framework has exclusive uninterrupted control — the mode box does not interfere.

The default duty (before the programming framework sets a value) is 100%, so toggling a mode box without any programming gives full on/off behavior.

## LED strip idle level (channel 0)

When the LED strip feature is enabled, the WS2812 pin sends data bursts (~1 ms) every 10-20 ms. Between bursts, the pin idles at a configurable level.

The LED strip idle level is accessible as channel `0`:

- **CLI:** `piniopwm 0 <value>` — value > 0 sets idle HIGH, 0 sets idle LOW
- **Programming framework:** Operation 52, Operand A = value (>0 = HIGH, 0 = LOW), Operand B = 0

This can be used to drive a MOSFET or similar device connected to the LED pin, toggled by the programming framework based on flight mode, RC channel, GPS state, etc.

*Note: there will be a ~2 second LOW pulse on the LED pin during boot.*

### LED strip idle level timing

Normally LED pin is held low between WS2812 updates:

![alt text](/docs/assets/images/ws2811_packets.png "ws2811 packets")
![alt text](/docs/assets/images/ws2811_data.png "ws2811 data")

When idle is set HIGH, the pin is held high between updates. Total ws2812 pulse duration is ~1ms with ~9ms pauses. Connected devices should be tolerant of these brief transients.

# Channel numbering

| Channel | Target | Description |
|---------|--------|-------------|
| 0 | LED strip | Binary idle level (HIGH/LOW) |
| 1-4 | PINIO 1-4 | Full 0-100% PWM at 24 kHz |

This numbering is consistent across the CLI (`piniopwm`), programming framework (operation 52), and the `pinio_box1`-`pinio_box4` settings.

# Generating PWM/output signals from CLI

`piniopwm [channel] <duty>` — channel = 0-4, duty = 0-100

- One argument: sets LED idle level (channel 0, backward compatible)
- Two arguments: first is channel (0 = LED idle, 1-4 = PINIO), second is duty
- No arguments: stops PWM on PINIO 1

# Example of driving LED

It is possible to drive single color LED with brightness control. Current consumption should not be greater then 1-2ma, thus LED can be used for indication only.

![alt text](/docs/assets/images/ledpinpwmled.png "PINIO PWM LED")

# Example of driving powerful white LED

To drive power LED with brightness control, a MOSFET should be used:

![alt text](/docs/assets/images/ledpinpwmpowerled.png "PINIO PWM power LED")

# Programming tab example for using a PINIO channel to switch a VTX or camera on and off
![screenshot of programming tab using PINIO](/docs/assets/images/led-as-pinio.png)
2 changes: 1 addition & 1 deletion docs/Programming Framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ for complete documentation on using JavaScript to program your flight controller
| 49 | Timer | A simple on - off timer. `true` for the duration of `Operand A` [ms]. Then `false` for the duration of `Operand B` [ms]. |
| 50 | Delta | This returns `true` when the value of `Operand A` has changed by the value of `Operand B` or greater within 100ms. ( \|ΔA\| >= B ) |
| 51 | Approx Equals (A ~ B) | `true` if `Operand B` is within 1% of `Operand A`. |
| 52 | LED Pin PWM | Value `Operand A` from [`0` : `100`] PWM / PINIO generation on LED Pin. See [LED pin PWM](LED%20pin%20PWM.md). Any other value stops PWM generation (stop to allow ws2812 LEDs updates in shared modes). |
| 52 | PINIO PWM | `Operand A` = duty cycle (0-100). `Operand B` = channel (0 for LED strip idle level, 1-4 for PINIO channels). Channels 1-4 support full PWM; channel 0 is binary (>0 = HIGH). See [PINIO PWM](PINIO%20PWM.md). |
| 53 | Disable GPS Sensor Fix | Disables the GNSS sensor fix. For testing GNSS failure. |
| 54 | Mag calibration | Trigger a magnetometer calibration. |
| 55 | Set Gimbal Sensitivity | Scales `Operand A` from [`-16` : `15`]
Expand Down
8 changes: 7 additions & 1 deletion docs/Rx.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,20 @@ set rssi_channel = 0

Setting these values differently may have an adverse effects on RSSI readings.

#### CLI Bind Command
#### CLI Bind Commands

This command will put the receiver into bind mode without the need to reboot the FC as it was required with the older `spektrum_sat_bind` command.

```
bind_rx
```

This command will send a bind request to an MSP receiver on the specified port.

```
bind_msp_rx <port>
```

## MultiWii serial protocol (MSP RX)

Allows you to use MSP commands as the RC input. Up to 18 channels are supported.
Expand Down
36 changes: 18 additions & 18 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2332,16 +2332,6 @@ Used to prevent Iterm accumulation on during maneuvers. Iterm will be dampened w

---

### led_pin_pwm_mode

PWM mode of LED pin.

| Default | Min | Max |
| --- | --- | --- |
| SHARED_LOW | | |

---

### limit_attn_filter_cutoff

Throttle attenuation PI control output filter cutoff frequency
Expand Down Expand Up @@ -5072,6 +5062,16 @@ PWM value for LEFT key

---

### osd_joystick_pinio_channel

PINIO channel index (0-3) for the camera OSD control pin

| Default | Min | Max |
| --- | --- | --- |
| 0 | 0 | 3 |

---

### osd_joystick_right

PWM value for RIGHT key
Expand Down Expand Up @@ -5574,41 +5574,41 @@ Pilot name

### pinio_box1

Mode assignment for PINIO#1
Mode box assignment for PINIO channel 1

| Default | Min | Max |
| --- | --- | --- |
| `BOX_PERMANENT_ID_NONE` | 0 | 255 |
| `BOX_PERMANENT_ID_USER1` | 0 | 255 |

---

### pinio_box2

Mode assignment for PINIO#1
Mode box assignment for PINIO channel 2

| Default | Min | Max |
| --- | --- | --- |
| `BOX_PERMANENT_ID_NONE` | 0 | 255 |
| `BOX_PERMANENT_ID_USER2` | 0 | 255 |

---

### pinio_box3

Mode assignment for PINIO#1
Mode box assignment for PINIO channel 3

| Default | Min | Max |
| --- | --- | --- |
| `BOX_PERMANENT_ID_NONE` | 0 | 255 |
| `BOX_PERMANENT_ID_USER3` | 0 | 255 |

---

### pinio_box4

Mode assignment for PINIO#1
Mode box assignment for PINIO channel 4

| Default | Min | Max |
| --- | --- | --- |
| `BOX_PERMANENT_ID_NONE` | 0 | 255 |
| `BOX_PERMANENT_ID_USER4` | 0 | 255 |

---

Expand Down
Loading
Loading