This class drives the LCD display (RK043FN48H-CT672B 4,3" 480x272 pixels device) present on DISCO_F746NG board.
Dependents: DISCO-F746NG_LCDTS_CC3000_NTP DISCO-F746NG_QSPI DISCO-F746NG_ROPE_WIFI F746_SpectralAnalysis_NoPhoto ... more
LCD_DISCO_F746NG.cpp
00001 /* Copyright (c) 2010-2011 mbed.org, MIT License 00002 * 00003 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 00004 * and associated documentation files (the "Software"), to deal in the Software without 00005 * restriction, including without limitation the rights to use, copy, modify, merge, publish, 00006 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 00007 * Software is furnished to do so, subject to the following conditions: 00008 * 00009 * The above copyright notice and this permission notice shall be included in all copies or 00010 * substantial portions of the Software. 00011 * 00012 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 00013 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00014 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00015 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00016 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00017 */ 00018 00019 #include "LCD_DISCO_F746NG.h" 00020 00021 // Constructor 00022 LCD_DISCO_F746NG::LCD_DISCO_F746NG() 00023 { 00024 BSP_LCD_Init(); 00025 00026 BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS); 00027 BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)); 00028 00029 BSP_LCD_DisplayOn(); 00030 00031 BSP_LCD_SelectLayer(0); 00032 BSP_LCD_Clear(LCD_COLOR_BLACK); 00033 00034 BSP_LCD_SelectLayer(1); 00035 BSP_LCD_Clear(LCD_COLOR_BLACK); 00036 00037 BSP_LCD_SetFont(&LCD_DEFAULT_FONT); 00038 00039 BSP_LCD_SetBackColor(LCD_COLOR_WHITE); 00040 BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE); 00041 } 00042 00043 // Destructor 00044 LCD_DISCO_F746NG::~LCD_DISCO_F746NG() 00045 { 00046 BSP_LCD_DeInit(); 00047 } 00048 00049 //================================================================================================================= 00050 // Public methods 00051 //================================================================================================================= 00052 00053 uint8_t LCD_DISCO_F746NG::Init(void) 00054 { 00055 return BSP_LCD_Init(); 00056 } 00057 00058 uint8_t LCD_DISCO_F746NG::DeInit(void) 00059 { 00060 return BSP_LCD_DeInit(); 00061 } 00062 00063 uint32_t LCD_DISCO_F746NG::GetXSize(void) 00064 { 00065 return BSP_LCD_GetXSize(); 00066 } 00067 00068 uint32_t LCD_DISCO_F746NG::GetYSize(void) 00069 { 00070 return BSP_LCD_GetYSize(); 00071 } 00072 00073 void LCD_DISCO_F746NG::SetXSize(uint32_t imageWidthPixels) 00074 { 00075 BSP_LCD_SetXSize(imageWidthPixels); 00076 } 00077 00078 void LCD_DISCO_F746NG::SetYSize(uint32_t imageHeightPixels) 00079 { 00080 BSP_LCD_SetYSize(imageHeightPixels); 00081 } 00082 00083 void LCD_DISCO_F746NG::LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer) 00084 { 00085 BSP_LCD_LayerDefaultInit(LayerIndex, FrameBuffer); 00086 } 00087 00088 void LCD_DISCO_F746NG::LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address) 00089 { 00090 BSP_LCD_LayerRgb565Init(LayerIndex, FB_Address); 00091 } 00092 00093 void LCD_DISCO_F746NG::SetTransparency(uint32_t LayerIndex, uint8_t Transparency) 00094 { 00095 BSP_LCD_SetTransparency(LayerIndex, Transparency); 00096 } 00097 00098 void LCD_DISCO_F746NG::SetLayerAddress(uint32_t LayerIndex, uint32_t Address) 00099 { 00100 BSP_LCD_SetLayerAddress(LayerIndex, Address); 00101 } 00102 00103 void LCD_DISCO_F746NG::SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue) 00104 { 00105 BSP_LCD_SetColorKeying(LayerIndex, RGBValue); 00106 } 00107 00108 void LCD_DISCO_F746NG::ResetColorKeying(uint32_t LayerIndex) 00109 { 00110 BSP_LCD_ResetColorKeying(LayerIndex); 00111 } 00112 00113 void LCD_DISCO_F746NG::SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height) 00114 { 00115 BSP_LCD_SetLayerWindow(LayerIndex, Xpos, Ypos, Width, Height); 00116 } 00117 00118 void LCD_DISCO_F746NG::SelectLayer(uint32_t LayerIndex) 00119 { 00120 BSP_LCD_SelectLayer(LayerIndex); 00121 } 00122 00123 void LCD_DISCO_F746NG::SetLayerVisible(uint32_t LayerIndex, FunctionalState State) 00124 { 00125 BSP_LCD_SetLayerVisible(LayerIndex, State); 00126 } 00127 00128 void LCD_DISCO_F746NG::SetTextColor(uint32_t Color) 00129 { 00130 BSP_LCD_SetTextColor(Color); 00131 } 00132 00133 uint32_t LCD_DISCO_F746NG::GetTextColor(void) 00134 { 00135 return BSP_LCD_GetTextColor(); 00136 } 00137 00138 void LCD_DISCO_F746NG::SetBackColor(uint32_t Color) 00139 { 00140 BSP_LCD_SetBackColor(Color); 00141 } 00142 00143 uint32_t LCD_DISCO_F746NG::GetBackColor(void) 00144 { 00145 return BSP_LCD_GetBackColor(); 00146 } 00147 00148 void LCD_DISCO_F746NG::SetFont(sFONT *fonts) 00149 { 00150 BSP_LCD_SetFont(fonts); 00151 } 00152 00153 sFONT *LCD_DISCO_F746NG::GetFont(void) 00154 { 00155 return BSP_LCD_GetFont(); 00156 } 00157 00158 uint32_t LCD_DISCO_F746NG::ReadPixel(uint16_t Xpos, uint16_t Ypos) 00159 { 00160 return BSP_LCD_ReadPixel(Xpos, Ypos); 00161 } 00162 00163 void LCD_DISCO_F746NG::DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel) 00164 { 00165 BSP_LCD_DrawPixel(Xpos, Ypos, pixel); 00166 } 00167 00168 void LCD_DISCO_F746NG::Clear(uint32_t Color) 00169 { 00170 BSP_LCD_Clear(Color); 00171 } 00172 00173 void LCD_DISCO_F746NG::ClearStringLine(uint32_t Line) 00174 { 00175 BSP_LCD_ClearStringLine(Line); 00176 } 00177 00178 void LCD_DISCO_F746NG::DisplayStringAtLine(uint16_t Line, uint8_t *ptr) 00179 { 00180 BSP_LCD_DisplayStringAtLine(Line, ptr); 00181 } 00182 00183 void LCD_DISCO_F746NG::DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode) 00184 { 00185 BSP_LCD_DisplayStringAt(Xpos, Ypos, Text, Mode); 00186 } 00187 00188 void LCD_DISCO_F746NG::DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii) 00189 { 00190 BSP_LCD_DisplayChar(Xpos, Ypos, Ascii); 00191 } 00192 00193 void LCD_DISCO_F746NG::DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length) 00194 { 00195 BSP_LCD_DrawHLine(Xpos, Ypos, Length); 00196 } 00197 00198 void LCD_DISCO_F746NG::DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length) 00199 { 00200 BSP_LCD_DrawVLine(Xpos, Ypos, Length); 00201 } 00202 00203 void LCD_DISCO_F746NG::DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) 00204 { 00205 BSP_LCD_DrawLine(x1, y1, x2, y2); 00206 } 00207 00208 void LCD_DISCO_F746NG::DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height) 00209 { 00210 BSP_LCD_DrawRect(Xpos, Ypos, Width, Height); 00211 } 00212 00213 void LCD_DISCO_F746NG::DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius) 00214 { 00215 BSP_LCD_DrawCircle(Xpos, Ypos, Radius); 00216 } 00217 00218 void LCD_DISCO_F746NG::DrawPolygon(pPoint Points, uint16_t PointCount) 00219 { 00220 BSP_LCD_DrawPolygon(Points, PointCount); 00221 } 00222 00223 void LCD_DISCO_F746NG::DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius) 00224 { 00225 BSP_LCD_DrawEllipse(Xpos, Ypos, XRadius, YRadius); 00226 } 00227 00228 void LCD_DISCO_F746NG::DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp) 00229 { 00230 BSP_LCD_DrawBitmap(Xpos, Ypos, pbmp); 00231 } 00232 00233 void LCD_DISCO_F746NG::FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height) 00234 { 00235 BSP_LCD_FillRect(Xpos, Ypos, Width, Height); 00236 } 00237 00238 void LCD_DISCO_F746NG::FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius) 00239 { 00240 BSP_LCD_FillCircle(Xpos, Ypos, Radius); 00241 } 00242 00243 void LCD_DISCO_F746NG::FillPolygon(pPoint Points, uint16_t PointCount) 00244 { 00245 BSP_LCD_FillPolygon(Points, PointCount); 00246 } 00247 00248 void LCD_DISCO_F746NG::FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius) 00249 { 00250 BSP_LCD_FillEllipse(Xpos, Ypos, XRadius, YRadius); 00251 } 00252 00253 void LCD_DISCO_F746NG::DisplayOff(void) 00254 { 00255 BSP_LCD_DisplayOff(); 00256 } 00257 00258 void LCD_DISCO_F746NG::DisplayOn(void) 00259 { 00260 BSP_LCD_DisplayOn(); 00261 } 00262 00263 //================================================================================================================= 00264 // Private methods 00265 //=================================================================================================================
Generated on Wed Jul 13 2022 01:53:09 by 1.7.2