Jump to content

grlib for Adafruit 320x240x18 TFT Display

Recommended Posts

I implemented a Stellaris grlib display driver for Adafruit's 320x240x18 TFT Touch display.



The code can be found on github



I tested it only with Lab 10 in the Stellaris Launchpad workshop (w/o touch). Please let me know if you run into issues and I'm glad to fix it.


Wiring is a mess as the pins of individual ports are all over the place.






Link to post
Share on other sites

I just committed an updated version to Github that fixes a glaring bug and adds touch calibration


- Bug: Forgot to toggle CS in most places, dooh! (a miracle it ever worked :-)

- Addition: Functions to calibrate touch display. After calibration the StellarisWare touch implementation works just fine with this display

Link to post
Share on other sites
  • 5 months later...

Sorry, but I think I led you down the wrong path. Looking at my code, I actually don't use SPI. The display uses 8 lines to transfer bytes in parallel.


The macro LCD_DATA_WRITE writes one byte to Port B.


// Port and bitmask used for 8-bit data bus
#define LCD_DATA_PINS     0xFF
#define LCD_DATA_WRITE(ucByte)    { HWREG(LCD_DATA_BASE + GPIO_O_DATA + (LCD_DATA_PINS << 2)) = (ucByte); }


HWREG is a method for fast access to memory mapped registers, which is a bit cryptic and I might have an error in here that causes the code to overwrite other locations than Port B.


What pins is your I2C sensor connected to?


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...