androidthings / contrib-drivers

Open source peripheral drivers
Apache License 2.0
559 stars 174 forks source link

Support for Adafruit PiTFT 2.2" HAT Mini Kit #71

Closed jaumard closed 6 years ago

jaumard commented 7 years ago

Hello, For a project I buy this display https://www.adafruit.com/product/2315 does it will work out of the box with android things ? If not what should I do to make it work ?

Fleker commented 7 years ago

I have not tested out the functionality of this board. You may need to modify the config.txt file for the Pi in order for it to work.

jaumard commented 7 years ago

When I receive it I'll try then :) I'll let you know if it's compatible out of the box but I see that there already a driver for an oled display so I suppose a driver will be needed too for this one :/

jaumard commented 7 years ago

@Fleker Ok just receive it, didn't work out of the box, what should I try under the config.txt to make it work ?

Fleker commented 7 years ago

Try looking at this answer although I don't know how to help specifically for your device

memjr commented 6 years ago

Shouldn't be too hard to do. It supports 4-wire 8-bit SPI communication. As a starter project, you could do something as simple as reading a bitmap's pixels, 1 by 1, and pumping each pixel's RGB data over SPI to the device.

The make it more interesting, moving a mouse connected to the device, pickup the mouse's position and draw a pointer bitmap over the background bitmap at the mouse's reported position.

Looks like you can get pretty fancy with it the more you build into your driver.

mangini commented 6 years ago

@jaumard This display has an SPI interface, so you need a user-space driver and it won't show up as a regular display to Android, which means you won't easily be able to draw regular Android UI on it. If you want to go that route, I recommend that you port Adafruit's SPI driver:

It shouldn't be too hard. The Wiring API for SPI used by their driver can easily be mapped to the Android Things SPI. You can either manually convert C++ to Java, or use Android Things NDK API