Skip to content

Commit 749252e

Browse files
Alain Volmatkartben
authored andcommitted
board: st: add joystick support on stm32l4r9i_disco
Add nodes describing the joystick arrows wired to the MFX gpio controller. Signed-off-by: Alain Volmat <[email protected]>
1 parent 03ab40f commit 749252e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,36 @@
3939
gpios = <&gpioc 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
4040
zephyr,code = <INPUT_KEY_ENTER>;
4141
};
42+
joy_up: joystick_up {
43+
label = "joystick up";
44+
gpios = <&mfx 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
45+
zephyr,code = <INPUT_KEY_UP>;
46+
};
47+
joy_down: joystick_down {
48+
label = "joystick down";
49+
gpios = <&mfx 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
50+
zephyr,code = <INPUT_KEY_DOWN>;
51+
};
52+
joy_right: joystick_right {
53+
label = "joystick right";
54+
gpios = <&mfx 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
55+
zephyr,code = <INPUT_KEY_RIGHT>;
56+
};
57+
joy_left: joystick_left {
58+
label = "joystick left";
59+
gpios = <&mfx 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
60+
zephyr,code = <INPUT_KEY_LEFT>;
61+
};
4262
};
4363

4464
aliases {
4565
led0 = &green_led;
4666
led1 = &orange_led;
4767
sw0 = &joy_sel;
68+
sw1 = &joy_up;
69+
sw2 = &joy_down;
70+
sw3 = &joy_right;
71+
sw4 = &joy_left;
4872
die-temp0 = &die_temp;
4973
volt-sensor0 = &vref;
5074
volt-sensor1 = &vbat;

0 commit comments

Comments
 (0)