Hi,
I'm running a stm32 board and I want to use 2 PWMs and 1 qenc on the same timer. But I can't figure out how that is setup properly in the DTS.
Below is what I got at the moment. It builds without warnings, and if i remove the qenc part the pwms starts to work as expected.
Anyone have som pointers? All examples are always just to test one single driver or sensor.
my_board.dts
&timers3 {
status = "okay";
pwm_t3_ch3_ch4: pwm {
status = "okay";
pinctrl-0 = <&tim3_ch3_pc8 &tim3_ch4_pc9>;
pinctrl-names = "default";
};
upper_shutter_enc: qdec {
status = "okay";
pinctrl-0 = <&tim3_ch1_pb4 &tim3_ch2_pb5>;
pinctrl-names = "default";
//st,input-polarity-inverted;
st,input-filter-level = <NO_FILTER>;
st,counts-per-revolution = <0xffffffff>;
};
};
zephyr.dts (resulting dts)
timers3: timers@40000400 {
compatible = "st,stm32-timers";
reg = < 0x40000400 0x400 >;
clocks = < &rcc 0x40 0x2 >;
resets = < &rctl 0x401 >;
interrupts = < 0x1d 0x0 >;
interrupt-names = "global";
st,prescaler = < 0x0 >;
status = "okay";
pwm_t3_ch3_ch4: pwm {
compatible = "st,stm32-pwm";
status = "okay";
#pwm-cells = < 0x3 >;
pinctrl-0 = < &tim3_ch3_pc8 &tim3_ch4_pc9 >;
pinctrl-names = "default";
phandle = < 0x26 >;
};
counter {
compatible = "st,stm32-counter";
status = "disabled";
};
upper_shutter_enc: qdec {
compatible = "st,stm32-qdec";
status = "okay";
st,input-filter-level = < 0x0 >;
pinctrl-0 = < &tim3_ch1_pb4 &tim3_ch2_pb5 >;
pinctrl-names = "default";
st,counts-per-revolution = < 0xffffffff >;
};
};
Regards,
Eric