00001 ------------------------------------------------------------------------------ 00002 -- This file is a part of the LPP VHDL IP LIBRARY 00003 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS 00004 -- 00005 -- This program is free software; you can redistribute it and/or modify 00006 -- it under the terms of the GNU General Public License as published by 00007 -- the Free Software Foundation; either version 2 of the License, or 00008 -- (at your option) any later version. 00009 -- 00010 -- This program is distributed in the hope that it will be useful, 00011 -- but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 -- GNU General Public License for more details. 00014 -- 00015 -- You should have received a copy of the GNU General Public License 00016 -- along with this program; if not, write to the Free Software 00017 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 ------------------------------------------------------------------------------- 00019 -- Author : Alexis Jeandet 00020 -- Mail : alexis.jeandet@lpp.polytechnique.fr 00021 ------------------------------------------------------------------------------- 00022 library IEEE; 00023 use IEEE.STD_LOGIC_1164.ALL; 00024 00025 library lpp; 00026 use lpp.amba_lcd_16x2_ctrlr.all; 00027 use lpp.LCD_16x2_CFG.all; 00028 00029 00030 entity AMBA_LCD_16x2_DRIVER is 00031 Port ( reset : in STD_LOGIC; 00032 clk : in STD_LOGIC; 00033 Bp0 : in STD_LOGIC; 00034 Bp1 : in STD_LOGIC; 00035 Bp2 : in STD_LOGIC; 00036 LCD_data : out STD_LOGIC_VECTOR (7 downto 0); 00037 LCD_RS : out STD_LOGIC; 00038 LCD_RW : out STD_LOGIC; 00039 LCD_E : out STD_LOGIC; 00040 LCD_RET : out STD_LOGIC; 00041 LCD_CS1 : out STD_LOGIC; 00042 LCD_CS2 : out STD_LOGIC; 00043 SF_CE0 : out std_logic 00044 ); 00045 end AMBA_LCD_16x2_DRIVER; 00046 00047 architecture Behavioral of AMBA_LCD_16x2_DRIVER is 00048 00049 signal FramBUFF : STD_LOGIC_VECTOR(16*2*8-1 downto 0); 00050 signal CMD : std_logic_vector(10 downto 0); 00051 signal Exec : std_logic; 00052 signal Ready : std_logic; 00053 signal rst : std_logic; 00054 signal LCD_CTRL : LCD_DRVR_CTRL_BUSS; 00055 00056 begin 00057 00058 LCD_data <= LCD_CTRL.LCD_DATA; 00059 LCD_RS <= LCD_CTRL.LCD_RS; 00060 LCD_RW <= LCD_CTRL.LCD_RW; 00061 LCD_E <= LCD_CTRL.LCD_E; 00062 00063 00064 LCD_RET <= '0'; 00065 LCD_CS1 <= '0'; 00066 LCD_CS2 <= '0'; 00067 00068 SF_CE0 <= '1'; 00069 00070 00071 00072 00073 Driver0 : LCD_16x2_ENGINE 00074 generic map(50000) 00075 Port map(clk,reset,FramBUFF,CMD,Exec,Ready,LCD_CTRL); 00076 00077 FramBUFF(0*8+7 downto 0*8) <= X"41" when Bp0 = '1' else 00078 X"42" when Bp1 = '1' else 00079 X"43" when Bp2 = '1' else 00080 X"44"; 00081 00082 FramBUFF(1*8+7 downto 1*8)<= X"46" when Bp0 = '1' else 00083 X"47" when Bp1 = '1' else 00084 X"48" when Bp2 = '1' else 00085 X"49"; 00086 00087 00088 CMD(9 downto 0) <= Duration_100us & CursorON when Bp0 = '1' else 00089 Duration_100us & CursorOFF; 00090 00091 00092 Exec <= Bp1; 00093 00094 FramBUFF(2*8+7 downto 2*8) <= X"23"; 00095 FramBUFF(3*8+7 downto 3*8) <= X"66"; 00096 FramBUFF(4*8+7 downto 4*8) <= X"67"; 00097 FramBUFF(5*8+7 downto 5*8) <= X"68"; 00098 FramBUFF(17*8+7 downto 17*8) <= X"69"; 00099 --FramBUFF(16*2*8-1 downto 16) <= (others => '0'); 00100 00101 end Behavioral; 00102 00103 00104 00105 00106 00107
© Copyright 2011 LPP-CNRS | Design by Alexis Jeandet