module oled_control_if
		(
			input	wire				reset,
			input	wire				clk,
			input	wire				clk_x7,
			
			input	wire	[2:1]		olde_bs,
			input	wire				olde_cs_n,
			input	wire				olde_res_n,
			input	wire				olde_dc_n,
			input	wire				olde_wr_n,
			input	wire				olde_e,
			input	wire	[7:0]		olde_d,
			
			input	wire				pwr_en,
			input	wire	[4:0]		gpo,
			
			output	wire	[4:1]		pmod_p,
			output	wire	[4:1]		pmod_n
		);
	
	// assign PMOD
	wire				out_clk_p;
	wire				out_clk_n;
	wire	[2:0]		out_data_p;
	wire	[2:0]		out_data_n;
	
	assign pmod_p[3] = out_clk_p;
	assign pmod_n[3] = out_clk_n;
	assign pmod_p[4] = out_data_p[0];
	assign pmod_n[4] = out_data_n[0];
	assign pmod_p[2] = out_data_p[1];
	assign pmod_n[2] = out_data_n[1];
	assign pmod_p[1] = out_data_p[2];
	assign pmod_n[1] = out_data_n[2];
	
	
	// assign SERDES
	wire	[3*7-1:0]		serdes_data;
	assign serdes_data[4:0] = gpo;
	assign serdes_data[5]   = pwr_en;
	assign serdes_data[6]   = olde_d[7];
	assign serdes_data[7]   = olde_d[6];
	assign serdes_data[8]   = olde_d[5];
	assign serdes_data[9]   = olde_d[4];
	assign serdes_data[10]  = olde_d[3];
	assign serdes_data[11]  = olde_d[2];
	assign serdes_data[12]  = olde_d[1];
	assign serdes_data[13]  = olde_d[0];
	assign serdes_data[14]  = olde_e;
	assign serdes_data[15]  = olde_wr_n;
	assign serdes_data[16]  = olde_dc_n;
	assign serdes_data[17]  = olde_bs[1];
	assign serdes_data[18]  = olde_bs[2];
	assign serdes_data[19]  = olde_cs_n;
	assign serdes_data[20]  = olde_res_n;
	
	serdes_output_to_fin1216
		i_serdes_output_to_fin1216
			(
				.reset			(reset),
				.clk			(clk),
				.clk_x7			(clk_x7),
				
				.in_data		(~serdes_data),
				
				.out_clk_p		(out_clk_p),
				.out_clk_n		(out_clk_n),
				.out_data_p		(out_data_p),
				.out_data_n		(out_data_n)
			);
endmodule