wip: stepper

This commit is contained in:
2025-11-26 15:12:10 +01:00
parent e364ae83ec
commit 0ff1ab4b88
5 changed files with 83 additions and 2 deletions

View File

@@ -4,6 +4,8 @@
led1 = &yellow_led_1;
led2 = &green_led_1;
rotenc0 = &as5600;
stepper0 = &stepper0;
servo0 = &pwm_servo0;
};
@@ -17,6 +19,19 @@
};
};
stepper0: tmc2209_motor {
compatible = "adi,tmc2209";
en-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
msx-gpios = <&gpiod 0 GPIO_ACTIVE_HIGH>,
<&gpiod 1 GPIO_ACTIVE_HIGH>;
step-gpios = <&gpioe 6 GPIO_ACTIVE_HIGH>;
dir-gpios = <&gpioe 5 GPIO_ACTIVE_HIGH>;
//dual-edge-step;
micro-step-res = <64>;
counter = <&counter6>;
status = "okay";
};
};
&uart4 {
@@ -38,6 +53,15 @@
status = "okay";
};
&timers6 {
status = "okay";
st,prescaler = <25>;
counter6: counter {
status = "okay";
};
};
&timers5 {
status = "okay";
st,prescaler = <7>;
@@ -56,4 +80,16 @@
pinctrl-0 = <&tim4_ch3_pb8>;
pinctrl-names = "default";
};
};
};
&i2c2 {
status = "okay";
pinctrl-0 = <&i2c2_scl_pf1 &i2c2_sda_pf0>;
pinctrl-names = "default";
as5600: as5600@36 {
compatible = "ams,as5600";
reg = <0x36>; // I2C address of AS5600
label = "AS5600";
};
};