玩转FPGA山寨版

看了《玩转FPGA》,写的不错,写写山寨版和大家交流!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

#include "GUI.h"
#include "system.h"
#include "io.h"
#include "alt_types.h"
#include"stdio.h"
#include"unistd.h"
#include"bitmap.h"
#include"graphics.h"
#include"string.h"

int main(void)
{

   GUI_Init();
   int i;
   while(1)
   { 
       GUI_Clear();
       for(i=0;i<lcd_frame/2;i++)  IOWR_32DIRECT(SRAM_BASE,4*i,image[4*i]+(image[4*i+1]<<8)+(image[4*i+2]<<16)+(image[4*i+3]<<24));
       set_color(BRIGHTBLUE);
       frame(0,0,319,239,10);
       GUI_SetTextMode(2);
       GUI_SetColor(GUI_WHITE);
       GUI_DispStringHCenterAt("Hainan",160,20);  
       usleep(5000000);
      
       GUI_SetBkColor(GUI_BLUE);
       GUI_Clear();
       GUI_FillEllipse(160,120,80,60);
       GUI_DispStringHCenterAt("Ellipse",160,20);
       usleep(5000000);
      
       GUI_SetBkColor(GUI_BLACK);
       GUI_Clear();
       GUI_DispStringHCenterAt("XOR MODE",160,20);
       GUI_SetDrawMode(GUI_DRAWMODE_NORMAL);
       GUI_FillCircle(150, 114, 40);
       GUI_SetDrawMode(GUI_DRAWMODE_XOR);
       GUI_FillCircle(170, 134, 40);
       GUI_SetDrawMode(GUI_DRAWMODE_NORMAL);
       GUI_DrawRect(200,180,300,220);
       usleep(1000000);
       GUI_ClearRect(200,180,300,220);
       GUI_DrawRect(0,0,319,239);

       usleep(10000000);
   }
    return 0;

}

posted on 2011-04-25 13:37  Neddy11  阅读(1373)  评论(0编辑  收藏  举报