Spi interface. How does it work?
-
I have recently purchased and onion omega, and am looking to connect a screen to it. The screen I like so far can be found here:
http://www.buydisplay.com/default/serial-qvga-2-2-inch-tft-spi-240x320-lcd-touch-display-module-ili9341
How would I connect this to the onion? I believe I can,use 4 of the GPIO's as clock/input/output, but I am,not sure how to do,that. Can anyone enlighten me?
-
@Daniel-Jones What I believe you need to access SPI is some (or all) of the following kernel modules obtainable from opkg (they may already be installed by default):
- kmod-spi-bitbang
- kmod-spi-dev
- kmod-spi-gpio
- kmod-spi-gpio-custom
However, I know nothing about there use and you would need to research these.
-
@Daniel-Jones Yep, @Kit-Bishop is correct and those packages are already included in the Omega's firmware:
root@Omega-2537:/# opkg list-installed | g spi kmod-spi-bitbang - 3.18.23-1 kmod-spi-dev - 3.18.23-1 kmod-spi-gpio - 3.18.23-1 kmod-spi-gpio-custom - 3.18.23-1
Expect a C library on for using the SPI bus in the next week or so.
-
@Daniel-Jones Took a little longer than expected, but SPI library is done!
All the info can be found on our wiki:
https://wiki.onion.io/Documentation/Libraries/SPI-Library
https://wiki.onion.io/Tutorials/Using-SPIhappy hacking!
-
@Lazar-Demin have you been following the other Omega2 forum thread on SPI behavior? There are two problems:
-
- Upstream OpenWRT/LEDE driver for the MT76xx SPI (spi-mt7621.c) needs a work-around for a bug in the MT76xx SPI - loses MSB of first byte in transfer
- 1a. The upstream driver really needs to process transfers greater than 16 bytes (hardware limitation of MT76xx SPI) in chunks of 16 bytes in the driver. Right now the driver returns an error for a transfer larger then 16 bytes.
Ideally a patch for the driver is required; one such patch has been provided on the MT7688 forum at Mediatek Labs.
-
-
-
@Dana-Myers114 said in Spi interface. How does it work?:
Ideally a patch for the driver is required; one such patch has been provided on the MT7688 forum at Mediatek Labs.
I included the patch in my custom images, see https://community.onion.io/topic/1560/spi-pins-for-the-omega2/21
The patch requires testing.
-
@WereCatf I was looking for the patch itself to see how it compares with what I came up with.