--- /dev/null
+/**************************************************************************/\r
+/*!\r
+ @file hx8347d.c\r
+ @author Tauon {TauonTeilchen} Jabber ID Tauon[at]jabber.ccc.de\r
+\r
+ @section DESCRIPTION\r
+ Driver for hx8347h 240x320 pixel TFT LCD displays.\r
+ Is written for MI0283QT-2 LCD from watterott.com\r
+ More infos: http://www.watterott.com/de/MI0283QT-2-Adapter\r
+ http://www.watterott.com/index.php?page=product&info=1597&dl_media=3202\r
+\r
+ @section LICENSE\r
+\r
+ Software License Agreement (BSD License)\r
+\r
+ Copyright (c) 2012, TauonTeilchen \r
+ ----------------------------------------------------------------------------\r
+ "THE ClubMate-WARE LICENSE" (Revision 42):\r
+ JID: <Tauon@jabber.ccc.de> wrote this file. As long as you retain this notice you\r
+ can do whatever you want with this stuff. If we meet some day, and you think\r
+ this stuff is worth it, you can buy me a ClubMate in return Tauon\r
+ ----------------------------------------------------------------------------\r
+ ----------------------------------------------------------------------------\r
+ "THE ClubMate-WARE LICENSE" (Revision 42):\r
+ JID: <Tauon@jabber.ccc.de> schrieb diese Datei. Solange Sie diesen Vermerk nicht entfernen, k�nnen\r
+ Sie mit dem Material machen, was Sie m�chten. Wenn wir uns eines Tages treffen und Sie\r
+ denken, das Material ist es wert, k�nnen Sie mir daf�r ein ClubMate ausgeben. Tauon\r
+ ----------------------------------------------------------------------------\r
+ \r
+*/\r
+/**************************************************************************/\r
+#include "drivers/displays/tft/hw/hx8347d.h"\r
+\r
+#define LCD_ID (0x00)\r
+#define LCD_DATA ((0x72)|(LCD_ID<<2))\r
+#define LCD_REGISTER ((0x70)|(LCD_ID<<2))\r
+\r
+#define LCD_BACK_LIGHT 6\r
+#define LCD_RST 5\r
+#define LCD_CS 4\r
+\r
+// Macros for control line state\r
+#define LCD_CS_ENABLE() GPIO_GPIO2DATA &= ~0x10 // gpioSetValue(2, 4, 0)\r
+#define LCD_CS_DISABLE() GPIO_GPIO2DATA |= 0x10 // gpioSetValue(2, 4, 1)\r
+#define LCD_RST_ENABLE() GPIO_GPIO2DATA &= ~0x20 // gpioSetValue(2, 5, 0)\r
+#define LCD_RST_DISABLE() GPIO_GPIO2DATA |= 0x20 // gpioSetValue(2, 5, 1)\r
+\r
+#define Himax ID 0x00\r
+#define Display_Mode_Control 0x01\r
+\r
+#define Column_Address_Start_2 0x02\r
+#define Column_Address_Start_1 0x03\r
+#define Column_Address_End_2 0x04\r
+#define Column_Address_End_1 0x05\r
+\r
+#define Row_Address_Start_2 0x06\r
+#define Row_Address_Start_1 0x07\r
+#define Row_Address_End_2 0x08\r
+#define Row_Address_End_1 0x09\r
+\r
+#define Partial_Area_Start_Row_2 0x0A\r
+#define Partial_Area_Start_Row_1 0x0B\r
+#define Partial_Area_End_Row_2 0x0C\r
+#define Partial_Area_End_Row_1 0x0D\r
+\r
+#define TFA_REGISTER 0x0E\r
+#define VSA_REGISTER 0x10\r
+#define BFA_REGISTER 0x12\r
+#define VSP_REGISTER 0x14\r
+\r
+#define COLMOD 0x17\r
+#define OSC_Control_1 0x18\r
+#define OSC_Control_2 0x19\r
+#define Power_Control_1 0x1A\r
+#define Power_Control_2 0x1B\r
+#define Power_Control_3 0x1C\r
+#define Power_Control_4 0x1D\r
+#define Power_Control_5 0x1E\r
+#define Power_Control_6 0x1F\r
+#define VCOM_Control_1 0x23\r
+#define VCOM_Control_2 0x24\r
+#define VCOM_Control_3 0x25\r
+#define Display_Control_1 0x26\r
+#define Display_Control_2 0x27\r
+#define Display_Control_3 0x28\r
+#define Source_OP_Control_Normal 0xE8\r
+#define Source_OP_Control_IDLE 0xE9\r
+#define Power_Control_Internal_1 0xEA\r
+#define Power_Control_Internal_2 0xEB\r
+#define Source_Control_Internal_1 0xEC\r
+#define Source_Control_Internal_2 0xED\r
+\r
+#define OSC_Control_2_OSC_EN 0x01\r
+#define Display_Control_3_GON 0x20\r
+#define Display_Control_3_DTE 0x10\r
+#define Display_Control_3_D0 0x04\r
+#define Display_Control_3_D1 0x08\r
+#define Power_Control_6_STB 0x01\r
+#define Display_Mode_Control_DP_STB_S 0x40\r
+#define Display_Mode_Control_DP_STB 0x80\r
+uint16_t offset;\r
+\r
+/*************************************************/\r
+/* Private Methods */\r
+/*************************************************/\r
+void lcd_drawstart(void);\r
+void lcd_cmd(uint16_t reg, uint16_t param);\r
+void lcd_clear(uint16_t color);\r
+void lcd_draw(uint16_t color);\r
+void lcd_drawstart(void);\r
+void lcd_drawstop(void);\r
+void hx8347d_DisplayOnFlow(void);\r
+void hx8347d_DisplayOffFlow(void);\r
+void lcd_area(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);\r
+\r
+\r
+void hx8347d_Scroll(uint16_t tfa,uint16_t vsa,uint16_t bfa, uint16_t vsp)\r
+{\r
+ lcd_cmd(TFA_REGISTER , tfa >> 8);\r
+ lcd_cmd(TFA_REGISTER + 1, tfa & 0xFF);\r
+\r
+ lcd_cmd(VSA_REGISTER , vsa >> 8);\r
+ lcd_cmd(VSA_REGISTER + 1, vsa & 0xFF);\r
+\r
+ lcd_cmd(BFA_REGISTER , bfa >> 8);\r
+ lcd_cmd(BFA_REGISTER + 1, bfa & 0xFF);\r
+\r
+ lcd_cmd(VSP_REGISTER , vsp>> 8);\r
+ lcd_cmd(VSP_REGISTER + 1, vsp & 0xFF);\r
+ lcd_cmd(0x01, 0x08); //scroll on\r
+}\r
+\r
+void displayOnFlow(void)\r
+{\r
+ lcd_cmd(Display_Control_3, 0x0038);\r
+ systickDelay(4);\r
+ lcd_cmd(Display_Control_3, 0x003C);\r
+}\r
+void displayOffFlow(void)\r
+{\r
+ lcd_cmd(Display_Control_3, Display_Control_3_GON | Display_Control_3_DTE | Display_Control_3_D1);\r
+ systickDelay(4);\r
+ lcd_cmd(Display_Control_3, Display_Control_3_D0);\r
+}\r
+\r
+void lcd_cmd(uint16_t reg, uint16_t param)\r
+{\r
+ uint8_t b_first[2];\r
+ uint8_t b_sec[2];\r
+ LCD_CS_ENABLE();\r
+\r
+ b_first[0] = LCD_REGISTER;\r
+ b_first[1] = reg;\r
+\r
+ sspSend(0, b_first, 2);\r
+ LCD_CS_DISABLE();\r
+\r
+ b_sec[0] = LCD_DATA;\r
+ b_sec[1] = param;\r
+ LCD_CS_ENABLE();\r
+\r
+ sspSend(0, b_sec, 2);\r
+ LCD_CS_DISABLE();\r
+\r
+ return;\r
+}\r
+void lcd_clear(uint16_t color)\r
+{\r
+ unsigned int i;\r
+\r
+ lcd_area(0, 0, (hx8347dProperties.width -1), (hx8347dProperties.height-1));\r
+\r
+ lcd_drawstart();\r
+ for(i=(hx8347dProperties.width*hx8347dProperties.height/8); i!=0; i--)\r
+ {\r
+ lcd_draw(color); //1\r
+ lcd_draw(color); //2\r
+ lcd_draw(color); //3\r
+ lcd_draw(color); //4\r
+ lcd_draw(color); //5\r
+ lcd_draw(color); //6\r
+ lcd_draw(color); //7\r
+ lcd_draw(color); //8\r
+ }\r
+ lcd_drawstop();\r
+\r
+ return;\r
+}\r
+\r
+void lcd_draw(uint16_t color)\r
+{\r
+ // Writing data in 16Bit mode for saving a lot of time\r
+ /* Move on only if NOT busy and TX FIFO not full. */\r
+ while ((SSP_SSP0SR & (SSP_SSP0SR_TNF_NOTFULL | SSP_SSP0SR_BSY_BUSY)) != SSP_SSP0SR_TNF_NOTFULL);\r
+ SSP_SSP0DR = color;\r
+\r
+ while ( (SSP_SSP0SR & (SSP_SSP0SR_BSY_BUSY|SSP_SSP0SR_RNE_NOTEMPTY)) != SSP_SSP0SR_RNE_NOTEMPTY );\r
+ /* Whenever a byte is written, MISO FIFO counter increments, Clear FIFO\r
+ on MISO. Otherwise, when SSP0Receive() is called, previous data byte\r
+ is left in the FIFO. */\r
+ uint8_t Dummy = SSP_SSP0DR;\r
+ return;\r
+}\r
+\r
+void lcd_drawstop(void)\r
+{\r
+ while ((SSP_SSP0SR & SSP_SSP0SR_TFE_MASK ) != SSP_SSP0SR_TFE_EMPTY );\r
+ LCD_CS_DISABLE();\r
+\r
+ // init 8Bit SPI Mode\r
+ SSP_SSP0CR0 &= ~SSP_SSP0CR0_DSS_MASK;\r
+ SSP_SSP0CR0 |= SSP_SSP0CR0_DSS_8BIT;\r
+\r
+ return;\r
+}\r
+void lcd_drawstart(void)\r
+{\r
+ LCD_CS_ENABLE();\r
+ uint8_t b_first[2];\r
+ uint8_t b_sec[1];\r
+ b_first[0] = LCD_REGISTER;\r
+ b_first[1] = 0x22;\r
+ sspSend(0, b_first, 2);\r
+ LCD_CS_DISABLE();\r
+\r
+ LCD_CS_ENABLE();\r
+ b_sec[0] = LCD_DATA;\r
+ sspSend(0, b_sec, 1);\r
+\r
+\r
+ // Assign config values to SSP0CR0\r
+ // init 16Bit SPI Mode for fast data transmitting\r
+ SSP_SSP0CR0 &= ~SSP_SSP0CR0_DSS_MASK;\r
+ SSP_SSP0CR0 |= SSP_SSP0CR0_DSS_16BIT;\r
+\r
+ return;\r
+}\r
+\r
+\r
+void lcd_area(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)\r
+{\r
+ if(hx8347dPOrientation == LCD_ORIENTATION_PORTRAIT)\r
+ {\r
+ y0 = ((320-offset)+ y0) % 320;\r
+ y1 = ((320-offset)+ y1) % 320;\r
+ }\r
+ else\r
+ {\r
+ x0 = ((320-offset)+ x0) % 320;\r
+ x1 = ((320-offset)+ x1) % 320; \r
+ }\r
+ lcd_cmd(Column_Address_Start_1, (x0>>0)); //set x0\r
+ lcd_cmd(Column_Address_Start_2, (x0>>8)); //set x0\r
+ lcd_cmd(Column_Address_End_1 , (x1>>0)); //set x1\r
+ lcd_cmd(Column_Address_End_2 , (x1>>8)); //set x1\r
+ lcd_cmd(Row_Address_Start_1 , (y0>>0)); //set y0\r
+ lcd_cmd(Row_Address_Start_2 , (y0>>8)); //set y0\r
+ lcd_cmd(Row_Address_End_1 , (y1>>0)); //set y1\r
+ lcd_cmd(Row_Address_End_2 , (y1>>8)); //set y1\r
+\r
+ return;\r
+}\r
+void lcd_cursor(uint16_t x, uint16_t y)\r
+{\r
+ lcd_area(x, y, x, y);\r
+ return;\r
+}\r
+void lcd_data(uint16_t c)\r
+{\r
+ LCD_CS_ENABLE();\r
+ uint8_t b[3];\r
+ b[0] = LCD_DATA;\r
+ b[1] = c>>8;\r
+ b[2] = c;\r
+ sspSend(0, b, 3);\r
+\r
+ LCD_CS_DISABLE();\r
+\r
+ return;\r
+}\r
+\r
+\r
+void fillRect(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color)\r
+{\r
+ uint32_t size;\r
+ uint16_t tmp, i;\r
+\r
+ if(x0 > x1)\r
+ {\r
+ tmp = x0;\r
+ x0 = x1;\r
+ x1 = tmp;\r
+ }\r
+ if(y0 > y1)\r
+ {\r
+ tmp = y0;\r
+ y0 = y1;\r
+ y1 = tmp;\r
+ }\r
+\r
+ if(x1 >= hx8347dProperties.width)\r
+ {\r
+ x1 = hx8347dProperties.width-1;\r
+ }\r
+ if(y1 >= hx8347dProperties.height)\r
+ {\r
+ y1 = hx8347dProperties.height-1;\r
+ }\r
+\r
+ lcd_area(x0, y0, x1, y1);\r
+\r
+ lcd_drawstart();\r
+ size = (uint32_t)(1+(x1-x0)) * (uint32_t)(1+(y1-y0));\r
+ tmp = size/8;\r
+ if(tmp != 0)\r
+ {\r
+ for(i=tmp; i!=0; i--)\r
+ {\r
+ lcd_draw(color); //1\r
+ lcd_draw(color); //2\r
+ lcd_draw(color); //3\r
+ lcd_draw(color); //4\r
+ lcd_draw(color); //5\r
+ lcd_draw(color); //6\r
+ lcd_draw(color); //7\r
+ lcd_draw(color); //8\r
+ }\r
+ for(i=size-tmp; i!=0; i--)\r
+ {\r
+ lcd_draw(color);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ for(i=size; i!=0; i--)\r
+ {\r
+ lcd_draw(color);\r
+ }\r
+ }\r
+ lcd_drawstop();\r
+\r
+ return;\r
+}\r
+\r
+/*************************************************/\r
+/* Public Methods */\r
+/*************************************************/\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Configures any pins or HW and initialises the LCD controller\r
+*/\r
+/**************************************************************************/\r
+void lcdInit(void)\r
+{\r
+ sspInit(0,0,0);\r
+\r
+ gpioSetDir(2, LCD_CS, gpioDirection_Output);\r
+ gpioSetDir(2, LCD_RST, gpioDirection_Output);\r
+ gpioSetDir(2, LCD_BACK_LIGHT, gpioDirection_Output);\r
+\r
+ //reset\r
+ LCD_CS_DISABLE();\r
+ systickDelay(1);\r
+ LCD_RST_ENABLE();\r
+ systickDelay(50);\r
+ LCD_RST_DISABLE();\r
+ systickDelay(50);\r
+\r
+ //driving ability\r
+ lcd_cmd(Power_Control_Internal_1 , 0x0000);\r
+ lcd_cmd(Power_Control_Internal_2 , 0x0020);\r
+ lcd_cmd(Source_Control_Internal_1, 0x000C);\r
+ lcd_cmd(Source_Control_Internal_2, 0x00C4);\r
+ lcd_cmd(Source_OP_Control_Normal , 0x0040);\r
+ lcd_cmd(Source_OP_Control_IDLE , 0x0038);\r
+ lcd_cmd(0xF1, 0x0001);\r
+ lcd_cmd(0xF2, 0x0010);\r
+ lcd_cmd(0x27, 0x00A3);\r
+\r
+ //power voltage\r
+ lcd_cmd(Power_Control_2, 0x001B);\r
+ lcd_cmd(Power_Control_1, 0x0001);\r
+ lcd_cmd(VCOM_Control_2 , 0x002F);\r
+ lcd_cmd(VCOM_Control_3 , 0x0057);\r
+\r
+ //VCOM offset\r
+ lcd_cmd(VCOM_Control_1, 0x008D); //for flicker adjust\r
+\r
+ //power on\r
+ lcd_cmd(OSC_Control_1 , 0x0036);\r
+ lcd_cmd(OSC_Control_2 , 0x0001); //start osc\r
+ lcd_cmd(Display_Mode_Control, 0x0000); //wakeup\r
+ lcd_cmd(Power_Control_6 , 0x0088);\r
+ systickDelay(5);\r
+ lcd_cmd(Power_Control_6, 0x0080);\r
+ systickDelay(5);\r
+ lcd_cmd(Power_Control_6, 0x0090);\r
+ systickDelay(5);\r
+ lcd_cmd(Power_Control_6, 0x00D0);\r
+ systickDelay(5);\r
+\r
+ //color selection\r
+ lcd_cmd(COLMOD, 0x0005); //0x0005=65k, 0x0006=262k\r
+\r
+ //panel characteristic\r
+ lcd_cmd(0x36, 0x0000);\r
+\r
+ //display on\r
+ lcd_cmd(0x28, 0x0038);\r
+ systickDelay(40);\r
+ lcd_cmd(0x28, 0x003C);\r
+\r
+ lcdSetOrientation(hx8347dPOrientation);\r
+ offset = 0;\r
+ return;\r
+}\r
+/**************************************************************************/\r
+/*!\r
+ @brief Enables or disables the LCD backlight\r
+*/\r
+/**************************************************************************/\r
+void lcdBacklight(bool state)\r
+{\r
+ gpioSetValue(2, LCD_BACK_LIGHT, state);\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Renders a simple test pattern on the LCD\r
+*/\r
+/**************************************************************************/\r
+void lcdTest(void)\r
+{\r
+ lcdFillRGB(COLOR_CYAN);\r
+\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Fills the LCD with the specified 16-bit color\r
+*/\r
+/**************************************************************************/\r
+void lcdFillRGB(uint16_t data)\r
+{\r
+ lcd_clear(data);\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Draws a single pixel at the specified X/Y location\r
+*/\r
+/**************************************************************************/\r
+void lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color)\r
+{\r
+ if((x >= hx8347dProperties.width) ||\r
+ (y >= hx8347dProperties.height))\r
+ {\r
+ return;\r
+ }\r
+\r
+ fillRect(x,y,x,y,color);\r
+\r
+ return;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Draws an array of consecutive RGB565 pixels (much\r
+ faster than addressing each pixel individually)\r
+*/\r
+/**************************************************************************/\r
+void lcdDrawPixels(uint16_t x, uint16_t y, uint16_t *data, uint32_t len)\r
+{\r
+ lcd_area(x, y, x + len, y);\r
+ int i;\r
+ lcd_drawstart();\r
+ for(i = 0; i < len; i++)\r
+ {\r
+\r
+ lcd_draw(*data);\r
+ data++;\r
+ }\r
+ lcd_drawstop();\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Optimised routine to draw a horizontal line faster than\r
+ setting individual pixels\r
+*/\r
+/**************************************************************************/\r
+void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color)\r
+{\r
+\r
+ if (x1 < x0)\r
+ {\r
+ // Switch x1 and x0\r
+ uint16_t x;\r
+ x = x1;\r
+ x1 = x0;\r
+ x0 = x;\r
+ }\r
+\r
+ if(x0 >= hx8347dProperties.width)\r
+ {\r
+ x0 = hx8347dProperties.width-1;\r
+ }\r
+ if(x1 >= hx8347dProperties.width)\r
+ {\r
+ x1 = hx8347dProperties.width-1;\r
+ }\r
+ if(y >= hx8347dProperties.height)\r
+ {\r
+ y = hx8347dProperties.height-1;\r
+ }\r
+\r
+ fillRect(x0, y, x1, y, color);\r
+\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Optimised routine to draw a vertical line faster than\r
+ setting individual pixels\r
+*/\r
+/**************************************************************************/\r
+void lcdDrawVLine(uint16_t x, uint16_t y0, uint16_t y1, uint16_t color)\r
+{\r
+\r
+ if (y1 < y0)\r
+ {\r
+ // Switch y1 and y0\r
+ uint16_t y;\r
+ y = y1;\r
+ y1 = y0;\r
+ y0 = y;\r
+ }\r
+\r
+ if(x >= hx8347dProperties.width)\r
+ {\r
+ x = hx8347dProperties.width-1;\r
+ }\r
+\r
+ if(y0 >= hx8347dProperties.height)\r
+ {\r
+ y0 = hx8347dProperties.height-1;\r
+ }\r
+ if(y1 >= hx8347dProperties.height)\r
+ {\r
+ y1 = hx8347dProperties.height-1;\r
+ }\r
+\r
+ fillRect(x, y0, x, y1, color);\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Gets the 16-bit color of the pixel at the specified location\r
+*/\r
+/**************************************************************************/\r
+uint16_t lcdGetPixel(uint16_t x, uint16_t y)\r
+{\r
+ return 0;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Sets the LCD orientation to horizontal and vertical\r
+*/\r
+/**************************************************************************/\r
+void lcdSetOrientation(lcdOrientation_t orientation)\r
+{\r
+ if(orientation == LCD_ORIENTATION_LANDSCAPE)\r
+ {\r
+ lcd_cmd(0x16, 0x00A8); //MY=1 MX=0 MV=1 ML=0 BGR=1\r
+ hx8347dProperties.width = 320;\r
+ hx8347dProperties.height = 240;\r
+ }\r
+ else\r
+ {\r
+ //lcd_cmd(0x16, 0x0008); //MY=0 MX=0 MV=0 ML=0 BGR=1\r
+ lcd_cmd(0x16, 0x00C8); //MY=1 MX=0 MV=1 ML=0 BGR=1\r
+ hx8347dProperties.width = 240;\r
+ hx8347dProperties.height = 320;\r
+ }\r
+ hx8347dPOrientation = orientation;\r
+ lcd_area(0, 0, (hx8347dProperties.width-1), (hx8347dProperties.height-1));\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Gets the current screen orientation (horizontal or vertical)\r
+*/\r
+/**************************************************************************/\r
+lcdOrientation_t lcdGetOrientation(void)\r
+{\r
+ return hx8347dPOrientation;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Gets the width in pixels of the LCD screen (varies depending\r
+ on the current screen orientation)\r
+*/\r
+/**************************************************************************/\r
+uint16_t lcdGetWidth(void)\r
+{\r
+ return hx8347dProperties.width;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Gets the height in pixels of the LCD screen (varies depending\r
+ on the current screen orientation)\r
+*/\r
+/**************************************************************************/\r
+uint16_t lcdGetHeight(void)\r
+{\r
+ return hx8347dProperties.height;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Scrolls the contents of the LCD screen vertically the\r
+ specified number of pixels using a HW optimised routine\r
+*/\r
+/**************************************************************************/\r
+\r
+void lcdScroll(int16_t pixels, uint16_t fillColor)\r
+{\r
+\r
+ hx8347d_Scroll(0,320,0,(offset + pixels) % 320);\r
+ if(hx8347dPOrientation == LCD_ORIENTATION_PORTRAIT)\r
+ {\r
+ fillRect(0, hx8347dProperties.height-pixels, hx8347dProperties.width, hx8347dProperties.height, fillColor);\r
+ }\r
+ else\r
+ {\r
+ fillRect(hx8347dProperties.width-pixels, 0, hx8347dProperties.width, hx8347dProperties.height, fillColor);\r
+ }\r
+ offset = (offset + pixels) % 320;\r
+}\r
+/**************************************************************************/\r
+/*!\r
+ @brief Set LCD into standby\r
+ In deep standby: LCD has lower power consumption\r
+*/\r
+/**************************************************************************/\r
+void hx8347d_Standby(bool deep)\r
+{\r
+ displayOffFlow();\r
+ lcd_cmd(Power_Control_6 , Power_Control_6_STB);\r
+ if(deep)\r
+ {\r
+ lcd_cmd(Display_Mode_Control,Display_Mode_Control_DP_STB_S);\r
+ lcd_cmd(Display_Mode_Control, Display_Mode_Control_DP_STB);\r
+ }\r
+ lcd_cmd(OSC_Control_2, ~OSC_Control_2_OSC_EN);\r
+}\r
+/**************************************************************************/\r
+/*!\r
+ @brief Wakeup LCD from standby\r
+ Wakeup from deep standby you need min. 20ms\r
+*/\r
+/**************************************************************************/\r
+void hx8347d_Wakeup(bool deep)\r
+{\r
+ lcd_cmd(OSC_Control_2, OSC_Control_2_OSC_EN);\r
+\r
+ if(deep)\r
+ {\r
+ lcd_cmd(Display_Mode_Control,0x0000);\r
+ systickDelay(20);\r
+ lcd_cmd(Display_Mode_Control, 0x0000);\r
+ }\r
+ else\r
+ {\r
+ systickDelay(5);\r
+ }\r
+\r
+ lcd_cmd(Power_Control_6, 0x00D0);\r
+ displayOnFlow();\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Gets the controller's 16-bit (4 hexdigit) ID\r
+*/\r
+/**************************************************************************/\r
+uint16_t lcdGetControllerID(void)\r
+{\r
+ return 0x0;\r
+}\r
+\r
+/**************************************************************************/\r
+/*!\r
+ @brief Returns the LCDs 'lcdProperties_t' that describes the LCDs\r
+ generic capabilities and dimensions\r
+*/\r
+/**************************************************************************/\r
+lcdProperties_t lcdGetProperties(void)\r
+{\r
+ return hx8347dProperties;\r
+}\r
+\r