Jump to content
Sign in to follow this  
brainwash

Adafruit 5110/PCD8544 port

Recommended Posts

Since I haven't been able to find a library for the LCD 5110 that supports graphics as well I decided to port the arduino library. It turned out to be take much less time than I thought it would, considering my very limited C/C++ experience.

 

Most of the time was spent rewriting the fast software SPI routine:

inline void Adafruit_PCD8544::fastSPIwrite(uint8_t d) {
  for(uint8_t bit = 0x80; bit; bit >>= 1) {
ROM_GPIOPinWrite(mosiport, mosipinmask, d&bit ? mosipinmask : 0);
ROM_GPIOPinWrite(clkport, clkpinmask, clkpinmask);
ROM_GPIOPinWrite(clkport, clkpinmask, 0);
  }   
}
I haven't tested everything but the example (also included in the zip) works. There are still avr includes in the GFX libraries but it seems to work. Maybe someone can clean up and package a nice library.
 

Adafruit_PCD8544.zip

Share this post


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.

Guest
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.

Sign in to follow this  

×
×
  • Create New...