TFT_LCD.h 2.41 KB
Newer Older
崔立宝's avatar
崔立宝 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
/******************************************************************************
文 件 名:TFT_LCD.h
功能描述:TFT彩色液晶显示屏控制函数库头文件
作    者:张暄
版    本:V1.0
日    期:2017.4.8
******************************************************************************/

#ifndef _TFT_LCD_H_
#define _TFT_LCD_H_

#include "PWM.h"
#include "YGV642.h"
#include "mapData.h"

/******************************************************************************
层状态缓存结构
******************************************************************************/
typedef struct
{
  uint8_t   LyrEn;
  uint8_t   Scale;
  uint16_t  SpriteID;
  uint16_t  PosX;
  uint16_t  PosY;
} TFTLCDLayerStatusStruct;

/******************************************************************************
图片缓存结构
******************************************************************************/
typedef struct
{
  uint8_t   UpdateCnt;
  uint8_t   Buffer[12];
} TFTLCDLayerBufferStruct;

/******************************************************************************
显示更新控制结构
******************************************************************************/
typedef struct
{
  uint8_t   TblUpdate;
  uint8_t   Timer;
  uint8_t   State;
  uint8_t   Step;
  uint16_t  LyrBaseAddr;
  uint16_t  CurrentLyr;
  uint8_t   BytePtr;
  uint8_t   AddrBuffer[2];
  uint8_t   Data[12];
  uint8_t   Brightness;
  uint8_t   Enable;
} TFTLCDUpdateCtrlStruct;

/******************************************************************************
空白图像数据
******************************************************************************/
static const uint8_t TFTLCDBlankLayer[12] = SET_LYR_ERASE_ATTR_DEF;

/******************************************************************************
函数声明
******************************************************************************/
void TFT_LCD_Display_Sprite(uint16_t LyrId, uint16_t SpriteID, uint16_t PosX, uint16_t PosY, uint8_t Scale);
void TFT_LCD_Clear_Layer(uint16_t LyrId);
void TFT_LCD_Clear_Multi_Layer(uint16_t LyrIdLo, uint16_t LyrIdHi);

void TFT_LCD_Startup(void);
void TFT_LCD_Shutdown(void);
void TFT_LCD_Set_Brightness(uint8_t Br);
void TFT_LCD_Display_Update_Service(void);

void TFT_LCD_Update_Layer_Buffer(uint16_t LyrId, uint16_t SpriteID, uint16_t PosX, uint16_t PosY, uint8_t Scale);
void TFT_LCD_Start_Update_General_Table(void);
uint8_t TFT_LCD_Get_General_Table_Update_Status(void);
void TFT_LCD_General_Table_Write_Service(void);




#endif