LCD code for SX (lcd.h)

SX sample code that works with LCD displays based on the Hitachi 44780 series of controllers.




#ifndef lcd_h

#define lcd_h





//for lcd port in nibble mode with static waits -> uses 6 pins total

//D7-D4, RS and E

char LCD_DATA_PORT@0x09;

char LCD_CONTROL_PORT@0x08;

const char LCD_DATA_PORT_MASK = 11110000b;

const char LCD_CONTROL_PORT_MASK = 00000110b;

const char LCD_RS_MASK = 00000100b;

const char LCD_E_MASK = 00000010b;



void lcd_cmd(char cmd);

void lcd_print_char(char cmd);

void lcd_init(void);

void lcd_clear(void);

//void lcd_prints(char string);



#endif




Copyright© 2003 Pavel Baranov.