boards: add gpio, button and led support
Add gpio support for STM32MP257F-EV1 board. Add the orange (&led0) LED to the device tree and enable GPIOJ. Add the user button USER2 to the device tree and enable GPIOG. This step allows building and debugging the blinky and button sample applications. Signed-off-by: Youssef Zini <youssef.zini@savoirfairelinux.com>
This commit is contained in:
parent
1a7bac5b19
commit
8bfb08fbda
2 changed files with 37 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
/dts-v1/;
|
||||
#include <st/mp2/stm32mp257_m33.dtsi>
|
||||
#include <st/mp2/stm32mp257faix-pinctrl.dtsi>
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP257F-EV1 board";
|
||||
|
@ -15,8 +17,40 @@
|
|||
zephyr,flash = &ddr_code;
|
||||
zephyr,sram = &ddr_sys;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
orange_led_3: led_3 {
|
||||
gpios = <&gpioj 6 GPIO_ACTIVE_HIGH>;
|
||||
label = "LD3";
|
||||
};
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
button_user2: button2 {
|
||||
label = "User 2";
|
||||
gpios = <&gpiog 8 GPIO_ACTIVE_LOW>;
|
||||
zephyr,code = <INPUT_KEY_0>;
|
||||
};
|
||||
};
|
||||
|
||||
aliases {
|
||||
led0 = &orange_led_3;
|
||||
sw0 = &button_user2;
|
||||
};
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clock-frequency = <DT_FREQ_M(400)>;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -4,5 +4,8 @@
|
|||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# Enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Enable HW stack protection
|
||||
CONFIG_HW_STACK_PROTECTION=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue