/*-----------------------------------------------------------------------------
//     $Date: 2004/11/19 20:19:52 $
//     $RCSfile: my_plat_flash.c,v $
//-----------------------------------------------------------------------------
//
//     XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
//     SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR
//     XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION
//     AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION
//     OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS
//     IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
//     AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
//     FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY
//     WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
//     IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
//     REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
//     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//     FOR A PARTICULAR PURPOSE.
//     
//     (c) Copyright 2004 Xilinx, Inc.
//     All rights reserved.
//
//---------------------------------------------------------------------------*/
#include "xio.h"
#include "xbasic_types.h"
#include "xstatus.h"
#include "xtft.h"
#include "xtft_l.h"
#include "xparameters.h"
#include "bootload_graphics.h"
#include "xromlcd.h"

#define UART_BASEADDR   XPAR_OPB_UART16550_0_BASEADDR
#define UART_CLOCK      XPAR_XUARTNS550_CLOCK_HZ
#define UART_BAUDRATE   9600

#define TFT_DEVICE_ID   XPAR_PLB_TFT_CNTLR_REF_0_DEVICE_ID

#define STATUS_CHECK(Status) { if (Status != XST_SUCCESS) { return Status; } }

#include <stdio.h>
#include "xuartns550_l.h"

int main()
  {
  XTft Tft;
  XStatus Status;

  XUartNs550_SetBaud(UART_BASEADDR, UART_CLOCK, UART_BAUDRATE);
  XUartNs550_mSetLineControlReg(UART_BASEADDR, XUN_LCR_8_DATA_BITS);

  /* Initialize TFT */
  Status = XTft_Initialize(&Tft, TFT_DEVICE_ID);
  STATUS_CHECK(Status);
  
  /* Initialize TFT and display */
  XTft_SetColor(&Tft, 0x00ffffff, 0x00404040);
  XTft_ClearScreen(&Tft);
  XTft_SetPos(&Tft, 5, 0);
  XTft_WriteColorString(&Tft, "*** Put Your Own Platform Flash Design Here! ***", 0x0000FF80, 0x00404040);
  xil_printf ("*** Put Your Own Platform Flash Design Here! ***\r\n\r\n");

  XromLCDOn();
  XromLCDInit();
  XromLCDPrintString ("Put Your Own","Design Here!");

  while (1) {}
  return 0;
  }
