Čeština / English
Login

SVN Repository / Prohlížení

Aktuální adresář: FITkit / trunk / fpga / ctrls / lcd /

lcd_raw.vhd

   1  -- lcd_raw.vhd : Simple LCD wrapper
   2  -- Copyright (C) 2009 Brno University of Technology,
   3  --                    Faculty of Information Technology
   4  -- Author(s): Zdenek Vasicek <xvasic11 AT stud.fit.vutbr.cz>
   5  --
   6  -- LICENSE TERMS
   7  --
   8  -- Redistribution and use in source and binary forms, with or without
   9  -- modification, are permitted provided that the following conditions
  10  -- are met:
  11  -- 1. Redistributions of source code must retain the above copyright
  12  --    notice, this list of conditions and the following disclaimer.
  13  -- 2. Redistributions in binary form must reproduce the above copyright
  14  --    notice, this list of conditions and the following disclaimer in
  15  --    the documentation and/or other materials provided with the
  16  --    distribution.
  17  -- 3. All advertising materials mentioning features or use of this software
  18  --    or firmware must display the following acknowledgement:
  19  --
  20  --      This product includes software developed by the University of
  21  --      Technology, Faculty of Information Technology, Brno and its
  22  --      contributors.
  23  --
  24  -- 4. Neither the name of the Company nor the names of its contributors
  25  --    may be used to endorse or promote products derived from this
  26  --    software without specific prior written permission.
  27  --
  28  -- This software or firmware is provided ``as is'', and any express or implied
  29  -- warranties, including, but not limited to, the implied warranties of
  30  -- merchantability and fitness for a particular purpose are disclaimed.
  31  -- In no event shall the company or contributors be liable for any
  32  -- direct, indirect, incidental, special, exemplary, or consequential
  33  -- damages (including, but not limited to, procurement of substitute
  34  -- goods or services; loss of use, data, or profits; or business
  35  -- interruption) however caused and on any theory of liability, whether
  36  -- in contract, strict liability, or tort (including negligence or
  37  -- otherwise) arising in any way out of the use of this software, even
  38  -- if advised of the possibility of such damage.
  39  --
  40  -- $Id$
  41  --
  42  --
  43  
  44  library IEEE;
  45  use IEEE.STD_LOGIC_1164.all;
  46  use IEEE.STD_LOGIC_ARITH.all;
  47  use IEEE.STD_LOGIC_UNSIGNED.all;
  48  
  49  entity lcd_raw_controller is
  50     port (
  51        RST      : in std_logic;
  52        CLK      : in std_logic;
  53  
  54        -- interni rozhrani
  55        DATA_IN  : in std_logic_vector(15 downto 0);
  56        WRITE_EN : in std_logic;
  57  
  58        --- rozhrani LCD displeje
  59        DISPLAY_RS   : out   std_logic;
  60        DISPLAY_DATA : inout std_logic_vector(7 downto 0);
  61        DISPLAY_RW   : out   std_logic;
  62        DISPLAY_EN   : out   std_logic
  63    );
  64  end entity;
  65  
  66  architecture base of lcd_raw_controller is
  67     signal data_reg : std_logic_vector(9 downto 0);
  68  begin
  69     DISPLAY_RW <= '0';
  70     DISPLAY_EN <= data_reg(9);
  71     DISPLAY_RS <= data_reg(8);
  72     DISPLAY_DATA <= data_reg(7 downto 0);
  73  
  74     -- data register
  75     process(CLK, RST)
  76     begin
  77        if (RST = '1') then
  78           data_reg <= (others => '0');
  79        elsif (CLK='1') and (CLK'event) then
  80           if (WRITE_EN='1') then
  81              data_reg <= DATA_IN(9 downto 0);
  82           end if;
  83        end if;
  84     end process;
  85  end architecture;
  86  
  87  
Zobrazeno: 679484x Naposledy: 25.6.2022 22:32:17