1 /**************************************************************************/
7 Is written for MI0283QT-2 LCD from watterott.com
8 More infos: http://www.watterott.com/de/MI0283QT-2-Adapter
9 http://www.watterott.com/index.php?page=product&info=1597&dl_media=3202
13 Software License Agreement (BSD License)
15 Copyright (c) 2010, microBuilder SARL
18 Redistribution and use in source and binary forms, with or without
19 modification, are permitted provided that the following conditions are met:
20 1. Redistributions of source code must retain the above copyright
21 notice, this list of conditions and the following disclaimer.
22 2. Redistributions in binary form must reproduce the above copyright
23 notice, this list of conditions and the following disclaimer in the
24 documentation and/or other materials provided with the distribution.
25 3. Neither the name of the copyright holders nor the
26 names of its contributors may be used to endorse or promote products
27 derived from this software without specific prior written permission.
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
30 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
33 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 /**************************************************************************/
42 /**************************************************************************/
43 // LCD BACK_LIGHT Pin 6 of Port 2
44 // LCD CS Pin 5 of Port 2
45 // LCD RESET Pin 4 of Port 2
46 // Morr infos https://github.com/watterott/MI0283QT-Adapter/raw/master/img/connecting-uno.jpg
48 /**************************************************************************/
49 #include "core/systick/systick.h"
50 #include "drivers/displays/tft/touchscreen.h"
51 #include "core/ssp/ssp.h"
52 #include "projectconfig.h"
53 #include "drivers/displays/tft/lcd.h"
57 // Screen width, height, has touchscreen, support orientation changes, support hw scrolling
58 static lcdOrientation_t hx8347dPOrientation
= LCD_ORIENTATION_PORTRAIT
;
60 // Screen width, height, has touchscreen, support orientation changes, support hw scrolling
61 static lcdProperties_t hx8347dProperties
= { 320, 240, false, true, true };
63 /*************************************************/
65 /*************************************************/
68 /*************************************************/
70 /*************************************************/
72 // The following functions add need to be written to match the generic
73 // lcd interface defined by lcd.h
75 /**************************************************************************/
77 @brief Configures any pins or HW and initialises the LCD controller
79 /**************************************************************************/
80 uint16_t pwmDutyCycleLCDBacklight
= 50;
82 void lcdBacklight(bool state
);
84 void lcdFillRGB(uint16_t data
);
85 void lcdDrawPixel(uint16_t x
, uint16_t y
, uint16_t color
);
86 void lcdDrawPixels(uint16_t x
, uint16_t y
, uint16_t *data
, uint32_t len
);
87 void lcdDrawHLine(uint16_t x0
, uint16_t x1
, uint16_t y
, uint16_t color
);
88 void lcdDrawVLine(uint16_t x
, uint16_t y0
, uint16_t y1
, uint16_t color
);
89 uint16_t lcdGetPixel(uint16_t x
, uint16_t y
);
90 void lcdSetOrientation(lcdOrientation_t orientation
);
91 lcdOrientation_t
lcdGetOrientation(void);
92 uint16_t lcdGetWidth(void);
93 uint16_t lcdGetHeight(void);
94 void lcdScroll(int16_t pixels
, uint16_t fillColor
);
95 uint16_t lcdGetControllerID(void);
96 lcdProperties_t
lcdGetProperties(void);
98 void hx8347d_Scroll(uint16_t tfa
,uint16_t vsa
,uint16_t bfa
, uint16_t vsp
);
99 void hx8347d_Standby(bool deep
);
100 void hx8347d_Wakeup(bool deep
);