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
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,24 @@ is printed because the upstream default targets rev >= 3.0.
Configurations
==============

gpio
----

This is a test for the GPIO driver. It uses GPIO2 as output and
GPIO3 as an interrupt pin.

At the nsh, we can turn the outputs on and off with the following::

nsh> gpio -o 1 /dev/gpio0
nsh> gpio -o 0 /dev/gpio0

We can use the interrupt pin to send a signal when the interrupt fires::

nsh> gpio -w 1 /dev/gpio1

The pin is configured as a rising edge interrupt, so after issuing the
above command, connect it to 3.3V.

lvgl_demo
---------

Expand Down
13 changes: 13 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-tab5/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@
# define TAB5_MIPI_DSI_LANE_BITRATE_MBPS 965
#endif

/* GPIOs available on the M5-Bus connector */

#define TAB5_GPIO_MBUS_3 3
#define TAB5_GPIO_MBUS_2 2
#define TAB5_GPIO_MBUS_47 47

#define TAB5_GPIO_MBUS_16 16
#define TAB5_GPIO_MBUS_45 45
#define TAB5_GPIO_MBUS_4 4
#define TAB5_GPIO_MBUS_48 48
#define TAB5_GPIO_MBUS_35 35
#define TAB5_GPIO_MBUS_51 51

/* Touch - ST7121/ST7123 TDDI @0x55 (NOT implemented; INT GPIO23). Older
* ILI9881 units used GT911 @0x14 on the same INT pin.
*/
Expand Down
4 changes: 4 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-tab5/src/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ifeq ($(CONFIG_BOARDCTL),y)
endif
endif

ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += esp32p4_gpio.c
endif

DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
18 changes: 18 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-tab5/src/esp32p4-tab5.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@

int esp_bringup(void);

/****************************************************************************
* Name: esp_gpio_init
*
* Description:
* Configure the GPIO driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK).
*
****************************************************************************/

#ifdef CONFIG_DEV_GPIO
int esp_gpio_init(void);
#endif

#ifdef CONFIG_ESP32P4_TAB5_LCD_POWER

/****************************************************************************
Expand Down
10 changes: 10 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-tab5/src/esp32p4_bringup.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ int esp_bringup(void)
}
#endif

#ifdef CONFIG_DEV_GPIO
/* Configure the GPIO driver */

ret = esp_gpio_init();
if (ret < 0)
{
syslog(LOG_ERR, "Failed to initialize GPIO driver: %d\n", ret);
}
#endif

#ifdef CONFIG_ESP32P4_TAB5_IOEXPANDER
/* Initialize the IO expanders */

Expand Down
Loading
Loading