110 lines
2.6 KiB
C
110 lines
2.6 KiB
C
|
|
#ifndef __Lcd_Driver_H
|
|||
|
|
#define __Lcd_Driver_H
|
|||
|
|
|
|||
|
|
#include "sys.h"
|
|||
|
|
#include "stdint.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define X_MAX_PIXEL 128
|
|||
|
|
#define Y_MAX_PIXEL 128
|
|||
|
|
|
|||
|
|
|
|||
|
|
//********************************************************************************
|
|||
|
|
|
|||
|
|
//DevEBox <20><>Խ<EFBFBD><D4BD><EFBFBD>ӣ<EFBFBD>Ƕ<EFBFBD><C7B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>mcudev.taobao.com
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>shop389957290.taobao.com
|
|||
|
|
|
|||
|
|
//********************************************************************************
|
|||
|
|
|
|||
|
|
|
|||
|
|
//STM32<33><32><EFBFBD>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
//<2F>⺯<EFBFBD><E2BAAF><EFBFBD>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define RED 0xf800
|
|||
|
|
#define GREEN 0x07e0
|
|||
|
|
#define BLUE 0x001f
|
|||
|
|
#define WHITE 0xffff
|
|||
|
|
#define BLACK 0x0000
|
|||
|
|
#define YELLOW 0xFFE0
|
|||
|
|
#define GRAY0 0xEF7D //<2F><>ɫ0
|
|||
|
|
#define GRAY1 0x8410 //<2F><>ɫ1
|
|||
|
|
#define GRAY2 0x4208 //<2F><>ɫ2
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Һ<><D2BA><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><C6BF><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>궨<EFBFBD><EAB6A8>
|
|||
|
|
#define LCD_SDA_SET HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,GPIO_PIN_SET) //PB15<31><35>1
|
|||
|
|
|
|||
|
|
#define LCD_SCL_SET HAL_GPIO_WritePin(GPIOB,GPIO_PIN_13,GPIO_PIN_SET) //PB13<31><33>1
|
|||
|
|
|
|||
|
|
#define LCD_CS_SET HAL_GPIO_WritePin(GPIOB,GPIO_PIN_12,GPIO_PIN_SET) //PB12<31><32>1
|
|||
|
|
|
|||
|
|
#define LCD_RST_Set() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_14,GPIO_PIN_SET) //PB14<31><34>1
|
|||
|
|
|
|||
|
|
#define LCD_RS_SET HAL_GPIO_WritePin(GPIOB,GPIO_PIN_1,GPIO_PIN_SET) //PB1<42><31>1
|
|||
|
|
|
|||
|
|
#define LCD_BLK_SET HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,GPIO_PIN_SET) //PB0<42><30>1
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Һ<><D2BA><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><C6BF><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>궨<EFBFBD><EAB6A8>
|
|||
|
|
|
|||
|
|
#define LCD_SDA_CLR HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,GPIO_PIN_RESET) //PB15<31><35>0 //DIN
|
|||
|
|
|
|||
|
|
#define LCD_SCL_CLR HAL_GPIO_WritePin(GPIOB,GPIO_PIN_13,GPIO_PIN_RESET) //PB13<31><33>0 //CLK
|
|||
|
|
|
|||
|
|
#define LCD_CS_CLR HAL_GPIO_WritePin(GPIOB,GPIO_PIN_12,GPIO_PIN_RESET) //PB12<31><32>0/CS
|
|||
|
|
|
|||
|
|
#define LCD_RST_Clr() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_14,GPIO_PIN_RESET) //PB14<31><34>0 //RES
|
|||
|
|
|
|||
|
|
#define LCD_RS_CLR HAL_GPIO_WritePin(GPIOB,GPIO_PIN_1,GPIO_PIN_RESET) //PB1<42><31>0 //DC
|
|||
|
|
|
|||
|
|
#define LCD_BLK_CLR HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,GPIO_PIN_RESET) //PB0<42><30>0 //DIN
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void LCD_GPIO_Init(void);
|
|||
|
|
void Lcd_WriteIndex(uint8_t Index);
|
|||
|
|
void Lcd_WriteData(uint8_t Data);
|
|||
|
|
void Lcd_WriteReg(uint8_t Index,uint8_t Data);
|
|||
|
|
uint16_t Lcd_ReadReg(uint8_t LCD_Reg);
|
|||
|
|
void Lcd_Reset(void);
|
|||
|
|
void Lcd_Init(void);
|
|||
|
|
void Lcd_Clear(uint16_t Color);
|
|||
|
|
void Lcd_SetXY(uint16_t x,uint16_t y);
|
|||
|
|
void Gui_DrawPoint(uint16_t x,uint16_t y,uint16_t Data);
|
|||
|
|
void Lcd_SetRegion(uint16_t x_start,uint16_t y_start,uint16_t x_end,uint16_t y_end);
|
|||
|
|
void LCD_WriteData_16Bit(uint16_t Data);
|
|||
|
|
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//********************************************************************************
|
|||
|
|
|
|||
|
|
//DevEBox <20><>Խ<EFBFBD><D4BD><EFBFBD>ӣ<EFBFBD>Ƕ<EFBFBD><C7B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>mcudev.taobao.com
|
|||
|
|
//<2F>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>shop389957290.taobao.com
|
|||
|
|
|
|||
|
|
//********************************************************************************
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|