From e3636114df0c957ba320af04b8b8aa0bd2fd921d Mon Sep 17 00:00:00 2001 From: Wojciech Tatarski Date: Tue, 4 Feb 2020 11:33:48 +0100 Subject: [PATCH] boards: quick_feather: enable GPIO driver Enable GPIO driver for Quick Feather board. Co-authored-by: Jan Kowalewski Signed-off-by: Wojciech Tatarski Signed-off-by: Jan Kowalewski --- boards/arm/quick_feather/doc/index.rst | 2 ++ boards/arm/quick_feather/quick_feather.dts | 36 +++++++++++++++++++ .../arm/quick_feather/quick_feather_defconfig | 3 ++ 3 files changed, 41 insertions(+) diff --git a/boards/arm/quick_feather/doc/index.rst b/boards/arm/quick_feather/doc/index.rst index d22dee5f22f..893f321deaf 100644 --- a/boards/arm/quick_feather/doc/index.rst +++ b/boards/arm/quick_feather/doc/index.rst @@ -42,6 +42,8 @@ features: +===========+============+=====================================+ | UART | on-chip | serial port | +-----------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+-------------------------------------+ The default configuration can be found in the Kconfig file :zephyr_file:`boards/arm/quick_feather/quick_feather_defconfig`. diff --git a/boards/arm/quick_feather/quick_feather.dts b/boards/arm/quick_feather/quick_feather.dts index d393fc62e2e..63b93160e29 100644 --- a/boards/arm/quick_feather/quick_feather.dts +++ b/boards/arm/quick_feather/quick_feather.dts @@ -18,12 +18,48 @@ zephyr,uart-pipe = &uart0; }; + aliases { + led0 = &blue_led; + led1 = &green_led; + led2 = &red_led; + sw0 = &button0; + }; + + leds { + compatible = "gpio-leds"; + blue_led: led_0 { + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + label = "LED 0"; + }; + + green_led: led_1 { + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + label = "LED 1"; + }; + + red_led: led_2 { + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + label = "LED 2"; + }; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "User Push Button 0"; + }; + }; }; &cpu0 { clock-frequency = <61440000>; }; +&gpio { + status = "okay"; +}; + &uart0 { status = "okay"; current-speed = <115200>; diff --git a/boards/arm/quick_feather/quick_feather_defconfig b/boards/arm/quick_feather/quick_feather_defconfig index 360c5fee9ef..7e0ffb9e08a 100644 --- a/boards/arm/quick_feather/quick_feather_defconfig +++ b/boards/arm/quick_feather/quick_feather_defconfig @@ -26,3 +26,6 @@ CONFIG_XIP=n CONFIG_FLASH=n CONFIG_FLASH_SIZE=0 CONFIG_FLASH_BASE_ADDRESS=0x0 + +# GPIO +CONFIG_GPIO=y