From 9dbabd6fe91b15b54edf5bb4556963353b70ae65 Mon Sep 17 00:00:00 2001 From: Teresa Zepeda Ventura Date: Tue, 3 Dec 2024 13:29:46 -0600 Subject: [PATCH] board: adafruit: Enable PWM on the Adafruit feather This enables PWM on the Adafruit feather m4 express Signed-off-by: Teresa Zepeda Ventura --- .../adafruit_feather_m4_express-pinctrl.dtsi | 6 +++--- .../adafruit_feather_m4_express.dts | 12 ++++++++++++ .../adafruit/feather_m4_express/support/openocd.cfg | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/boards/adafruit/feather_m4_express/adafruit_feather_m4_express-pinctrl.dtsi b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express-pinctrl.dtsi index 34ddd2b858c..a96cf644f40 100644 --- a/boards/adafruit/feather_m4_express/adafruit_feather_m4_express-pinctrl.dtsi +++ b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express-pinctrl.dtsi @@ -35,10 +35,10 @@ pinmux = ; }; }; - pwm1_default: pwm1_default { + + tc0_default: tc0_default { group1 { - pinmux = , - ; + pinmux = ; }; }; diff --git a/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts index 374123bae71..a77a3d2b7ae 100644 --- a/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts +++ b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts @@ -25,6 +25,7 @@ aliases { led0 = &led0; pwm-0 = &tcc0; + pwm-1 = &tc0; }; leds { @@ -70,6 +71,17 @@ pinctrl-names = "default"; }; +&tc0 { + status = "okay"; + compatible = "atmel,sam0-tc-pwm"; + prescaler = <1024>; + #pwm-cells = <2>; + channels = <2>; + counter-size = <16>; + pinctrl-0 = <&tc0_default>; + pinctrl-names = "default"; +}; + zephyr_udc0: &usb0 { status = "okay"; pinctrl-0 = <&usb_dc_default>; diff --git a/boards/adafruit/feather_m4_express/support/openocd.cfg b/boards/adafruit/feather_m4_express/support/openocd.cfg index e17a3034afe..9990cf9036a 100644 --- a/boards/adafruit/feather_m4_express/support/openocd.cfg +++ b/boards/adafruit/feather_m4_express/support/openocd.cfg @@ -7,7 +7,7 @@ source [find target/atsame5x.cfg] # TODO(http://openocd.zylin.com/#/c/5706/): lower the clock speed to workaround # an erase timeout. -adapter_khz 500 +adapter speed 500 reset_config srst_only $_TARGETNAME configure -event gdb-attach {