Skip to content

Commit 68c1256

Browse files
ExtremeGTXgalak
authored andcommitted
[TOPIC-GPIO] drivers: gpio_esp32: update to use new GPIO API
- Updates gpio driver and device tree files to the new GPIO Config flags - Implements the new port_* APIs - Update I2C and PWM Drivers to use new GPIO config - Add esp32.overlay to gpio_basic_api test - refactor convert_int_type, regs struct - remove config_polarity - add kConfig notes Tests: - samples/basic/blinky - samples/basic/button - tests/drivers/gpio/gpio_basic_api - tests/drivers/gpio/gpio_api_1pin Board: - esp32 DevKitC V4 Note about interrupts: The ESP32 requires specifying a CPU interrupt to be used for GPIO interrupt signals. CPU interrupts can be either level or edge (or special) triggered, but not both. Please check gpio/Kconfig.esp32 for more info. Signed-off-by: Mohamed ElShahawi <[email protected]>
1 parent 4129037 commit 68c1256

File tree

6 files changed

+267
-161
lines changed

6 files changed

+267
-161
lines changed

boards/xtensa/odroid_go/odroid_go.dts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
leds {
2121
compatible = "gpio-leds";
2222
blue_led: led {
23-
gpios = <&gpio0 2 GPIO_INT_ACTIVE_HIGH>;
23+
gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
2424
label = "Status Led";
2525
};
2626
};
@@ -29,23 +29,23 @@
2929
compatible = "gpio-keys";
3030
menu_button: menu_button {
3131
label = "Menu";
32-
gpios = <&gpio0 13 GPIO_INT_ACTIVE_LOW>;
32+
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
3333
};
3434
select_button: select_button {
3535
label = "Select";
36-
gpios = <&gpio0 27 GPIO_INT_ACTIVE_LOW>;
36+
gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
3737
};
3838
a_button: a_button {
3939
label = "A";
40-
gpios = <&gpio1 0 GPIO_INT_ACTIVE_LOW>;
40+
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
4141
};
4242
b_button: b_button {
4343
label = "B";
44-
gpios = <&gpio1 1 GPIO_INT_ACTIVE_LOW>;
44+
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
4545
};
4646
start_button: start_button {
4747
label = "Start";
48-
gpios = <&gpio1 7 GPIO_INT_ACTIVE_LOW>;
48+
gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
4949
};
5050
};
5151

drivers/gpio/Kconfig.esp32

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ if GPIO_ESP32
1818
config GPIO_ESP32_IRQ
1919
int "IRQ line for ESP32 GPIO pins"
2020
default 10
21+
help
22+
Select the IRQ line to be used for GPIO interrupts.
23+
24+
Edge-triggered interrupts are supported on lines: 10, 22,
25+
28, 30.
26+
27+
Level-triggered interrupts are supported on lines: 0-5, 8,
28+
9, 12, 13, 17-21, 23-27, 31.
2129

2230
config GPIO_ESP32_0
2331
bool "ESP32 GPIO (pins 0-31)"

0 commit comments

Comments
 (0)