Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX17055 MAX32620FTHR MAX77650 SerialGPS
LCD_Driver.h
00001 #ifndef __LCD_DRIVER_H 00002 #define __LCD_DRIVER_H 00003 00004 #include "mbed.h" 00005 #include <stdint.h> 00006 #include "fonts.h" 00007 00008 #define COLOR uint16_t //The variable type of the color (unsigned short) 00009 #define POINT uint16_t //The type of coordinate (unsigned short) 00010 #define LENGTH uint16_t //The type of coordinate (unsigned short) 00011 00012 /******************************************************************************** 00013 function: 00014 Define the full screen height length of the display 00015 ********************************************************************************/ 00016 //#define LCD_1IN44 00017 #define LCD_1IN8 00018 #if defined(LCD_1IN44) 00019 #define LCD_WIDTH 128 //LCD width 00020 #define LCD_HEIGHT 128 //LCD height 00021 #define LCD_X 2 00022 #define LCD_Y 1 00023 #elif defined(LCD_1IN8) 00024 #define LCD_WIDTH 160 //LCD width 00025 #define LCD_HEIGHT 128 //LCD height 00026 #define LCD_X 1 00027 #define LCD_Y 2 00028 #endif 00029 00030 #define LCD_X_MAXPIXEL 132 //LCD width maximum memory 00031 #define LCD_Y_MAXPIXEL 162 //LCD height maximum memory 00032 00033 00034 /******************************************************************************** 00035 function: 00036 scanning method 00037 ********************************************************************************/ 00038 typedef enum{ 00039 L2R_U2D = 0, //The display interface is displayed , left to right, up to down 00040 L2R_D2U , 00041 R2L_U2D , 00042 R2L_D2U , 00043 00044 U2D_L2R , 00045 U2D_R2L , 00046 D2U_L2R , 00047 D2U_R2L , 00048 }LCD_SCAN_DIR; 00049 #define SCAN_DIR_DFT U2D_R2L //Default scan direction = L2R_U2D 00050 00051 /******************************************************************************** 00052 function: 00053 Defines the total number of rows in the display area 00054 ********************************************************************************/ 00055 00056 typedef struct{ 00057 LENGTH LCD_Dis_Column; //COLUMN 00058 LENGTH LCD_Dis_Page; //PAGE 00059 LCD_SCAN_DIR LCD_Scan_Dir; 00060 POINT LCD_X_Adjust; //LCD x actual display position calibration 00061 POINT LCD_Y_Adjust; //LCD y actual display position calibration 00062 }LCD_DIS; 00063 00064 /******************************************************************************** 00065 function: 00066 Macro definition variable name 00067 ********************************************************************************/ 00068 void LCD_Init( LCD_SCAN_DIR Lcd_ScanDir ); 00069 void LCD_SetGramScanWay(LCD_SCAN_DIR Scan_dir); 00070 00071 //LCD set cursor + windows + color 00072 void LCD_SetWindows( POINT Xstart, POINT Ystart, POINT Xend, POINT Yend ); 00073 void LCD_SetCursor ( POINT Xpoint, POINT Ypoint ); 00074 void LCD_SetColor( COLOR Color ,POINT Xpoint, POINT Ypoint); 00075 void LCD_SetPointlColor ( POINT Xpoint, POINT Ypoint, COLOR Color ); 00076 void LCD_SetArealColor ( POINT Xstart, POINT Ystart, POINT Xend, POINT Yend,COLOR Color); 00077 void LCD_Clear(COLOR Color); 00078 00079 void DC_OUTPUT(); 00080 void DC_LOW(); 00081 void DC_HIGH(); 00082 00083 void RST_OUTPUT(); 00084 void RST_LOW(); 00085 void RST_HIGH(); 00086 00087 #endif
Generated on Thu Jul 14 2022 11:13:12 by
1.7.2