diff options
| author | Abel Tim <git@abeltim.com> | 2025-06-18 11:46:16 +0200 |
|---|---|---|
| committer | Abel Tim <git@abeltim.com> | 2025-06-18 11:46:16 +0200 |
| commit | 1c1d1f4e0401803ca4d367e4379499b6ed112dfb (patch) | |
| tree | a2a25e0d8d14906a909b53ebd3de972279ac4290 /code | |
| parent | cca1a7f02153d3c23551011effbbce449d5dc1c3 (diff) | |
| download | robotica-1c1d1f4e0401803ca4d367e4379499b6ed112dfb.tar.gz robotica-1c1d1f4e0401803ca4d367e4379499b6ed112dfb.zip | |
pre robotica commit
Multi-line description of commit,
feel free to be detailed.
Signed-off-by: Abel Tim <git@abeltim.com>
Diffstat (limited to 'code')
| -rw-r--r-- | code/main/teensy_goalie/Kconfig | 29 | ||||
| -rw-r--r-- | code/main/teensy_goalie/prj.conf | 2 | ||||
| -rw-r--r-- | code/main/teensy_goalie/src/main.c | 20 | ||||
| -rw-r--r-- | code/main/teensy_goalie/teensy41.overlay | 22 |
4 files changed, 41 insertions, 32 deletions
diff --git a/code/main/teensy_goalie/Kconfig b/code/main/teensy_goalie/Kconfig new file mode 100644 index 0000000..6d66ff8 --- /dev/null +++ b/code/main/teensy_goalie/Kconfig @@ -0,0 +1,29 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config BLINK_DELAY_SHORT + int "Blinking delay for short cycle demo" + default 100 + help + Specifies the LED on/off delay in milliseconds for short cycle + blinking demonstration. + If set to 0, the short-cycle blinking demo will not be performed. + +config BLINK_DELAY_LONG + int "Blinking delay for long cycle demo" + default 1000 + help + Specifies the LED on/off delay in milliseconds for long cycle + blinking demonstration. + If set to 0, the long-cycle blinking demo will not be performed. + +config FADE_DELAY + int "Delay time for fade demo" + default 10 + help + Specifies the delay in milliseconds for the fade demo of the + PWM-LED sample. + The brightness gradually increases by one level each time this + delay elapses. + +source "Kconfig.zephyr" diff --git a/code/main/teensy_goalie/prj.conf b/code/main/teensy_goalie/prj.conf index 8379fac..0c1e16f 100644 --- a/code/main/teensy_goalie/prj.conf +++ b/code/main/teensy_goalie/prj.conf @@ -7,3 +7,5 @@ CONFIG_PWM=y CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_PWM_LOG_LEVEL_DBG=y +CONFIG_LED=y +CONFIG_LED_PWM=y diff --git a/code/main/teensy_goalie/src/main.c b/code/main/teensy_goalie/src/main.c index 137e898..4dd3f24 100644 --- a/code/main/teensy_goalie/src/main.c +++ b/code/main/teensy_goalie/src/main.c @@ -1,17 +1,3 @@ -#include <stdio.h> -#include <zephyr/kernel.h> -#include <zephyr/sys/printk.h> -#include <zephyr/device.h> -#include <zephyr/drivers/pwm.h> -#include <zephyr/devicetree.h> -#include <zephyr/drivers/gpio.h> - -// Settings -#define PWM_PERIOD_NS 20000000 -#define PWM_PULSE_WIDTH 1400000 -static const int32_t sleep_time_ms = 100; -static const struct gpio_dt_spec btn = GPIO_DT_SPEC_GET(DT_ALIAS(powerswitch), gpios); -static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(redled), gpios); - -#define LED0_NODE DT_ALIAS(redled) -#define PWM_LED0 DT_ALIAS(en3a) +#include <zephyr.h> +#include <drivers/pwm.h> +#include <sys/printk.h> diff --git a/code/main/teensy_goalie/teensy41.overlay b/code/main/teensy_goalie/teensy41.overlay index 3b023e3..96707e8 100644 --- a/code/main/teensy_goalie/teensy41.overlay +++ b/code/main/teensy_goalie/teensy41.overlay @@ -7,13 +7,14 @@ * https://www.digikey.be/en/maker/tutorials/2025/introduction-to-zephyr-part-4-devicetree-tutorial * */ + / { aliases { powerswitch = &soft_power_switch; redled = &red_led; greenled = &green_led; bueled = &blue_led; - en3a = &pwm_dev0; + }; buttons { @@ -40,19 +41,10 @@ label = "LED Pin 16 --> BLUE"; }; }; - pwmdevs { - compatible = "imx-pwm"; - pwm_dev0: pwm_dev_0 { - pwms = <&gpio2 10>; - }; - }; - -}; -&flexpwm1 { - status = "ok"; - flexpwm1_pwm0: flexpwm1_pwm0 { - status = "ok"; + flexpwm{ + compatible = "nxp,flexio-pwm"; + test: blue-test { + label = "GPIO4_5 --> PIN3 --> Driver"; + }; }; - }; - |
