library ieee; use ieee.std_logic_1164.all; package LCD_pkg is -- THE HEAP O' CONSTANTS -- -- These are 8-bit patterns which may or may not be used in interfacing -- to the LCD 8-bit data bus. They are here to improve readability in the -- code, which I suppose is the idea of constants in the first place. Oh, -- and to improve maintainability, but this really only applies to the -- CLOCK_COUNT constant, as the other constants are pretty well set in -- stone, unless if another type of LCD is being used. subtype charcode is std_logic_vector( 7 downto 0 ); -- Clear screen. constant CLR: charcode := "00000001"; -- Display ON, with cursor. constant DON: charcode := "00001111"; -- Set Entry Mode to increment cursor automatically after each character -- is displayed. constant SEM: charcode := "00000110"; -- Home cursor constant HOME: charcode := "00000010"; -- Function set for 8-bit data transfer and 2-line display and display off constant SET: charcode := "00111100"; -- The alphabet - UPPER CASE only. constant A: charcode := "01000001"; constant B: charcode := "01000010"; constant C: charcode := "01000011"; constant D: charcode := "01000100"; constant E: charcode := "01000101"; constant F: charcode := "01000110"; constant G: charcode := "01000111"; constant H: charcode := "01001000"; constant I: charcode := "01001001"; constant J: charcode := "01001010"; constant K: charcode := "01001011"; constant L: charcode := "01001100"; constant M: charcode := "01001101"; constant N: charcode := "01001110"; constant O: charcode := "01001111"; constant P: charcode := "01010000"; constant Q: charcode := "01010001"; constant R: charcode := "01010010"; constant S: charcode := "01010011"; constant T: charcode := "01010100"; constant U: charcode := "01010101"; constant V: charcode := "01010110"; constant W: charcode := "01010111"; constant X: charcode := "01011000"; constant Y: charcode := "01011001"; constant Z: charcode := "01011010"; -- Numbers constant zero: charcode := "00110000"; constant one: charcode := "00110001"; constant two: charcode := "00110010"; constant three: charcode := "00110011"; constant four: charcode := "00110100"; constant five: charcode := "00110101"; constant six: charcode := "00110110"; constant seven: charcode := "00110111"; constant eight: charcode := "00111000"; constant nine: charcode := "00111001"; -- Some potentially useful puctuation. constant SP: charcode := "00100000"; -- Space constant BRL: charcode := "00101000"; -- Left Bracket constant BRR: charcode := "00101001"; -- Right Bracket constant DASH: charcode := "00101101"; -- Dash, as in hypen constant COLON: charcode := "00111010"; -- Colon: : constant APO: charcode := "00100111"; -- Apostrophe constant star: charcode := "00101010"; -- * constant pound: charcode := "00100011"; -- # -- other constants constant lastposition: integer:=16; -- LCD display length constant LEDseg : positive := 7; constant LCDdatasize: positive:= 8; component LCDdriver is generic( big_delay: integer := 2000; small_delay: integer :=100; setup_delay: integer := 50 ); port( clock: in std_logic; reset: in std_logic; message: in std_logic_vector( 7 downto 0 ); enable: in std_logic; -- detect if there is any incoming message lcd_data: out std_logic_vector( 7 downto 0 ); lcd_rs: out std_logic; lcd_rw: out std_logic; lcd_enable: out std_logic; LED1: out std_logic_vector( 6 downto 0 ); LED2: out std_logic_vector( 6 downto 0 ) ); end component LCDdriver; end LCD_pkg;