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 3 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 library grlib; 00025 use grlib.amba.all; 00026 use grlib.stdlib.all; 00027 use grlib.devices.all; 00028 00029 00030 package amba_lcd_16x2_ctrlr is 00031 00032 constant lcd_space_size : integer := 80; 00033 00034 type FRM_Buff_Space is array(lcd_space_size-1 downto 0) of std_logic_vector(7 downto 0); 00035 00036 00037 type LCD_DRVR_CTRL_BUSS is 00038 record 00039 LCD_RW : std_logic; 00040 LCD_RS : std_logic; 00041 LCD_E : std_logic; 00042 LCD_DATA : std_logic_vector(7 downto 0); 00043 end record; 00044 00045 type LCD_DRVR_SYNCH_BUSS is 00046 record 00047 DRVR_READY : std_logic; 00048 LCD_INITIALISED : std_logic; 00049 end record; 00050 00051 00052 type LCD_DRVR_CMD_BUSS is 00053 record 00054 Word : std_logic_vector(7 downto 0); 00055 CMD_Data : std_logic; --CMD = '0' and data = '1' 00056 Exec : std_logic; 00057 Duration : std_logic_vector(1 downto 0); 00058 end record; 00059 type LCD_CFG_Tbl is array(0 to 4) of std_logic_vector(7 downto 0); 00060 00061 00062 00063 component LCD_16x2_DRIVER is 00064 generic( 00065 OSC_Freq_MHz : integer:=60 00066 ); 00067 Port ( reset : in STD_LOGIC; 00068 clk : in STD_LOGIC; 00069 LCD_CTRL : out LCD_DRVR_CTRL_BUSS; 00070 SYNCH : out LCD_DRVR_SYNCH_BUSS; 00071 DRIVER_CMD : in LCD_DRVR_CMD_BUSS 00072 ); 00073 end component; 00074 00075 00076 00077 component amba_lcd_16x2_driver is 00078 Port ( reset : in STD_LOGIC; 00079 clk : in STD_LOGIC; 00080 Bp0 : in STD_LOGIC; 00081 Bp1 : in STD_LOGIC; 00082 Bp2 : in STD_LOGIC; 00083 LCD_data : out STD_LOGIC_VECTOR (7 downto 0); 00084 LCD_RS : out STD_LOGIC; 00085 LCD_RW : out STD_LOGIC; 00086 LCD_E : out STD_LOGIC; 00087 LCD_RET : out STD_LOGIC; 00088 LCD_CS1 : out STD_LOGIC; 00089 LCD_CS2 : out STD_LOGIC; 00090 SF_CE0 : out std_logic 00091 ); 00092 end component; 00093 00094 00095 00096 component FRAME_CLK_GEN is 00097 generic(OSC_freqKHz : integer := 50000); 00098 Port ( clk : in STD_LOGIC; 00099 reset : in STD_LOGIC; 00100 FRAME_CLK : out STD_LOGIC); 00101 end component; 00102 00103 00104 00105 component LCD_2x16_DRIVER is 00106 generic( 00107 OSC_Freq_MHz : integer:=60; 00108 Refresh_RateHz : integer:=5 00109 ); 00110 Port ( clk : in STD_LOGIC; 00111 reset : in STD_LOGIC; 00112 FramBUFF : in STD_LOGIC_VECTOR(16*2*8-1 downto 0); 00113 LCD_data : out STD_LOGIC_VECTOR (7 downto 0); 00114 LCD_RS : out STD_LOGIC; 00115 LCD_RW : out STD_LOGIC; 00116 LCD_E : out STD_LOGIC; 00117 LCD_RET : out STD_LOGIC; 00118 LCD_CS1 : out STD_LOGIC; 00119 LCD_CS2 : out STD_LOGIC; 00120 STATEOUT: out std_logic_vector(3 downto 0); 00121 refreshPulse : out std_logic 00122 ); 00123 end component; 00124 00125 00126 component LCD_CLK_GENERATOR is 00127 generic(OSC_freqKHz : integer := 50000); 00128 Port ( clk : in STD_LOGIC; 00129 reset : in STD_LOGIC; 00130 clk_1us : out STD_LOGIC); 00131 end component; 00132 00133 component LCD_16x2_ENGINE is 00134 generic(OSC_freqKHz : integer := 50000); 00135 Port ( clk : in STD_LOGIC; 00136 reset : in STD_LOGIC; 00137 DATA : in FRM_Buff_Space; 00138 CMD : in std_logic_vector(10 downto 0); 00139 Exec : in std_logic; 00140 Ready : out std_logic; 00141 LCD_CTRL : out LCD_DRVR_CTRL_BUSS 00142 ); 00143 end component; 00144 00145 00146 00147 component apb_lcd_ctrlr is 00148 generic ( 00149 pindex : integer := 0; 00150 paddr : integer := 0; 00151 pmask : integer := 16#fff#; 00152 pirq : integer := 0; 00153 abits : integer := 8); 00154 port ( 00155 rst : in std_ulogic; 00156 clk : in std_ulogic; 00157 apbi : in apb_slv_in_type; 00158 apbo : out apb_slv_out_type; 00159 LCD_data : out STD_LOGIC_VECTOR (7 downto 0); 00160 LCD_RS : out STD_LOGIC; 00161 LCD_RW : out STD_LOGIC; 00162 LCD_E : out STD_LOGIC; 00163 LCD_RET : out STD_LOGIC; 00164 LCD_CS1 : out STD_LOGIC; 00165 LCD_CS2 : out STD_LOGIC; 00166 SF_CE0 : out std_logic 00167 ); 00168 end component; 00169 00170 00171 00172 00173 end;
© Copyright 2011 LPP-CNRS | Design by Alexis Jeandet