I have a TFT 3.5" display with a il9486 controller that a friend let me borrow to use with my PocketBeagle. I want to use the fbtft driver in order to display an X11 application on it. I have looked around but can only find older implementations of this combination that describe using the capemgr and overlays to get it to work on the PocketBeagle. As far as I can tell the capemgr is replaced by uBoot but then it seems the overlays are now replaced by config-pin.
The overlays I have found seem to be meant to configure and enable the spi device and its pins. However, the PocketBeagle with the latest image (4.14.108-ti-r124) seems to come with the spi0 device already available and configured out of the box. At least some documentation I have found indicated this and the devices are listed in the /dev folder right after boot-up:
Code: Select all
debian@beaglebone:~$ ls /dev/spi*
/dev/spidev1.0 /dev/spidev2.0 /dev/spidev2.1
/dev/spi:
0.0 1.0 1.1
Code: Select all
debian@beaglebone:~/testSPI$ more testSPI.py
#!/bin/python3
import Adafruit_BBIO
import Adafruit_BBIO.SPI as SPI
from Adafruit_BBIO.SPI import SPI
# /dev/spidev1.0
spi = SPI(1, 0)
print(spi.xfer2([32, 11, 110, 22, 220]))
spi.close()
debian@beaglebone:~/testSPI$ python3 testSPI.py
[32, 11, 110, 22, 220]
Code: Select all
int main(void)
{
int i = 0;
int rxval;
const char *send = "HELLO";//{'H', 'E', 'L', 'L', 'O'};
char recv[5] = {'\0'};
iolib_init();
if (spi_enable_pb(SPI_BUS))
{
spi_ctrl(SPI_BUS, SPI_CH0, SPI_MASTER, SPI_RXTX, /* use SPI_TX or SPI_RXTX depending on needs */
SPI_DIV32, SPI_CLOCKMODE3, /* 48 MHz divided by 32, SPI mode 3 */
SPI_CE_ACT_LOW, SPI_INOUT, 16); /* D0 is output and D1 is input, 16-bit transactions */
printf("Sending: %s\n", send);
spi_transact(SPI_BUS, SPI_CH0, send[i] /*or integer to transmit data*/, &rxval);
recv[i++] = rxval;
spi_transact(SPI_BUS, SPI_CH0, send[i] /*or integer to transmit data*/, &rxval);
recv[i++] = rxval;
spi_transact(SPI_BUS, SPI_CH0, send[i] /*or integer to transmit data*/, &rxval);
recv[i++] = rxval;
spi_transact(SPI_BUS, SPI_CH0, send[i] /*or integer to transmit data*/, &rxval);
recv[i++] = rxval;
spi_transact(SPI_BUS, SPI_CH0, send[i] /*or integer to transmit data*/, &rxval);
recv[i++] = rxval;
printf("Received: %s\n", recv);
}
spi_disable_pb(SPI_BUS);
iolib_free();
return(0);
}
debian@beaglebone:~/devLib/iobb/test-io$ gcc -o spi ./spi.c -I../ -L../ -liobb
debian@beaglebone:~/devLib/iobb/test-io$ sudo ./spi
Sending: HELLO
Received: HELLO