SPI based library for the ST7735 LCD controller.

Dependents:   RayCastingEngine RETRO_LCD_PerformanceTest RETRO_loop_test RETRO_RickGame ... more

Revision:
13:a559617cdf94
Parent:
11:f86ce02e37cd
--- a/LCD_ST7735.h	Sun Jan 25 06:53:17 2015 +0000
+++ b/LCD_ST7735.h	Sun Feb 01 05:09:49 2015 +0000
@@ -195,10 +195,17 @@
          * @param pFont Pointer to the font used to render the string to the display
          * @param x The X coordinate location to draw the string.
          * @param y The Y coordinate location to draw the string.
-         * @param pString ASCIIZ string to draw to the display.
-         * @note The font is currently limited to an 8x8 font. See the font_IBM.h file for an example font.
+         * @param pString ASCIIZ string to draw to the display.         
         */
-        void drawString(const uint8_t *pFont, int x, int y, const char *pString); 
+        void drawString(const uint8_t *pFont, int x, int y, const char *pString);
+        
+        /** Measure the width and height of the string when rendered with the specified font
+         * @param pFont Pointer to the font used to measure the string         
+         * @param pString ASCIIZ string to measure.
+         * @param width Reference to the variable that will contain the width
+         * @param height Reference to the variable that will contain the height         
+        */
+        void measureString(const uint8_t *pFont, const char *pString, uint8_t &width, uint8_t &height);
         
         /** Select the device on the SPI bus.
         selectDevice needs to be called before accessing the screen if there are multiple devices on the SPI bus.
@@ -222,7 +229,7 @@
     private:
         void drawVertLine(int x1, int y1, int y2, uint16_t color);
         void drawHorizLine(int x1, int y1, int x2, uint16_t color);
-        void drawChar(const uint8_t *pFont, int x, int y, char c);
+        void drawChar(const uint8_t *pFont, int x, int y, char c, uint8_t w, uint8_t h, uint8_t offset, uint8_t leftPad, uint8_t rightPad, uint8_t topPad, uint8_t bottomPad);
         
     private:
         void swap(int &a, int &b);