spi driver for lcd interfacing

ESP_nilay
Posts: 4
Joined: Wed Dec 07, 2016 2:12 am

Re: spi driver for lcd interfacing

Postby ESP_nilay » Mon Dec 19, 2016 10:34 am

sermus wrote:
ESP_nilay wrote:Here's a driver & example code for ILI9341 using the adafruit library.
Nice to see my code is in demand. Sad to see the credits are lost.
Sorry to miss that. I have replaced the .rar and added a readme with it.

Sincere apologies, Nilay

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: spi driver for lcd interfacing

Postby rudi ;-) » Mon Jan 09, 2017 8:48 pm

Attachments
IMG_5874_s.jpg
IMG_5874_s.jpg (257.8 KiB) Viewed 16816 times
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

MartyMacGyver
Posts: 56
Joined: Sun Dec 18, 2016 9:17 pm

Re: spi driver for lcd interfacing

Postby MartyMacGyver » Wed Jan 18, 2017 7:57 am

FWIW, I've gathered Sermus' LCD "HVAC" demo - as modified here for the ESP32 - into a repo. I forked Sermus' original repo and applied and credited the changes made by Rudi, Nilay, and myself (to get it to work).

This has NOT been updated to work with the latest toolchain (it currently works with the pre-2017-01-09 esp-idf and toolchain).

https://github.com/MartyMacGyver/ESP32_Adafruit_ILI9341

sukeshak
Posts: 50
Joined: Sat Aug 19, 2017 10:20 am
Contact:

Re: spi driver for lcd interfacing

Postby sukeshak » Thu Sep 21, 2017 9:51 pm

Hi Rudi,

Is there a full library version of this using the ESP-IDF (latest SPI) for ILI9341-based 320x240 LCD ?
This spi_master sample is the only sample which works on my display under ESP-IDF.

sukeshak
Posts: 50
Joined: Sat Aug 19, 2017 10:20 am
Contact:

Re: spi driver for lcd interfacing

Postby sukeshak » Thu Sep 21, 2017 10:35 pm

Or more importantly, how do you write a PutPixel function?

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: spi driver for lcd interfacing

Postby Vader_Mester » Tue Dec 12, 2017 7:54 am

For a good library, try to use this one made by Loboris.

There is a github link in this post, and very good description on what it can do.

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

cadrjr1
Posts: 17
Joined: Thu Mar 15, 2018 6:50 pm

Re: spi driver for lcd interfacing

Postby cadrjr1 » Fri Jul 06, 2018 12:37 am

ESP_Nilay wrote:
It's based on the esp-idf official sdk, and you can directly run a make flash in the example folder attached with this reply. It's yet to be merged, hence the attachment.

Attachments

ili9341_ui.rar
(100.45 KiB) Downloaded 152 times
I have tried to "make" this and I get the following error.
Any help appreciated as I am a very novice programmer ...
R

.......
AR build/idf_test/libidf_test.a
/c/Home/esp-idf/make/component_common.mk:1: Deprecated feature: No longer necessary to include comp onent_common.mk from /c/Home/esp/40_ili9341/components/ili9341/component.mk
CC build/ili9341/Font64.o
CC build/ili9341/Font32.o
CC build/ili9341/spi_ili.o
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c: In function 'ili_init':
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c:93:11: error: 'spi_bus_config_t {aka struct <an onymous>}' has no member named 'spiq_io_num'
buscfg.spiq_io_num = PIN_NUM_MISO;
^
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c:94:11: error: 'spi_bus_config_t {aka struct <an onymous>}' has no member named 'spid_io_num'
buscfg.spid_io_num = PIN_NUM_MOSI;
^
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c:95:11: error: 'spi_bus_config_t {aka struct <an onymous>}' has no member named 'spiclk_io_num'
buscfg.spiclk_io_num = PIN_NUM_CLK;
^
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c:96:11: error: 'spi_bus_config_t {aka struct <an onymous>}' has no member named 'spiwp_io_num'
buscfg.spiwp_io_num = -1;
^
C:/Home/esp/40_ili9341/components/ili9341/spi_ili.c:97:11: error: 'spi_bus_config_t {aka struct <an onymous>}' has no member named 'spihd_io_num'
buscfg.spihd_io_num = -1;
^
make[1]: *** [/c/Home/esp-idf/make/component_wrapper.mk:286: spi_ili.o] Error 1
make: *** [C:/Home/esp-idf/make/project.mk:467: component-ili9341-build] Error 2

cadrjr1
Posts: 17
Joined: Thu Mar 15, 2018 6:50 pm

Re: spi driver for lcd interfacing

Postby cadrjr1 » Mon Jul 09, 2018 4:25 pm

MartyMacGyver wrote:FWIW, I've gathered Sermus' LCD "HVAC" demo - as modified here for the ESP32 - into a repo. I forked Sermus' original repo and applied and credited the changes made by Rudi, Nilay, and myself (to get it to work).

This has NOT been updated to work with the latest toolchain (it currently works with the pre-2017-01-09 esp-idf and toolchain).

https://github.com/MartyMacGyver/ESP32_Adafruit_ILI9341


Does anyone have a version of "HVAC Demo" that works with current Toolchain ?

R

cadrjr1
Posts: 17
Joined: Thu Mar 15, 2018 6:50 pm

Re: spi driver for lcd interfacing

Postby cadrjr1 » Tue Jul 10, 2018 10:35 am

Got this sorted.
The SPI signal names have changed. See: https://esp32.com/viewtopic.php?t=918

Modifications to spi_ili.c below:

void ili_init(spi_device_handle_t* spi_dev)
{

// SPI signal names have changed. See:
// https://esp32.com/viewtopic.php?t=918

//Initialize SPI Bus for LCD
// spi_bus_config_t buscfg;
// buscfg.spiq_io_num = PIN_NUM_MISO;
// buscfg.spid_io_num = PIN_NUM_MOSI;
// buscfg.spiclk_io_num = PIN_NUM_CLK;
// buscfg.spiwp_io_num = -1;
// buscfg.spihd_io_num = -1;


spi_bus_config_t buscfg={
.miso_io_num = PIN_NUM_MISO,
.mosi_io_num = PIN_NUM_MOSI,
.sclk_io_num = PIN_NUM_CLK,
.quadwp_io_num = -1,
.quadhd_io_num = -1
};

Who is online

Users browsing this forum: No registered users and 26 guests