lcd_driver.h

来自「一个LCD驱动程序」· C头文件 代码 · 共 61 行

H
61 行
字号
//*****************************************************************************
//
//  File........: LCD_Driver.h
//
//  Author(s)...: ATMEL Norway
//
//  Target(s)...: ATmega169
//
//  Description.: Defines and prototypes for LCD_Driver.c
//
//  Revisions...: 1.0
//
//  YYYYMMDD - VER. - COMMENT                                       - SIGN.
//
//  20020606 - 0.10 - File created                                  - RM
//  20021010 - 1.0  - Clean up                                      - JLL
//
//*****************************************************************************


/**************************************************************/
// Definitions
/**************************************************************/
#define LCD_INITIAL_CONTRAST 0x0F
#define LCD_TIMER_SEED		15
#define LCD_REGISTER_COUNT  20

/**************************************************************/
//MACROS
/**************************************************************/
#define LCD_SET_COLON(active) LCD_displayData[8]=active; //active =[TRUE;FALSE]
#define pLCDREG (*(unsigned char *)(0xEC))                // DEVICE SPECIFIC!!! (ATmega169)
#define LCD_CONTRAST_LEVEL(level) LCDCCR=(0x0F & level);  // DEVICE SPECIFIC!!! (ATmega169)

/**************************************************************/
// Global functions
/**************************************************************/
void LCD_Init (void);
void LCD_WriteDigit(unsigned char input, unsigned char digit);
void LCD_AllSegments(unsigned char);

/**************************************************************/
// Global variables
/**************************************************************/
union _LCD_status{
  unsigned char allFields;
  struct{
    unsigned char updateRequired : 1; //Indicates that the LCD_displayData should be latched to the LCD Data Regs
                                      // Can be used to block LCD updating, while updating LCD_displayData.
    unsigned char updateComplete : 1; //Indicates that the LCD_displayData has been latched to the LCD Data Regs
                                      // Can be used to determine if LCD_displayData is ready for new data.
    unsigned char blinkLCD       : 1; //Indicates whether the actual LCD-digit should blink or not
                                      // Added to the LCD_driver.h due to the application note AVR064
    
    unsigned char unused : 5;  
  };
};
extern union _LCD_status LCD_status;    

extern unsigned char LCD_displayData[LCD_REGISTER_COUNT];

⌨️ 快捷键说明

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