1 -------------------------------------------------------------------------
\r
3 -- Filename: textmode_vga_pkg.vhd
\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
12 -------------------------------------------------------------------------
\r
15 use ieee.std_logic_1164.all;
\r
16 use work.textmode_vga_platform_dependent_pkg.all;
\r
21 -- >=33 ---------------
\r
25 -- <513 ---------------
\r
27 -- PixelClock: 25,175 MHz
\r
44 package textmode_vga_pkg is
\r
45 constant COLOR_SIZE : integer := 8;
\r
46 constant CHAR_SIZE : integer := 8;
\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
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
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
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
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
76 type CURSOR_STATE_TYPE is (CURSOR_OFF, CURSOR_ON, CURSOR_BLINK);
\r
77 constant CURSOR_BLINK_INTERVAL_MS : integer := 500;
\r
78 end package textmode_vga_pkg;
\r