Revert "fix spi names"
This commit is contained in:
parent
02d351f898
commit
d44b7e808a
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -56,7 +56,3 @@ dkms.conf
|
|||
|
||||
# ESP-IDF build dir
|
||||
build
|
||||
|
||||
# Kconfig files
|
||||
sdkconfig
|
||||
sdkconfig.old
|
||||
|
|
|
@ -154,12 +154,34 @@ bool lvgl_spi_driver_init(int host,
|
|||
int dma_channel,
|
||||
int quadwp_pin, int quadhd_pin)
|
||||
{
|
||||
assert((0 <= host) && (SPI_HOST_MAX > host));
|
||||
int dma_chan = 0 /* SPI_DMA_DISABLED */;
|
||||
|
||||
#if defined (CONFIG_IDF_TARGET_ESP32)
|
||||
assert((SPI_HOST <= host) && (VSPI_HOST >= host));
|
||||
const char *spi_names[] = {
|
||||
"SPI_HOST", "HSPI_HOST", "VSPI_HOST"
|
||||
};
|
||||
|
||||
dma_chan = dma_channel;
|
||||
#elif defined (CONFIG_IDF_TARGET_ESP32S2)
|
||||
assert((SPI_HOST <= host) && (HSPI_HOST >= host));
|
||||
const char *spi_names[] = {
|
||||
"SPI_HOST", "", ""
|
||||
};
|
||||
|
||||
dma_chan = dma_channel;
|
||||
#elif defined (CONFIG_IDF_TARGET_ESP32C3)
|
||||
assert((SPI1_HOST <= host) && (SPI3_HOST >= host));
|
||||
const char *spi_names[] = {
|
||||
"SPI1_HOST", "SPI2_HOST", "SPI3_HOST"
|
||||
};
|
||||
|
||||
ESP_LOGI(TAG, "Configuring SPI host %s", spi_names[host]);
|
||||
dma_chan = 3 /* SPI_DMA_CH_AUTO */;
|
||||
#else
|
||||
#error "Target chip not selected"
|
||||
#endif
|
||||
|
||||
ESP_LOGI(TAG, "Configuring SPI host %s (%d)", spi_names[host], host);
|
||||
ESP_LOGI(TAG, "MISO pin: %d, MOSI pin: %d, SCLK pin: %d, IO2/WP pin: %d, IO3/HD pin: %d",
|
||||
miso_pin, mosi_pin, sclk_pin, quadwp_pin, quadhd_pin);
|
||||
|
||||
|
@ -167,16 +189,17 @@ bool lvgl_spi_driver_init(int host,
|
|||
|
||||
spi_bus_config_t buscfg = {
|
||||
.miso_io_num = miso_pin,
|
||||
.mosi_io_num = mosi_pin,
|
||||
.sclk_io_num = sclk_pin,
|
||||
.quadwp_io_num = quadwp_pin,
|
||||
.quadhd_io_num = quadhd_pin,
|
||||
.mosi_io_num = mosi_pin,
|
||||
.sclk_io_num = sclk_pin,
|
||||
.quadwp_io_num = quadwp_pin,
|
||||
.quadhd_io_num = quadhd_pin,
|
||||
.max_transfer_sz = max_transfer_sz
|
||||
};
|
||||
|
||||
ESP_LOGI(TAG, "Initializing SPI bus...");
|
||||
esp_err_t ret = spi_bus_initialize(host, &buscfg, (spi_dma_chan_t)dma_channel);
|
||||
esp_err_t ret = spi_bus_initialize(host, &buscfg, dma_chan);
|
||||
assert(ret == ESP_OK);
|
||||
|
||||
return ESP_OK != ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,9 @@ extern "C" {
|
|||
|
||||
#define ENABLE_TOUCH_INPUT CONFIG_LV_ENABLE_TOUCH
|
||||
|
||||
#if defined (CONFIG_LV_TFT_DISPLAY_SPI2_HOST)
|
||||
#if defined (CONFIG_LV_TFT_DISPLAY_SPI1_HOST)
|
||||
#define TFT_SPI_HOST SPI1_HOST
|
||||
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI2_HOST)
|
||||
#define TFT_SPI_HOST SPI2_HOST
|
||||
#elif defined (CONFIG_LV_TFT_DISPLAY_SPI3_HOST)
|
||||
#define TFT_SPI_HOST SPI3_HOST
|
||||
|
@ -84,10 +86,12 @@ extern "C" {
|
|||
#define DISP_SPI_TRANS_MODE_SIO
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_LV_TOUCH_CONTROLLER_SPI2_HOST)
|
||||
#define TOUCH_SPI_HOST SPI2_HOST
|
||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_SPI3_HOST)
|
||||
#define TOUCH_SPI_HOST SPI3_HOST
|
||||
#if defined (CONFIG_LV_TOUCH_CONTROLLER_SPI_HSPI)
|
||||
#define TOUCH_SPI_HOST HSPI_HOST
|
||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_SPI_VSPI)
|
||||
#define TOUCH_SPI_HOST VSPI_HOST
|
||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_SPI_FSPI)
|
||||
#define TOUCH_SPI_HOST FSPI_HOST
|
||||
#endif
|
||||
|
||||
/* Handle the FT81X Special case */
|
||||
|
@ -103,7 +107,7 @@ extern "C" {
|
|||
// Detect the use of a shared SPI Bus and verify the user specified the same SPI bus for both touch and tft
|
||||
#if defined (CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI) && TP_SPI_MOSI == DISP_SPI_MOSI && TP_SPI_CLK == DISP_SPI_CLK
|
||||
#if TFT_SPI_HOST != TOUCH_SPI_HOST
|
||||
#error You must specify the same SPI host (SPIx_HOST) for both display and touch driver
|
||||
#error You must specify the same SPI host (HSPI, VSPI or FSPI) for both display and touch driver
|
||||
#endif
|
||||
|
||||
#define SHARED_SPI_BUS
|
||||
|
|
|
@ -469,10 +469,13 @@ menu "LVGL TFT Display controller"
|
|||
|
||||
choice
|
||||
prompt "TFT SPI Bus." if LV_TFT_DISPLAY_PROTOCOL_SPI
|
||||
default LV_TFT_DISPLAY_SPI2_HOST
|
||||
default LV_TFT_DISPLAY_SPI3_HOST if LV_PREDEFINED_DISPLAY_TTGO && \
|
||||
!IDF_TARGET_ESP32S2
|
||||
help
|
||||
Select the SPI Bus the TFT Display is attached to.
|
||||
|
||||
config LV_TFT_DISPLAY_SPI1_HOST
|
||||
bool "SPI1_HOST"
|
||||
config LV_TFT_DISPLAY_SPI2_HOST
|
||||
bool "SPI2_HOST"
|
||||
config LV_TFT_DISPLAY_SPI3_HOST
|
||||
|
|
|
@ -67,14 +67,17 @@ menu "LVGL Touch controller"
|
|||
prompt "Touch Controller SPI Bus."
|
||||
depends on LV_TOUCH_DRIVER_PROTOCOL_SPI
|
||||
|
||||
default LV_TOUCH_CONTROLLER_SPI2_HOST
|
||||
default LV_TOUCH_CONTROLLER_SPI_VSPI if !IDF_TARGET_ESP32S2
|
||||
default LV_TOUCH_CONTROLLER_SPI_FSPI if IDF_TARGET_ESP32S2
|
||||
help
|
||||
Select the SPI Bus the touch controller is attached to.
|
||||
Select the SPI Bus the TFT Display is attached to.
|
||||
|
||||
config LV_TOUCH_CONTROLLER_SPI2_HOST
|
||||
bool "SPI2_HOST"
|
||||
config LV_TOUCH_CONTROLLER_SPI3_HOST
|
||||
bool "SPI3_HOST"
|
||||
config LV_TOUCH_CONTROLLER_SPI_HSPI
|
||||
bool "HSPI"
|
||||
config LV_TOUCH_CONTROLLER_SPI_VSPI
|
||||
bool "VSPI" if !IDF_TARGET_ESP32S2
|
||||
config LV_TOUCH_CONTROLLER_SPI_FSPI
|
||||
bool "FSPI" if IDF_TARGET_ESP32S2
|
||||
endchoice
|
||||
|
||||
menu "Touchpanel (XPT2046) Pin Assignments"
|
||||
|
@ -83,7 +86,7 @@ menu "LVGL Touch controller"
|
|||
config LV_TOUCH_SPI_MISO
|
||||
int
|
||||
prompt "GPIO for MISO (Master In Slave Out)"
|
||||
|
||||
|
||||
default 35 if LV_PREDEFINED_PINS_38V1
|
||||
default 19
|
||||
help
|
||||
|
@ -100,7 +103,7 @@ menu "LVGL Touch controller"
|
|||
|
||||
config LV_TOUCH_SPI_CLK
|
||||
int "GPIO for CLK (SCK / Serial Clock)"
|
||||
|
||||
|
||||
default 26 if LV_PREDEFINED_PINS_38V1
|
||||
default 18
|
||||
help
|
||||
|
@ -116,7 +119,7 @@ menu "LVGL Touch controller"
|
|||
|
||||
config LV_TOUCH_PIN_IRQ
|
||||
int "GPIO for IRQ (Interrupt Request)"
|
||||
|
||||
|
||||
default 27 if LV_PREDEFINED_PINS_38V4
|
||||
default 25
|
||||
help
|
||||
|
@ -213,7 +216,7 @@ menu "LVGL Touch controller"
|
|||
config LV_TOUCH_SPI_MISO
|
||||
int
|
||||
prompt "GPIO for MISO (Master In Slave Out)"
|
||||
|
||||
|
||||
default 35 if LV_PREDEFINED_PINS_38V1
|
||||
default 19 if LV_PREDEFINED_DISPLAY_ADA_FEATHERWING
|
||||
default 19
|
||||
|
@ -469,14 +472,14 @@ menu "LVGL Touch controller"
|
|||
config LV_I2C_TOUCH_PORT_0
|
||||
bool
|
||||
prompt "I2C port 0"
|
||||
help
|
||||
help
|
||||
I2C is shared peripheral managed by I2C Manager. In order to configure I2C Manager (pinout, etc.) see menu
|
||||
Component config->I2C Port Settings.
|
||||
|
||||
config LV_I2C_TOUCH_PORT_1
|
||||
bool
|
||||
prompt "I2C port 1"
|
||||
help
|
||||
help
|
||||
I2C is shared peripheral managed by I2C Manager. In order to configure I2C Manager (pinout, etc.) see menu
|
||||
Component config->I2C Port Settings.
|
||||
|
||||
|
|
Loading…
Reference in a new issue