/**************************************************************************/\r
/*!\r
@file hx8347d.c\r
- @author TauonTeilchen\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
- Based on Watterott C Lib for MI0283QT-2\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) 2010, microBuilder SARL\r
- All rights reserved.\r
-\r
- Redistribution and use in source and binary forms, with or without\r
- modification, are permitted provided that the following conditions are met:\r
- 1. Redistributions of source code must retain the above copyright\r
- notice, this list of conditions and the following disclaimer.\r
- 2. Redistributions in binary form must reproduce the above copyright\r
- notice, this list of conditions and the following disclaimer in the\r
- documentation and/or other materials provided with the distribution.\r
- 3. Neither the name of the copyright holders nor the\r
- names of its contributors may be used to endorse or promote products\r
- derived from this software without specific prior written permission.\r
-\r
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\r
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY\r
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\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
/* Private Methods */\r
/*************************************************/\r
void lcd_drawstart(void);\r
-void lcd_cmd(unsigned int reg, unsigned int param);\r
-void lcd_clear(unsigned int color);\r
-void lcd_draw(unsigned int color);\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(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1);\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
lcd_cmd(Display_Control_3, Display_Control_3_D0);\r
}\r
\r
-void lcd_cmd(unsigned int reg, unsigned int param)\r
+void lcd_cmd(uint16_t reg, uint16_t param)\r
{\r
uint8_t b_first[2];\r
uint8_t b_sec[2];\r
\r
return;\r
}\r
-void lcd_clear(unsigned int color)\r
+void lcd_clear(uint16_t color)\r
{\r
unsigned int i;\r
\r
return;\r
}\r
\r
-void lcd_draw(unsigned int color)\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
}\r
\r
\r
-void lcd_area(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1)\r
+void lcd_area(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)\r
{\r
- y0 = ((320-offset)+ y0) % 320;\r
- y1 = ((320-offset)+ y1) % 320;\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
\r
return;\r
}\r
-void lcd_cursor(unsigned int x, unsigned int y)\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(unsigned int c)\r
+void lcd_data(uint16_t c)\r
{\r
LCD_CS_ENABLE();\r
uint8_t b[3];\r
lcd_cmd(0x28, 0x003C);\r
\r
lcdSetOrientation(hx8347dPOrientation);\r
+ offset = 0;\r
return;\r
}\r
/**************************************************************************/\r
/**************************************************************************/\r
uint16_t lcdGetPixel(uint16_t x, uint16_t y)\r
{\r
+ return 0;\r
}\r
\r
/**************************************************************************/\r
/**************************************************************************/\r
/*!\r
@file hx8347d.h\r
- @author TauonTeilchen\r
-\r
- @section DESCRIPTION\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
+ @author Tauon {TauonTeilchen} Jabber ID Tauon[at]jabber.ccc.de\r
\r
@section LICENSE\r
\r
Software License Agreement (BSD License)\r
\r
- Copyright (c) 2010, microBuilder SARL\r
- All rights reserved.\r
-\r
- Redistribution and use in source and binary forms, with or without\r
- modification, are permitted provided that the following conditions are met:\r
- 1. Redistributions of source code must retain the above copyright\r
- notice, this list of conditions and the following disclaimer.\r
- 2. Redistributions in binary form must reproduce the above copyright\r
- notice, this list of conditions and the following disclaimer in the\r
- documentation and/or other materials provided with the distribution.\r
- 3. Neither the name of the copyright holders nor the\r
- names of its contributors may be used to endorse or promote products\r
- derived from this software without specific prior written permission.\r
-\r
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\r
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY\r
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ Copyright (c) 2012, TauonTeilchen \r
+ ----------------------------------------------------------------------------\r
+ "THE BEER-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, koennen\r
+ Sie mit dem Material machen, was Sie möechten. Wenn wir uns eines Tages treffen und Sie\r
+ denken, das Material ist es wert, koennen Sie mir dafuer ein ClubMate ausgeben. Tauon\r
+ ----------------------------------------------------------------------------\r
*/\r
/**************************************************************************/\r
\r
// LCD BACK_LIGHT Pin 6 of Port 2\r
// LCD CS Pin 5 of Port 2\r
// LCD RESET Pin 4 of Port 2\r
-// Morr infos https://github.com/watterott/MI0283QT-Adapter/raw/master/img/connecting-uno.jpg\r
+// More infos https://github.com/watterott/MI0283QT-Adapter/raw/master/img/connecting-uno.jpg\r
//\r
/**************************************************************************/\r
#include "core/systick/systick.h"\r
\r
\r
// Screen width, height, has touchscreen, support orientation changes, support hw scrolling\r
-static lcdOrientation_t hx8347dPOrientation = LCD_ORIENTATION_PORTRAIT;\r
+static lcdOrientation_t hx8347dPOrientation = LCD_ORIENTATION_LANDSCAPE;\r
\r
// Screen width, height, has touchscreen, support orientation changes, support hw scrolling\r
static lcdProperties_t hx8347dProperties = { 320, 240, false, true, true };\r
@brief Configures any pins or HW and initialises the LCD controller\r
*/\r
/**************************************************************************/\r
-uint16_t pwmDutyCycleLCDBacklight = 50;\r
+\r
void lcdInit(void);\r
void lcdBacklight(bool state);\r
void lcdTest(void);\r