diff --git a/boards/esp32-ethernet-kit-v1_0/include/board.h b/boards/esp32-ethernet-kit-v1_0/include/board.h index aee0421aa8..980865e8c7 100644 --- a/boards/esp32-ethernet-kit-v1_0/include/board.h +++ b/boards/esp32-ethernet-kit-v1_0/include/board.h @@ -33,6 +33,40 @@ static inline void board_init(void) { board_init_common(); } +#if !MODULE_ESP_ETH || DOXYGEN +/** + * @name Button pin definitions + * @{ + */ +/** + * @brief Default button GPIO pin definition + * + * The button is only available when Ethernet is not used, as is shares its pin + * with the Phy clock. + */ +#define BTN0_PIN GPIO0 + +/** + * @brief Default button GPIO mode definition + * + * Since the GPIO of the button is pulled up with an external resistor, the + * mode for the GPIO pin has to be GPIO_IN. */ +#define BTN0_MODE GPIO_IN + +/** + * @brief Default interrupt flank definition for the button GPIO + */ +#ifndef BTN0_INT_FLANK +#define BTN0_INT_FLANK GPIO_FALLING +#endif + +/** + * @brief Definition for compatibility with previous versions + */ +#define BUTTON0_PIN BTN0_PIN +/** @} */ +#endif /* !MODULE_ESP_ETH || DOXYGEN */ + /** * @name ESP32 Ethernet (EMAC) configuration * @{ diff --git a/boards/esp32-ethernet-kit-v1_0/include/gpio_params.h b/boards/esp32-ethernet-kit-v1_0/include/gpio_params.h index 64dd0fcd8f..865b9071a2 100644 --- a/boards/esp32-ethernet-kit-v1_0/include/gpio_params.h +++ b/boards/esp32-ethernet-kit-v1_0/include/gpio_params.h @@ -31,6 +31,14 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { +#ifndef MODULE_ESP_ETH + { + .name = "BOOT", + .pin = BTN0_PIN, + .mode = BTN0_MODE, + .flags = SAUL_GPIO_INVERTED + }, +#endif }; #ifdef __cplusplus