boards/esp32-ethernet-kit: add button definition
Conflicts with Ethernet phy clock input. Tested with tests/saul: Dev: BOOT Type: SENSE_BTN Data: 0 Dev: BOOT Type: SENSE_BTN Data: 1 and tests/buttons: On-board button test -- Available buttons: 1 -- Try pressing buttons to test. [SUCCESS] Pressed BTN0 Pressed BTN0 Pressed BTN0
This commit is contained in:
parent
e3142c39f0
commit
b3197dea28
@ -33,6 +33,40 @@ static inline void board_init(void) {
|
|||||||
board_init_common();
|
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
|
* @name ESP32 Ethernet (EMAC) configuration
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
@ -31,6 +31,14 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
static const saul_gpio_params_t saul_gpio_params[] =
|
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
|
#ifdef __cplusplus
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user