Files
Misaki af5987b37b first
2026-10-27 00:34:27 +08:00

70 lines
2.3 KiB
YAML

# SPDX-License-Identifier: Apache-2.0
#
# DShot ESC 协议驱动 binding。
# 用法与 st,stm32-pwm 相同:作为 &timersX 的子节点,
# 定时器基地址 / 时钟 / 预分频都从父节点继承。
description: |
DShot digital ESC protocol output based on an STM32 timer
with DMA burst transfer (TIMx->DMAR / DCR).
Example (TIM1, 4 channels, DShot300):
&timers1 {
status = "okay";
st,prescaler = <0>;
dshot1: dshot {
compatible = "misaki,dshot";
pinctrl-0 = <&tim1_ch1_pe9 &tim1_ch2_pe11
&tim1_ch3_pa10 &tim1_ch4_pe14>;
pinctrl-names = "default";
dmas = <&dmamux1 0 15 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH)>;
dma-names = "burst";
dshot-speed = <300>;
status = "okay";
};
};
compatible: "misaki,dshot"
include: [base.yaml, pinctrl-device.yaml]
properties:
dmas:
required: true
description: |
DMA spec for the timer UPDATE request (memory -> TIMx->DMAR).
On STM32H7 the phandle points to dmamux1 (3 cells):
<&dmamux1 channel dmamux_request channel-config>
The dmamux_request cell must be the DMAMUX1 request id of TIMx_UP
(STM32H743, see RM0433 DMAMUX1 request line multiplexer table):
TIM1_UP = 15 TIM2_UP = 22 TIM3_UP = 27
TIM4_UP = 32 TIM5_UP = 59 TIM8_UP = 51
Both &dma1 and &dmamux1 must be status = "okay" in the board dts.
dma-names:
required: true
description: Must be "burst".
dshot-speed:
type: int
default: 300
enum: [150, 300, 600, 1200]
description: DShot protocol speed in kbit/s.
frame-interval-us:
type: int
default: 1000
description: |
Period at which DShot frames are (re)transmitted. ESCs expect a
continuous frame stream; 1000 us (1 kHz) is a safe default.
dshot-bidirectional:
type: boolean
description: |
Enable bidirectional DShot: after each frame the signal line is
released and the ESC's telemetry reply is captured (round-robin,
one channel per frame) and decoded into eRPM. Read it with
dshot_get_erpm(). Enable only for ESCs that are configured for
bidirectional / RPM telemetry (e.g. Bluejay).