summaryrefslogtreecommitdiffstats
path: root/fpga/hp_lcd_driver/tmds_encode.vhdl
blob: fe69a56e9fce7102a6eaf803c030ec9f48b210fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.all;


entity tmds_encode is
    port (
        sys_rst_n : in std_logic;
        pclk      : in std_logic;

        r_in  : in std_logic_vector(7 downto 0);
        g_in  : in std_logic_vector(7 downto 0);
        b_in  : in std_logic_vector(7 downto 0);
        hsync : in std_logic;
        vsync : in std_logic;
        blank : in std_logic;


        r_p10 : out std_logic_vector(9 downto 0);
        g_p10 : out std_logic_vector(9 downto 0);
        b_p10 : out std_logic_vector(9 downto 0);
        c_p10 : out std_logic_vector(9 downto 0)

        );
end tmds_encode;


architecture beh of tmds_encode is
    signal ctrl : std_logic_vector(1 downto 0);

begin

    c_p10 <= "1111100000";

    ctrl <= vsync & hsync;


    enc_r : entity work.tmds_encoder
        port map (
            sys_rst_n => sys_rst_n,
            clk       => pclk,
            ctrl      => ctrl,
            blank     => blank,
            din       => r_in,
            dout      => r_p10
            );

    enc_g : entity work.tmds_encoder
        port map (
            sys_rst_n => sys_rst_n,
            clk       => pclk,
            ctrl      => "11",
            blank     => blank,
            din       => g_in,
            dout      => g_p10
            );



    enc_b : entity work.tmds_encoder
        port map (
            sys_rst_n => sys_rst_n,
            clk       => pclk,
            ctrl      => "11",
            blank     => blank,
            din       => b_in,
            dout      => b_p10
            );


end beh;