uart_rx: ein prozessmodell. spart weitere 3 logic elements :P
[hwmod.git] / src / textmode_vga / textmode_vga_pkg.vhd
1 -------------------------------------------------------------------------\r
2 --\r
3 -- Filename: textmode_vga_pkg.vhd\r
4 -- =========\r
5 --\r
6 -- Short Description:\r
7 -- ==================\r
8 --   Global declaration needed by the VGA interface.\r
9 --   This package contains the declaration of the VGA timing values,\r
10 --   the VGA dimensions and the supported commands.\r
11 --\r
12 -------------------------------------------------------------------------\r
13 \r
14 library ieee;\r
15 use ieee.std_logic_1164.all;\r
16 use work.textmode_vga_platform_dependent_pkg.all;\r
17 --\r
18 -- 640x480x60Hz\r
19 --\r
20 --     >=144           <784\r
21 --   >=33 ---------------\r
22 --        |             |\r
23 --        |             |\r
24 --        |             |\r
25 --   <513 ---------------\r
26 --\r
27 -- PixelClock: 25,175 MHz\r
28 --\r
29 -- HSync   96\r
30 -- BackP   48\r
31 -- Data   640\r
32 -- FrontP  16\r
33 --        ---\r
34 --        800\r
35 --\r
36 -- Vsync    2\r
37 -- BackP   31\r
38 -- Data   480\r
39 -- FrontP  11\r
40 --        ---\r
41 --        524\r
42 --\r
43 \r
44 package textmode_vga_pkg is\r
45   constant COLOR_SIZE : integer := 8;\r
46   constant CHAR_SIZE : integer := 8;\r
47 \r
48   constant COLOR_BLACK : std_logic_vector(3 * COLOR_SIZE - 1 downto 0) := (others => '0');\r
49   constant COLOR_WHITE : std_logic_vector(3 * COLOR_SIZE - 1 downto 0) := (others => '1');\r
50 \r
51   constant PIXEL_WIDTH : integer := 640;\r
52   constant PIXEL_HEIGHT : integer := 480;\r
53   constant HSYNC_CYCLES : integer := 96;\r
54   constant HBACK_CYCLES : integer := 48;\r
55   constant HFRONT_CYCLES : integer := 16;\r
56   constant VSYNC_LINES : integer := 2;\r
57   constant VBACK_LINES : integer := 31;\r
58   constant VFRONT_LINES : integer := 11;\r
59 \r
60   subtype COLOR_RANGE is natural range COLOR_SIZE + CHAR_SIZE - 1 downto CHAR_SIZE;\r
61   subtype VGA_MEMORY_RANGE is natural range COLOR_SIZE + CHAR_SIZE - 1 downto 0;\r
62   \r
63   constant COMMAND_SIZE : integer := 8;\r
64   constant COMMAND_NOP : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"00";\r
65   constant COMMAND_SET_CHAR : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"01";\r
66   constant COMMAND_SET_BACKGROUND : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"02";\r
67   constant COMMAND_SET_CURSOR_STATE : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"03";\r
68   constant COMMAND_SET_CURSOR_COLOR : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"04";\r
69   constant COMMAND_SET_CURSOR_COLUMN : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"05";\r
70   constant COMMAND_SET_CURSOR_LINE : std_logic_vector(COMMAND_SIZE - 1 downto 0) := x"06";\r
71   \r
72   constant CHAR_NEW_LINE : std_logic_vector(CHAR_SIZE - 1 downto 0) := x"0A";\r
73   constant CHAR_CARRIAGE_RETURN : std_logic_vector(CHAR_SIZE - 1 downto 0) := x"0D";\r
74   constant CHAR_NULL : std_logic_vector(CHAR_SIZE - 1 downto 0) := x"00";\r
75   \r
76   type CURSOR_STATE_TYPE is (CURSOR_BLINK, CURSOR_OFF, CURSOR_ON);\r
77   constant CURSOR_BLINK_INTERVAL_MS : integer := 500;\r
78 end package textmode_vga_pkg;\r