GLCD Library

Committer:
montie97
Date:
Thu May 06 17:34:41 2021 +0000
Revision:
0:042c996f9c02
Prima prova di commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
montie97 0:042c996f9c02 1 /****************************************Copyright (c)**************************************************
montie97 0:042c996f9c02 2 **
montie97 0:042c996f9c02 3 ** http://www.powermcu.com
montie97 0:042c996f9c02 4 **
montie97 0:042c996f9c02 5 **--------------File Info-------------------------------------------------------------------------------
montie97 0:042c996f9c02 6 ** File name: GLCD.h
montie97 0:042c996f9c02 7 ** Descriptions: Has been tested SSD1289��ILI9320��R61505U��SSD1298��ST7781��SPFD5408B��ILI9325��ILI9328��
montie97 0:042c996f9c02 8 ** HX8346A��HX8347A
montie97 0:042c996f9c02 9 **------------------------------------------------------------------------------------------------------
montie97 0:042c996f9c02 10 ** Created by: AVRman
montie97 0:042c996f9c02 11 ** Created date: 2012-3-10
montie97 0:042c996f9c02 12 ** Version: 1.3
montie97 0:042c996f9c02 13 ** Descriptions: The original version
montie97 0:042c996f9c02 14 **
montie97 0:042c996f9c02 15 **------------------------------------------------------------------------------------------------------
montie97 0:042c996f9c02 16 ** Modified by:
montie97 0:042c996f9c02 17 ** Modified date:
montie97 0:042c996f9c02 18 ** Version:
montie97 0:042c996f9c02 19 ** Descriptions:
montie97 0:042c996f9c02 20 ********************************************************************************************************/
montie97 0:042c996f9c02 21
montie97 0:042c996f9c02 22 #ifndef __GLCD_H
montie97 0:042c996f9c02 23 #define __GLCD_H
montie97 0:042c996f9c02 24
montie97 0:042c996f9c02 25 /* Includes ------------------------------------------------------------------*/
montie97 0:042c996f9c02 26 #include "LPC17xx.h"
montie97 0:042c996f9c02 27
montie97 0:042c996f9c02 28 /* Private define ------------------------------------------------------------*/
montie97 0:042c996f9c02 29
montie97 0:042c996f9c02 30 /* LCD Interface */
montie97 0:042c996f9c02 31 #define PIN_EN (1 << 19)
montie97 0:042c996f9c02 32 #define PIN_LE (1 << 20)
montie97 0:042c996f9c02 33 #define PIN_DIR (1 << 21)
montie97 0:042c996f9c02 34 #define PIN_CS (1 << 22)
montie97 0:042c996f9c02 35 #define PIN_RS (1 << 23)
montie97 0:042c996f9c02 36 #define PIN_WR (1 << 24)
montie97 0:042c996f9c02 37 #define PIN_RD (1 << 25)
montie97 0:042c996f9c02 38
montie97 0:042c996f9c02 39 #define LCD_EN(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_EN) : (LPC_GPIO0->FIOCLR = PIN_EN));
montie97 0:042c996f9c02 40 #define LCD_LE(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_LE) : (LPC_GPIO0->FIOCLR = PIN_LE));
montie97 0:042c996f9c02 41 #define LCD_DIR(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_DIR) : (LPC_GPIO0->FIOCLR = PIN_DIR));
montie97 0:042c996f9c02 42 #define LCD_CS(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_CS) : (LPC_GPIO0->FIOCLR = PIN_CS));
montie97 0:042c996f9c02 43 #define LCD_RS(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_RS) : (LPC_GPIO0->FIOCLR = PIN_RS));
montie97 0:042c996f9c02 44 #define LCD_WR(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_WR) : (LPC_GPIO0->FIOCLR = PIN_WR));
montie97 0:042c996f9c02 45 #define LCD_RD(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_RD) : (LPC_GPIO0->FIOCLR = PIN_RD));
montie97 0:042c996f9c02 46
montie97 0:042c996f9c02 47 /* Private define ------------------------------------------------------------*/
montie97 0:042c996f9c02 48 #define DISP_ORIENTATION 0 /* angle 0 90 */
montie97 0:042c996f9c02 49
montie97 0:042c996f9c02 50 #if ( DISP_ORIENTATION == 90 ) || ( DISP_ORIENTATION == 270 )
montie97 0:042c996f9c02 51
montie97 0:042c996f9c02 52 #define MAX_X 320
montie97 0:042c996f9c02 53 #define MAX_Y 240
montie97 0:042c996f9c02 54
montie97 0:042c996f9c02 55 #elif ( DISP_ORIENTATION == 0 ) || ( DISP_ORIENTATION == 180 )
montie97 0:042c996f9c02 56
montie97 0:042c996f9c02 57 #define MAX_X 240
montie97 0:042c996f9c02 58 #define MAX_Y 320
montie97 0:042c996f9c02 59
montie97 0:042c996f9c02 60 #endif
montie97 0:042c996f9c02 61
montie97 0:042c996f9c02 62 /* LCD color */
montie97 0:042c996f9c02 63 #define White 0xFFFF
montie97 0:042c996f9c02 64 #define Black 0x0000
montie97 0:042c996f9c02 65 #define Grey 0xF7DE
montie97 0:042c996f9c02 66 #define Blue 0x001F
montie97 0:042c996f9c02 67 #define Blue2 0x051F
montie97 0:042c996f9c02 68 #define Red 0xF800
montie97 0:042c996f9c02 69 #define Magenta 0xF81F
montie97 0:042c996f9c02 70 #define Green 0x07E0
montie97 0:042c996f9c02 71 #define Green2 0x1641
montie97 0:042c996f9c02 72 #define Cyan 0x7FFF
montie97 0:042c996f9c02 73 #define Yellow 0xFFE0
montie97 0:042c996f9c02 74
montie97 0:042c996f9c02 75 /******************************************************************************
montie97 0:042c996f9c02 76 * Function Name : RGB565CONVERT
montie97 0:042c996f9c02 77 * Description : 24λת��16λ
montie97 0:042c996f9c02 78 * Input : - red: R
montie97 0:042c996f9c02 79 * - green: G
montie97 0:042c996f9c02 80 * - blue: B
montie97 0:042c996f9c02 81 * Output : None
montie97 0:042c996f9c02 82 * Return : RGB ��ɫֵ
montie97 0:042c996f9c02 83 * Attention : None
montie97 0:042c996f9c02 84 *******************************************************************************/
montie97 0:042c996f9c02 85 #define RGB565CONVERT(red, green, blue)\
montie97 0:042c996f9c02 86 (uint16_t)( (( red >> 3 ) << 11 ) | \
montie97 0:042c996f9c02 87 (( green >> 2 ) << 5 ) | \
montie97 0:042c996f9c02 88 ( blue >> 3 ))
montie97 0:042c996f9c02 89
montie97 0:042c996f9c02 90 /* Private function prototypes -----------------------------------------------*/
montie97 0:042c996f9c02 91 void LCD_Initialization(void);
montie97 0:042c996f9c02 92 void LCD_Clear(uint16_t Color);
montie97 0:042c996f9c02 93 uint16_t LCD_GetPoint(uint16_t Xpos,uint16_t Ypos);
montie97 0:042c996f9c02 94 void LCD_SetPoint(uint16_t Xpos,uint16_t Ypos,uint16_t point);
montie97 0:042c996f9c02 95 void LCD_DrawLine( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1 , uint16_t color );
montie97 0:042c996f9c02 96 void PutChar( uint16_t Xpos, uint16_t Ypos, uint8_t ASCI, uint16_t charColor, uint16_t bkColor, int size ); //scrivo un carattere
montie97 0:042c996f9c02 97 void GUI_Text(uint16_t Xpos, uint16_t Ypos, uint8_t *str,uint16_t Color, uint16_t bkColor, int size); //scrivo una stringa
montie97 0:042c996f9c02 98 void PutChinese(uint16_t Xpos,uint16_t Ypos,uint8_t *str,uint16_t Color,uint16_t bkColor);
montie97 0:042c996f9c02 99 void GUI_Chinese(uint16_t Xpos, uint16_t Ypos, uint8_t *str,uint16_t Color, uint16_t bkColor);
montie97 0:042c996f9c02 100
montie97 0:042c996f9c02 101 #endif
montie97 0:042c996f9c02 102
montie97 0:042c996f9c02 103 /*********************************************************************************************************
montie97 0:042c996f9c02 104 END FILE
montie97 0:042c996f9c02 105 *********************************************************************************************************/
montie97 0:042c996f9c02 106