Adafruit ILI9341 SPI for stm32duino

Working libraries, libraries being ported and related hardware
Post Reply
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Adafruit ILI9341 SPI for stm32duino

Post by ag123 »

This is an (yet another) implementation of Adafruit ILI9341 SPI lcd library for STM32duino official STM core and libmaple (roger's and steve's mainly F4) core.

I've attempted a 'multi-core' (STM official, steve's libmaple (F4) (also in roger's core F4), and roger's (F1) libmaple) implementation
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino

full story in this thread
viewtopic.php?f=50&t=895
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Adafruit ILI9341 SPI for stm32duino

Post by mrburnette »

If one display is good, two has to be better: (H/W SPI driven)
viewtopic.php?p=5789#p5789
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Adafruit ILI9341 SPI for stm32duino

Post by ag123 »

that one is nice for 2 displays :lol:
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Adafruit ILI9341 SPI for stm32duino

Post by ag123 »

just found out that what i've done in my implementation using hardware bit banding is called 'fast pin io'
if one is using the original Adafruit ILI9341 libs
you may like to explore the defines
USE_FAST_PINIO
HAS_PORT_SET_CLR
https://github.com/adafruit/Adafruit-GF ... t_SPITFT.h
https://github.com/adafruit/Adafruit-GF ... SPITFT.cpp
https://github.com/adafruit/Adafruit_ILI9341
at your own risk though. using hardware bit banding accounts for quite significant speedups toggling the CS and DC (data/command) pins.
but they fall flat the moment you use a mcu that don't have that. it just 'don't work'
cortex M3 (stm32f1xx), M4 (stm32f4xx) and higher etc have bit banding and i simply use them in my lib leaving no if defs.
if you happen to use an mcu that doesn't do bit banding with my implementation
you can try defining in Adafruit_ILI9341_STM.h

Code: Select all

/* note bit banding is used here */
	inline void dc_command() { *dc_addr = 0; } // 0
	inline void dc_data()    { *dc_addr = 1; } // 1
	inline void cs_clear()   { *cs_addr = 0; }
	inline void cs_set()     { *cs_addr = 1; }
as

Code: Select all

	inline void dc_command() { digitalWrite(_dc,0); } // 0
	inline void dc_data()    { digitalWrite(_dc,1); } // 1
	inline void cs_clear()   { digitalWrite(_cs,0); }
	inline void cs_set()     { digitalWrite(_cs,1); }
of course that is (a lot) slower, but it may at least make it work, hope it helps.
Post Reply

Return to “Libraries & Hardware”