Getting an ILI9341 SPI screen working on the RaspberryPI
The screen is identical to the one made by ElecFreaks (This one!).
Although I got mine really cheap from eBay….
|Display||Driver gpio name||Raspberry Pi||Remark|
|MISO||Used by SD-card|
|SDCS||SD-card Chip Select|
Aside from a normal SPI connection, please notice the BL(led), RST(reset) and D/C(dc) pins since these will be used as parameters for the module.
Once you have everything hooked up, compiled and installed you can test out the screen by loading the module:
sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:25,dc:24,led:18 speed=16000000 rotate=90 bgr=1
If you change one of the pins above, please change the gpios parameter accordingly.
Also, you have the rotate option to put the screen in landscape mode, by default it will be in portrait mode.
The bgr=1 option is to exchange the blue and red colors, by default the colors don’t appear correctly and this option is necessary.
Once you load the module nothing will happen on your screen (this made think it wasn’t working…) you can test it out by either sending the console to the framebuffer with:
con2fbmap 1 1
(it means, send console 1 to framebuffer 1)
or using X
If you want to make the module load automatically, add the following line to /etc/modules:
fbtft_device custom name=fb_ili9341 gpios=reset:25,dc:24,led:18 speed=16000000 rotate=90 bgr=1
EDIT: For the built-in version, you can add this to the kernel command line:
fbtft_device.name=fb_ili9341 fbtft_device.gpios=reset:25,dc:24,led:18 fbtft_device.speed=16000000 fbtft_device.rotate=90 fbtft_device.bgr=1 fbtft_device.custom=1
Hope you find this useful.