This class drives the LCD display present on the DISCO_F469NI board.

Dependents:   DISCO-F469NI_LCDTS_GUI_demo DISCO-F469NI_LCD_demo Configurable_Robots DISCO-F469NI_LCD_demo ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD_DISCO_F469NI.cpp Source File

LCD_DISCO_F469NI.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_F469NI.h"
00020 
00021 // Constructor
00022 LCD_DISCO_F469NI::LCD_DISCO_F469NI()
00023 {
00024   BSP_LCD_Init();
00025   BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE);
00026   BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_FB_START_ADDRESS);
00027   BSP_LCD_SetFont(&Font20);
00028   BSP_LCD_Clear(LCD_COLOR_WHITE);
00029 }
00030 
00031 // Destructor
00032 LCD_DISCO_F469NI::~LCD_DISCO_F469NI()
00033 {
00034 
00035 }
00036 
00037 //=================================================================================================================
00038 // Public methods
00039 //=================================================================================================================
00040 
00041 uint8_t LCD_DISCO_F469NI::Init(void)
00042 {
00043   return BSP_LCD_Init();
00044 }
00045 
00046 uint8_t LCD_DISCO_F469NI::InitEx(LCD_OrientationTypeDef orientation)
00047 {
00048   return BSP_LCD_InitEx(orientation);
00049 }
00050 
00051 void LCD_DISCO_F469NI::Reset(void)
00052 {
00053   BSP_LCD_Reset();
00054 }
00055 
00056 uint32_t LCD_DISCO_F469NI::GetXSize(void)
00057 {
00058   return BSP_LCD_GetXSize();
00059 }
00060 
00061 uint32_t LCD_DISCO_F469NI::GetYSize(void)
00062 {
00063   return BSP_LCD_GetYSize();
00064 }
00065 
00066 void LCD_DISCO_F469NI::SetXSize(uint32_t imageWidthPixels)
00067 {
00068   BSP_LCD_SetXSize(imageWidthPixels);
00069 }
00070 
00071 void LCD_DISCO_F469NI::SetYSize(uint32_t imageHeightPixels)
00072 {
00073   BSP_LCD_SetYSize(imageHeightPixels);
00074 }
00075 
00076 void LCD_DISCO_F469NI::LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
00077 {
00078   BSP_LCD_LayerDefaultInit(LayerIndex, FB_Address);
00079 }
00080 
00081 void LCD_DISCO_F469NI::SelectLayer(uint32_t LayerIndex)
00082 {
00083   BSP_LCD_SelectLayer(LayerIndex);
00084 }
00085 
00086 void LCD_DISCO_F469NI::SetLayerVisible(uint32_t LayerIndex, FunctionalState State)
00087 {
00088   BSP_LCD_SetLayerVisible(LayerIndex, State);
00089 }
00090 
00091 void LCD_DISCO_F469NI::SetTransparency(uint32_t LayerIndex, uint8_t Transparency)
00092 {
00093   BSP_LCD_SetTransparency(LayerIndex, Transparency);
00094 }
00095 
00096 void LCD_DISCO_F469NI::SetLayerAddress(uint32_t LayerIndex, uint32_t Address)
00097 {
00098   BSP_LCD_SetLayerAddress(LayerIndex, Address);
00099 }
00100 
00101 void LCD_DISCO_F469NI::SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00102 {
00103   BSP_LCD_SetLayerWindow(LayerIndex, Xpos, Ypos, Width, Height);
00104 }
00105 
00106 void LCD_DISCO_F469NI::SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue)
00107 {
00108   BSP_LCD_SetColorKeying(LayerIndex, RGBValue);
00109 }
00110 
00111 void LCD_DISCO_F469NI::ResetColorKeying(uint32_t LayerIndex)
00112 {
00113   BSP_LCD_ResetColorKeying(LayerIndex);
00114 }
00115 
00116 void LCD_DISCO_F469NI::SetTextColor(uint32_t Color)
00117 {
00118   BSP_LCD_SetTextColor(Color);
00119 }
00120 
00121 uint32_t LCD_DISCO_F469NI::GetTextColor(void)
00122 {
00123   return BSP_LCD_GetTextColor();
00124 }
00125 
00126 void LCD_DISCO_F469NI::SetBackColor(uint32_t Color)
00127 {
00128   BSP_LCD_SetBackColor(Color);
00129 }
00130 
00131 uint32_t LCD_DISCO_F469NI::GetBackColor(void)
00132 {
00133   return BSP_LCD_GetBackColor();
00134 }
00135 
00136 void LCD_DISCO_F469NI::SetFont(sFONT *fonts)
00137 {
00138   BSP_LCD_SetFont(fonts);
00139 }
00140 
00141 sFONT *LCD_DISCO_F469NI::GetFont(void)
00142 {
00143   return BSP_LCD_GetFont();
00144 }
00145 
00146 uint32_t LCD_DISCO_F469NI::ReadPixel(uint16_t Xpos, uint16_t Ypos)
00147 {
00148   return BSP_LCD_ReadPixel(Xpos, Ypos);
00149 }
00150 
00151 void LCD_DISCO_F469NI::Clear(uint32_t Color)
00152 {
00153   BSP_LCD_Clear(Color);
00154 }
00155 
00156 void LCD_DISCO_F469NI::ClearStringLine(uint32_t Line)
00157 {
00158   BSP_LCD_ClearStringLine(Line);
00159 }
00160 
00161 void LCD_DISCO_F469NI::DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00162 {
00163   BSP_LCD_DisplayChar(Xpos, Ypos, Ascii);
00164 }
00165 
00166 void LCD_DISCO_F469NI::DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
00167 {
00168   BSP_LCD_DisplayStringAt(Xpos, Ypos, Text, Mode);
00169 }
00170 
00171 void LCD_DISCO_F469NI::DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
00172 {
00173   BSP_LCD_DisplayStringAtLine(Line, ptr);
00174 }
00175 
00176 void LCD_DISCO_F469NI::DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00177 {
00178   BSP_LCD_DrawHLine(Xpos, Ypos, Length);
00179 }
00180 
00181 void LCD_DISCO_F469NI::DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00182 {
00183   BSP_LCD_DrawVLine(Xpos, Ypos, Length);
00184 }
00185 
00186 void LCD_DISCO_F469NI::DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
00187 {
00188   BSP_LCD_DrawLine(x1, y1, x2, y2);
00189 }
00190 
00191 void LCD_DISCO_F469NI::DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00192 {
00193   BSP_LCD_DrawRect(Xpos, Ypos, Width, Height);
00194 }
00195 
00196 void LCD_DISCO_F469NI::DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00197 {
00198   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
00199 }
00200 
00201 void LCD_DISCO_F469NI::DrawPolygon(pPoint Points, uint16_t PointCount)
00202 {
00203   BSP_LCD_DrawPolygon(Points, PointCount);
00204 }
00205 
00206 void LCD_DISCO_F469NI::DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00207 {
00208   BSP_LCD_DrawEllipse(Xpos, Ypos, XRadius, YRadius);
00209 }
00210 
00211 void LCD_DISCO_F469NI::DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
00212 {
00213   BSP_LCD_DrawBitmap(Xpos, Ypos, pbmp);
00214 }
00215 
00216 void LCD_DISCO_F469NI::FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00217 {
00218   BSP_LCD_FillRect(Xpos, Ypos, Width, Height);
00219 }
00220 
00221 void LCD_DISCO_F469NI::FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00222 {
00223   BSP_LCD_FillCircle(Xpos, Ypos, Radius);
00224 }
00225 
00226 void LCD_DISCO_F469NI::FillPolygon(pPoint Points, uint16_t PointCount)
00227 {
00228   BSP_LCD_FillPolygon(Points, PointCount);
00229 }
00230 
00231 void LCD_DISCO_F469NI::FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00232 {
00233   BSP_LCD_FillEllipse(Xpos, Ypos, XRadius, YRadius);
00234 }
00235 
00236 void LCD_DISCO_F469NI::DisplayOn(void)
00237 {
00238   BSP_LCD_DisplayOn();
00239 }
00240 
00241 void LCD_DISCO_F469NI::DisplayOff(void)
00242 {
00243   BSP_LCD_DisplayOff();
00244 }
00245 
00246 void LCD_DISCO_F469NI::DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
00247 {
00248   BSP_LCD_DrawPixel(Xpos, Ypos, RGB_Code);
00249 }
00250 
00251 //=================================================================================================================
00252 // Private methods
00253 //=================================================================================================================