Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@

leds {
compatible = "gpio-leds";
/* N.B. LD1 (orange) is not wired to MCU */
orange_led: led_1 {
gpios = <&mfx 0 GPIO_ACTIVE_LOW>;
label = "User LD1";
};
green_led: led_2 {
gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
label = "User LD2";
Expand All @@ -36,11 +39,36 @@
gpios = <&gpioc 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
zephyr,code = <INPUT_KEY_ENTER>;
};
joy_up: joystick_up {
label = "joystick up";
gpios = <&mfx 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
zephyr,code = <INPUT_KEY_UP>;
};
joy_down: joystick_down {
label = "joystick down";
gpios = <&mfx 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
zephyr,code = <INPUT_KEY_DOWN>;
};
joy_right: joystick_right {
label = "joystick right";
gpios = <&mfx 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
joy_left: joystick_left {
label = "joystick left";
gpios = <&mfx 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
zephyr,code = <INPUT_KEY_LEFT>;
};
};

aliases {
led0 = &green_led;
led1 = &orange_led;
sw0 = &joy_sel;
sw1 = &joy_up;
sw2 = &joy_down;
sw3 = &joy_right;
sw4 = &joy_left;
die-temp0 = &die_temp;
volt-sensor0 = &vref;
volt-sensor1 = &vbat;
Expand Down Expand Up @@ -155,6 +183,15 @@
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pg13>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_STANDARD>;

mfx: gpio@42 {
compatible = "st,mfxstm32l152";
reg = <0x42>;
ngpios = <24>;
int-gpios = <&gpioi 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
gpio-controller;
#gpio-cells = <2>;
};
};

&i2c3 {
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX gpio_mcux.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_IGPIO gpio_mcux_igpio.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_LPC gpio_mcux_lpc.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_RGPIO gpio_mcux_rgpio.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MFXSTM32L152 gpio_mfxstm32l152.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MMIO32 gpio_mmio32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx_port.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ source "drivers/gpio/Kconfig.mcux_igpio"
source "drivers/gpio/Kconfig.mcux_lpc"
source "drivers/gpio/Kconfig.mcux_rgpio"
source "drivers/gpio/Kconfig.mec5"
source "drivers/gpio/Kconfig.mfxstm32l152"
source "drivers/gpio/Kconfig.mmio32"
source "drivers/gpio/Kconfig.nct38xx"
source "drivers/gpio/Kconfig.neorv32"
Expand Down
19 changes: 19 additions & 0 deletions drivers/gpio/Kconfig.mfxstm32l152
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# MFXSTM32L152 GPIO configuration options

# Copyright (c) 2024 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0

menuconfig GPIO_MFXSTM32L152
bool "MFXSTM32L152 I2C-based GPIO chip"
default y
depends on DT_HAS_ST_MFXSTM32L152_ENABLED
select I2C
help
Enable driver for MFXSTM32L152 I2C-based GPIO chip.

config GPIO_MFXSTM32L152_INIT_PRIORITY
int "Init priority"
default 70
depends on GPIO_MFXSTM32L152
help
Device driver initialization priority.
Loading
Loading