lcdconf_0741_m2_m128x100.h

来自「uCGUI」· C头文件 代码 · 共 61 行

H
61
字号
/*************************************************************************************************************
                                                   uC/GUI
                                               嵌入式通用图形软件
文    件: LCDConf_0741_M2_M128x100.h
描    述: Sample configuration file
*************************************************************************************************************/
#ifndef LCDCONF_H
#define LCDCONF_H

/*************************************************************************************************************
                   General configuration of LCD
*************************************************************************************************************/
#define LCD_CONTROLLER (741)
#define LCD_XSIZE      (128)   /* X-resolution of LCD, Logical coor. */
#define LCD_YSIZE      (100)   /* Y-resolution of LCD, Logical coor. */
#define LCD_REVERSE     1

#define LCD_FIRSTSEG0   0
#define LCD_LASTSEG0    (LCD_XSIZE + LCD_FIRSTSEG0 - 1)

#define LCD_BITSPERPIXEL (2)

/*************************************************************************************************************
                   Simple bus configuration
*************************************************************************************************************/
void LCD_X_Init(void);
void LCD_X_Write01(char Data);
void LCD_X_WriteM01(char * pData, int NumBytes);
void LCD_X_Write00(char Cmd);
#define LCD_WRITE_A1(data)            LCD_X_Write01(data)
#define LCD_WRITEM_A1(data, NumBytes) LCD_X_WriteM01(data, NumBytes)
#define LCD_WRITE_A0(cmd)             LCD_X_Write00(cmd)

/*************************************************************************************************************
                   Initialisation macro
*************************************************************************************************************/

#define LCD_INIT_CONTROLLER()   \
  LCD_X_Init();  \
  LCD_WRITE_A0(0xe2);                     /* Reset */  \
  LCD_WRITE_A0(0x2f);                     /* Power control on  xxx Change needed !!!*/  \
  LCD_WRITE_A0(0x67);                     /* Set DC DC to 6 times */  \
  LCD_WRITE_A0(0xc0);                     /* COM direction */  \
  LCD_WRITE_A0(0xa1);                     /* SEG direction */  \
  LCD_WRITE_A0(0x44); LCD_WRITE_A0(0x0);  /* Set first COM to COM0 */  \
  LCD_WRITE_A0(0xab);                     /* Turn oscillator on */  \
  LCD_WRITE_A0(0x88); LCD_WRITE_A0(0x0);  /* Set gray level 0 */  \
  LCD_WRITE_A0(0x8a); LCD_WRITE_A0(0x44); /* Set gray level 1 */  \
  LCD_WRITE_A0(0x8c); LCD_WRITE_A0(0x66); /* Set gray level 2 */  \
  LCD_WRITE_A0(0x8e); LCD_WRITE_A0(0x99); /* Set gray level 3 */  \
  LCD_WRITE_A0(0x90); \
  LCD_WRITE_A0(0x48); LCD_WRITE_A0(0x81); /* Set Duty cycle */    \
  LCD_WRITE_A0(0x81); LCD_WRITE_A0(0x23); /* Set el. volume register */ \
  LCD_WRITE_A0(0x25); \
  LCD_WRITE_A0(0x55); \
  LCD_WRITE_A0(0x40); LCD_WRITE_A0(0x72); /* Start line */ \
  LCD_WRITE_A0(0xaf);

#endif /* LCDCONF_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?