mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
移动文件夹
This commit is contained in:
68
software/Power_Pico/BSP/LCD/lcd_init.h
Normal file
68
software/Power_Pico/BSP/LCD/lcd_init.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef __LCD_INIT_H
|
||||
#define __LCD_INIT_H
|
||||
|
||||
#include "sys.h"
|
||||
|
||||
extern uint8_t LCD_ROTATION;
|
||||
extern uint8_t OFFSET_X;
|
||||
extern uint8_t OFFSET_Y;
|
||||
|
||||
#define LCD_W 240
|
||||
#define LCD_H 240
|
||||
|
||||
//-----------------LCD端口定义----------------
|
||||
#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);//初始化GPIO
|
||||
void LCD_Writ_Bus(u8 dat);//模拟SPI时序
|
||||
void LCD_WR_DATA8(u8 dat);//写入一个字节
|
||||
void LCD_WR_DATA(u16 dat);//写入两个字节
|
||||
void LCD_WR_REG(u8 dat);//写入一个指令
|
||||
void LCD_Address_Set(u16 x1,u16 y1,u16 x2,u16 y2);//设置坐标函数
|
||||
void LCD_Init(void);//LCD初始化
|
||||
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);
|
||||
void LCD_SetRotation(uint16_t rotation);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user