lcd_v1.1.h

来自「MSP430f2013 ADC, LCD drivers using 7416」· C头文件 代码 · 共 135 行

H
135
字号
/*=============================================================================
//   File : LCD_V1.1.h                                                       //
//                                                                           //
//   Abstract: This header file containing the required control and disp fun //
//             prototypes and programmers defined macros.                     //     
//   Compiler : IAR Embedded Work Bench                                      //
//                                                                           //
//   Author : Kuberappa.M.Sajjan                                             //
//   E-mail : kuber@unifiest.com                                             //
//                                                                           //
//                                                                           //
=============================================================================*/




/*---------------------------- Preprocessor Directives ----------------------*/

#include "datatypes_v1.1.h"







/*--------------------------- Macros and Constants --------------------------*/

#ifndef    _LCD_H_          // If LCD header file not defined then
#define    _LCD_H_          // Define the LCD header File 

#define   ROW1                  1
#define   ROW2                  2


#define   COL0                  0
#define   COL1                  1
#define   COL2                  2
#define   COL3                  3
#define   COL4                  4
#define   COL5                  5
#define   COL6                  6
#define   COL7                  7
#define   COL8                  8
#define   COL9                  9
#define   COL10                 10
#define   COL11                 11
#define   COL12                 12
#define   COL13                 13
#define   COL14                 14
#define   COL15                 15
#define   COL16                 16
#define   COL17                 17
#define   COL18                 18
#define   COL19                 19



#define LCD_DATA_DIR_L          P2DIR           
#define LCD_DATA_L              P2OUT 
#define LCD_DATA_DIR_H          P3DIR 
#define LCD_DATA_H              P3OUT 
#define LCD_CNTRL_DIR           P4DIR

#define LCD_DATA                P1DIR

#define LED_BIT                 P1OUT_bit.P1OUT_0

#define OUT_BIT                 1

#define LCD_DATA_DIR            P1DIR_bit.P1DIR_6
#define LCD_CLK_DIR             P1DIR_bit.P1DIR_7

/*------------------ Control Signals for LCD --------------------------------*/

#define RS_DIR                  P1DIR_bit.P1DIR_4
#define EN_DIR                  P1DIR_bit.P1DIR_5


/*------------------ Data Signals and Clock Signals -------------------------*/

#define LCD_DATA_BIT            P1OUT_bit.P1OUT_6
#define LCD_CLK_BIT             P1OUT_bit.P1OUT_7


#define RS                     P1OUT_bit.P1OUT_4                                        
#define EN                     P1OUT_bit.P1OUT_5


/*------------------- Commands for LCD Display -----------------------------*/

#define  FUNCTION_SET        0x3F
#define  CLEAR_DISPLAY       0x01
#define  CURSOR_ON           0x0E
#define  ENTRY_MODE          0x06

/*-------------------- The constantd fotr the application -------------------*/

#define  EIGHT               0x08
#define  ONE                 0x01







/*-------------------------- Global Variable Declarations -------------------*/







/*------------------------- Function Prototypes -----------------------------*/

void lcd_initialisation(void);
void lcd_data(UCHAR write_byte, UCHAR cmd);
void lcd_displaydata(UCHAR row,UCHAR col,const UCHAR *str_data);
void lcd_conversion(UCHAR adcdata);
void convert_data(UCHAR convdata);
void lcd_cursor(UCHAR row,UCHAR col);
void lcd_displayfloat(UCHAR row, UCHAR col,FLOAT data);
void port_initialisation(void);
void lcd_display_float_wt(UCHAR row, UCHAR col,FLOAT Float);
void send_float_disp(UINT int_disp, UCHAR char_disp);

#endif





⌨️ 快捷键说明

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