C035QAN01.h 2.55 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

#ifndef _C035QAN01_H_
#define _C035QAN01_H_

#include "stdint.h"
#include "API.h"
#include "GPIO.h"
#include "Simulated_SPI_Master.h"

/**********************************************************************************
显示设置
**********************************************************************************/
#define   LCD_VERTICAL_DOWN_TO_UP           0           //垂直刷屏方向 0:由上至下
                                                        //             1:由下至上
#define   LCD_HORIZONTAL_RIGHT_TO_LEFT      0           //水平刷屏方向 0:由左至右
                                                        //             1:由右至左
#define   LCD_USE_SYNC_MODE                 1           //数据模式     0:DE模式
                                                        //             1:SYNC模式
                                                        
/**********************************************************************************
寄存器参数预处理
**********************************************************************************/
#if       LCD_VERTICAL_DOWN_TO_UP
  #define LCD_REG_VDIR                      ((uint16_t)0x0080)
#else
  #define LCD_REG_VDIR                      ((uint16_t)0x0000)
#endif

#if       LCD_HORIZONTAL_RIGHT_TO_LEFT
  #define LCD_REG_HDIR                      ((uint16_t)0x0080)
#else
  #define LCD_REG_HDIR                      ((uint16_t)0x0000)
#endif

#if       LCD_USE_SYNC_MODE
  #define LCD_REG_SYNC_DE                   ((uint16_t)0x0020)
#else
  #define LCD_REG_SYNC_DE                   ((uint16_t)0x0000)
#endif
                                             
/**********************************************************************************
初始化数据表
**********************************************************************************/
/*** Gamma Setting ***/
static const uint16_t LCDGammaSetting[] = 
{ 
  0x1800, 0x190F, 0x1A1A, 0x1B1F, 0x1C27, 0x1D0E, 0x1E0D, 0x1F10, 0x200C, 0x2106,
  0x220B, 0x230A, 0x2404, 0x250B, 0x260C, 0x270E, 0x280E, 0x291E, 0x2A14, 0x2B10,
  0x2C0B, 0x2D04, 0x2E04, 0x2F0B, 0x3010, 0x3114, 0x321E, 0x330E, 0x340E, 0x350C,
  0x360B, 0x3704, 0x380A, 0x390B, 0x3A06, 0x3B0C, 0x3C10, 0x3D0D, 0x3E0E, 0x3F27,
  0x801F, 0x811C, 0x8213, 0x8309, 
};

/*** Fine Tune Charge Pump Setting ***/
static const uint16_t LCDChargePumpSetting[] =
{
  0xBF02, 0x0608, 0x0764, 0xBF00, 0xB1C0,
};

/**********************************************************************************
函数声明
**********************************************************************************/ 
void LCD_Init(void);
void LCD_Wait_ms(uint8_t msCnt);

#endif