0% found this document useful (0 votes)
466 views2 pages

LCD.H LPC17xx Library

This document contains definitions for controlling an LCD display. It defines constants for the GPIO and data ports used to interface with the LCD. It also defines bit masks for the data and control pins of the LCD, as well as functions for initializing the LCD, writing strings and characters to it, clearing it, and controlling the backlight. The comments indicate that some of the port and pin definitions can be changed to adapt it to different hardware configurations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
466 views2 pages

LCD.H LPC17xx Library

This document contains definitions for controlling an LCD display. It defines constants for the GPIO and data ports used to interface with the LCD. It also defines bit masks for the data and control pins of the LCD, as well as functions for initializing the LCD, writing strings and characters to it, clearing it, and controlling the backlight. The comments indicate that some of the port and pin definitions can be changed to adapt it to different hardware configurations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#ifndef _LCD_H

#define _LCD_H
#include "lpc17xx.h"
#include "lpc_types.h"
#define LCDGPIO LPC_GPIO2
#define LCDDATA LPC_GPIO0

//Change this to change the gpio IO port


//Change this to change the data IO port

#define MAX_CHAR_IN_ONE_LINE 16
#define LCD_BACK_LIGHT_TIMEOUT 1000
#define LCD_BACKLIGHT (1 << 29)
#define LCD_BACK_LIGHT_DIR LPC_GPIO4->FIODIR
#define LCD_BACK_LIGHT_SET LPC_GPIO4->FIOSET
#define LCD_BACK_LIGHT_CLR LPC_GPIO4->FIOCLR
#define LCD_DATA_DIR
#define LCD_DATA_SET
#define LCD_DATA_CLR

LCDDATA->FIODIR
LCDDATA->FIOSET
LCDDATA->FIOCLR

#define LCD_CTRL_DIR
#define LCD_CTRL_SET
#define LCD_CTRL_CLR

LCDGPIO->FIODIR
LCDGPIO->FIOSET
LCDGPIO->FIOCLR

#define
change
#define
change
#define
change

(1 << 3)

//Change this to

(1 << 4)

//Change this to

(1 << 5)

//Change this to

LCDRS
the RS data pin
LCDRW
the RW data pin
LCDEN
the EN data pin

#define LCD_D4 (1 << 4)


this to change the D4 gpio
#define LCD_D5 (1 << 5)
this to change the D5 gpio
#define LCD_D6 (1 << 6)
this to change the D6 gpio
#define LCD_D7 (1 << 7)
this to change the D7 gpio
#define LCD_DATA_MASK
#define LCD_BUSY_FLAG
//#define LCD_CONTROL_MASK

//Change
pin
//Change
pin
//Change
pin
//Change
pin
(LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)
LCD_D7
0x01C00000

enum ROW_NUMBERS
{
LINE1,
LINE2
};
void init_lcd(void);
void lcd_putstring(unsigned char line, char *string);
void lcd_clear(void);
void lcd_backlight_on(void);
void lcd_backlight_off(void);
int lcd_gotoxy(unsigned int x, unsigned int y);

void lcd_putchar(int c);


void lcd_command_write( unsigned char command );
#endif

You might also like