ESP_Greg wrote:Hi Nilay,
Thank you for your sharing.
I download this firmware to ESP_wrover, but no response. Is it supposed to run on ESP_wrover? Or I should use another board?
hi ESP_Greg,
cause i get last days one of the fantastic ESP-WRover Kits from
Santa Claus
https://twitter.com/eMbeddedHome/status ... 8278486016
( test on DevKitC )
https://twitter.com/eMbeddedHome/status ... 6283441152
i can test and help you
( thanks @espressif )
no sure what fail in your ESP_WRover
first, see the shema of the ESP_WRover Board
- shema_.png (45.38 KiB) Viewed 24756 times
then change the code in the Header File "Adafruit_ILI9341_fast_as.h"
to the ESP_WRover Kit Shema:
DC Data ( Gpio 21 on Wrover )
Backlight BKL ( GPIO 5 on Wrover and swap 0,1 )
RST Pin ( GPIO 18 on WRover )
Code: Select all
// orig
// #define TFT_DC_DATA GPIO_OUTPUT_SET(25, 1)
// #define TFT_DC_COMMAND GPIO_OUTPUT_SET(25, 0)
// #define TFT_DC_INIT PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO25_U, FUNC_GPIO25_GPIO25); TFT_DC_DATA
/* changed rudi */
#define TFT_DC_DATA GPIO_OUTPUT_SET(21, 1)
#define TFT_DC_COMMAND GPIO_OUTPUT_SET(21, 0)
#define TFT_DC_INIT PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO21_U, FUNC_GPIO21_GPIO21); TFT_DC_DATA
// orig
// #define TFT_BKL_INIT gpio_set_direction(GPIO_NUM_16,GPIO_MODE_OUTPUT);TFT_BKL_ON
// #define TFT_BKL_ON gpio_set_level(GPIO_NUM_16,1)
// #define TFT_BKL_OFF gpio_set_level(GPIO_NUM_16,0)
/* changed rudi */
#define TFT_BKL_INIT gpio_set_direction(GPIO_NUM_5,GPIO_MODE_OUTPUT);TFT_BKL_ON
#define TFT_BKL_ON gpio_set_level(GPIO_NUM_5,0) // Important - here was 0,1 swap so your screen is now light
#define TFT_BKL_OFF gpio_set_level(GPIO_NUM_5,1) // Important - here was 0,1 swap so your screen is now light
// orig
// #define TFT_RST_ACTIVE GPIO_OUTPUT_SET(17, 0)
// #define TFT_RST_DEACTIVE GPIO_OUTPUT_SET(17, 1)
// #define TFT_RST_INIT PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO17_U, FUNC_GPIO17_GPIO17); TFT_RST_DEACTIVE
/* changed rudi */
#define TFT_RST_ACTIVE GPIO_OUTPUT_SET(18, 0)
#define TFT_RST_DEACTIVE GPIO_OUTPUT_SET(18, 1)
#define TFT_RST_INIT PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO18_U, FUNC_GPIO18_GPIO18); TFT_RST_DEACTIVE
next step: driver hspi.c
change the Pins for HSPI like ESP-WRover used the pins for HSPI
Code: Select all
void hspi_init(void)
{
/*GPIO Inits according to Dev board for ILI9341*/
spi_fifo = (uint32_t*)SPI_W0_REG(HSPI); //needed?
// orig
// PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO19_U, 2);
// PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO23_U, 2);
// PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO18_U, 2);
// PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO5_U, 2);
/* changed rudi */
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO25_U, 2); //MISO GPIO19 // -> 25
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO23_U, 2); //MOSI GPIO23 // -> 23
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO19_U, 2); //CLK GPIO18 // -> 19
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO22_U, 2); //CS GPIO5 // -> 22
// orig
// gpio_matrix_in(GPIO_NUM_19, HSPIQ_IN_IDX,0);
// gpio_matrix_out(GPIO_NUM_23, HSPID_OUT_IDX,0,0);
// gpio_matrix_out(GPIO_NUM_18, HSPICLK_OUT_IDX,0,0);
/* changed rudi */
gpio_matrix_in(GPIO_NUM_25, HSPIQ_IN_IDX,0);
gpio_matrix_out(GPIO_NUM_23, HSPID_OUT_IDX,0,0);
gpio_matrix_out(GPIO_NUM_19, HSPICLK_OUT_IDX,0,0);
// orig
// gpio_matrix_out(GPIO_NUM_5, HSPICS0_OUT_IDX,0,0);
/* changed rudi */
gpio_matrix_out(GPIO_NUM_22, HSPICS0_OUT_IDX,0,0);
spi_attr_t hSpiAttr;
hSpiAttr.mode = SpiMode_Master;
hSpiAttr.subMode = SpiSubMode_0;
hSpiAttr.speed = SpiSpeed_20MHz;
hSpiAttr.bitOrder = SpiBitOrder_MSBFirst;
hSpiAttr.halfMode = SpiWorkMode_Half;
spi_init(HSPI, &hSpiAttr);
}
next step:
dump your Firmware from ESP-WRover before you flash with new firmware
flash your ESP-WRover with the example and smile
- ESP_WRover_Nilay_HSPI_.png (758.33 KiB) Viewed 24756 times
@ESP-Nilay
thank you. good work! honest good work
two things for proposal:
-> make pins as user friendly define and use menuconfig for the PINS example
see blink example how user can set gpio in menuconfig
-> more from you
( great worker! )
btw: You are a candidate for "ESP_ " cause your Member start with "ESP_ "
like your work - good candidate
hope this helps
thanks again for ESP_WRover Kit espressif!
best wishes
rudi