module uart (
	input  clk,

  input  tx_start,
  input  [7:0] tx_data,
  output tx_busy,
  output tx,

  input  rx,
  output rx_ready,
  output [7:0] rx_data
);


/* local parameters */
// make sure this is the same as the
// "Achieved output frequency" in the `icepll` output
localparam clk_freq = 29_625_000; // 29.625 MHz
localparam baud = 115200;


/* instantiate the rx module */
uart_rx #(clk_freq, baud) urx (
	.clk(clk),
	.rx(rx),
	.rx_ready(rx_ready),
	.rx_data(rx_data)
);

/* instantiate the tx module */
uart_tx #(clk_freq, baud) utx (
	.clk(clk),
	.tx_start(tx_start),
	.tx_data(tx_data),
	.tx(tx),
	.tx_busy(tx_busy)
);

endmodule