2025-08-05 16:06:46 +08:00
|
|
|
|
#ifndef __LCD_INIT_H
|
|
|
|
|
|
#define __LCD_INIT_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "sys.h"
|
|
|
|
|
|
|
2025-10-09 19:55:18 +08:00
|
|
|
|
extern uint8_t LCD_ROTATION;
|
|
|
|
|
|
extern uint8_t OFFSET_X;
|
|
|
|
|
|
extern uint8_t OFFSET_Y;
|
2025-08-05 16:06:46 +08:00
|
|
|
|
|
|
|
|
|
|
#define LCD_W 240
|
|
|
|
|
|
#define LCD_H 240
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------LCD<43>˿ڶ<CBBF><DAB6><EFBFBD>----------------
|
|
|
|
|
|
#define SCLK_PORT GPIOB
|
|
|
|
|
|
#define SCLK_PIN GPIO_PIN_13
|
|
|
|
|
|
|
|
|
|
|
|
#define SDA_PORT GPIOB
|
|
|
|
|
|
#define SDA_PIN GPIO_PIN_15
|
|
|
|
|
|
|
|
|
|
|
|
#define RES_PORT GPIOB
|
|
|
|
|
|
#define RES_PIN GPIO_PIN_12
|
|
|
|
|
|
|
|
|
|
|
|
#define DC_PORT GPIOA
|
|
|
|
|
|
#define DC_PIN GPIO_PIN_9
|
|
|
|
|
|
|
|
|
|
|
|
#define CS_PORT GPIOA
|
|
|
|
|
|
#define CS_PIN GPIO_PIN_8
|
|
|
|
|
|
|
|
|
|
|
|
#define BLK_PORT GPIOA
|
|
|
|
|
|
#define BLK_PIN GPIO_PIN_10
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_SCLK_Clr() HAL_GPIO_WritePin(SCLK_PORT,SCLK_PIN,GPIO_PIN_RESET)//SCL=SCLK
|
|
|
|
|
|
#define LCD_SCLK_Set() HAL_GPIO_WritePin(SCLK_PORT,SCLK_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_MOSI_Clr() HAL_GPIO_WritePin(SDA_PORT,SDA_PIN,GPIO_PIN_RESET)//SDA=MOSI
|
|
|
|
|
|
#define LCD_MOSI_Set() HAL_GPIO_WritePin(SDA_PORT,SDA_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_RES_Clr() HAL_GPIO_WritePin(RES_PORT,RES_PIN,GPIO_PIN_RESET)//RES
|
|
|
|
|
|
#define LCD_RES_Set() HAL_GPIO_WritePin(RES_PORT,RES_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_DC_Clr() HAL_GPIO_WritePin(DC_PORT,DC_PIN,GPIO_PIN_RESET)//DC
|
|
|
|
|
|
#define LCD_DC_Set() HAL_GPIO_WritePin(DC_PORT,DC_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_CS_Clr() HAL_GPIO_WritePin(CS_PORT,CS_PIN,GPIO_PIN_RESET)//CS
|
|
|
|
|
|
#define LCD_CS_Set() HAL_GPIO_WritePin(CS_PORT,CS_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
#define LCD_BLK_Clr() HAL_GPIO_WritePin(BLK_PORT,BLK_PIN,GPIO_PIN_RESET)//BLK
|
|
|
|
|
|
#define LCD_BLK_Set() HAL_GPIO_WritePin(BLK_PORT,BLK_PIN,GPIO_PIN_SET)
|
|
|
|
|
|
|
|
|
|
|
|
void LCD_GPIO_Init(void);//<2F><>ʼ<EFBFBD><CABC>GPIO
|
|
|
|
|
|
void LCD_Writ_Bus(u8 dat);//ģ<><C4A3>SPIʱ<49><CAB1>
|
|
|
|
|
|
void LCD_WR_DATA8(u8 dat);//д<><D0B4>һ<EFBFBD><D2BB><EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
|
void LCD_WR_DATA(u16 dat);//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
|
void LCD_WR_REG(u8 dat);//д<><D0B4>һ<EFBFBD><D2BB>ָ<EFBFBD><D6B8>
|
|
|
|
|
|
void LCD_Address_Set(u16 x1,u16 y1,u16 x2,u16 y2);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꺯<EFBFBD><EABAAF>
|
|
|
|
|
|
void LCD_Init(void);//LCD<43><44>ʼ<EFBFBD><CABC>
|
|
|
|
|
|
void LCD_Set_Light(uint8_t dc);
|
|
|
|
|
|
void LCD_Close_Light(void);
|
|
|
|
|
|
void LCD_ST7789_SleepIn(void);
|
|
|
|
|
|
void LCD_ST7789_SleepOut(void);
|
|
|
|
|
|
void LCD_Open_Light(void);
|
2025-10-18 19:23:22 +08:00
|
|
|
|
void LCD_SetRotation(uint16_t rotation);
|
|
|
|
|
|
|
2025-08-05 16:06:46 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|