資源簡介
3位地址線,16位數據線,RD WR CS控制信號片選信號,控制fsmc與fpga通信。

代碼片段和文件信息
/*
?*?File :?bmp.c
?*?Description :?This?file?is?...
?*?Author :?XiaomaGee@Gmail.com
?*?Copyright :
?*
?*?History
?****--------------------
?*?Rev :?0.00
?*?Date :?08/12/2012
?*
?*?create.
?****--------------------
?*/
//-----------------?Include?files?------------------------//
#include?
#include?
#include?“..\include\bmp.h“
#include?“..\fatfs\ff.h“
#include?“..\include\tft.h“
#include?“..\include\color.h“
//-----------------?Define?-------------------------------//
//-----------------?Function?Prototype?-------------------//
static?int?get_header_info(char?*?file?BMP_HEADER_T?*);
static?int?show(char?*?file?int?x?int?y);
static?int?capture(void);
//-----------------?Variable?-----------------------------//
BMP_T?bmp?=?{
.header?=?get_header_info
.show?=?show
.capture?=?capture
};
static?FIL?f;
//-----------------?Function?-----------------------------//
/*
?*?Name :?get_header_info
?*?Description :?---
?*?Author :?XiaomaGee.
?*
?*?History
?*?-----------------------
?*?Rev :?0.00
?*?Date ????????:?00/00/2012
?*
?*?create.
?*?----------------------
?*/
static?int
get_header_info(char?*?file?BMP_HEADER_T?*h)
{
FRESULT?res;
char?*p?=?(char*)h;
unsigned?int?counter;
res?=?f_open(&f?file?FA_READ);
if?(res?!=?FR_OK)?return?-1;
res?=?f_read(&f?p?sizeof(BMP_HEADER_T)?&counter);
if?(res?!=?FR_OK)?return?-1;
f_close(&f);
if?(h->type[0]?!=?‘B‘?||?h->type[1]?!=?‘M‘)?return?-1;
return?0;
}
/*?Name :?show
?*?Description :?---
?*?Author :?XiaomaGee.
?*
?*?History
?*?-----------------------
?*?Rev :?0.00
?*?Date ????????:?00/00/2012
?*
?*?create.
?*?----------------------
?*/
static?int
show(char?*?file?int?x?int?y)
{
int?i?j;
int?line_byte;
unsigned?int?counter;
char?buffer[LINE_PIXEL?*?3];
unsigned?short?int?*p;
unsigned?short?int?a?b;
unsigned?char?color_table[1024];
unsigned?char?c;
BMP_HEADER_T?bh;
if?(get_header_info(file?&bh)?!=?0)?return?-1;
f_open(&f?file?FA_READ);
switch?(bh.bit_count)?{
case?1:
f_lseek(&f?0x36);
f_read(&f?color_table?2?*?4?&counter);
line_byte?=?ceil(bh.width?/?8);
if?(line_byte?%?4)?line_byte?=?((line_byte?/?4)?+?1)?*?4;
f_lseek(&f?bh.offset);
for?(i?=?0;?i? f_read(&f?buffer?line_byte?&counter);
lcd_csrx(x);????????????????????????//set?x?csr
lcd_csry(y?+?bh.height?-?i?-?1);????//set?y?csr
lcd_ctl.b.csrmode?=?CSRMODE_H;??????//set?csr?increase?direction
lcd_ctl(lcd_ctl.w);
tft.write_command(0x0022);??????????//write?data
for?(j?=?0;?j? if?(buffer[j?/?8]?&?1?<(7?-?j?%?8))?tft.write_data(make_rgb565(color_table[6]?color_table[5]?color_table[4]));
else?tft.write_data(make_rgb565(color_table[2]?color_table[1]?color_table[0]));
}
}
break;
case?4:
f_lseek(&f?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-10-31?17:48??pub_iCore_fsmc_fpga\
?????目錄???????????0??2012-10-31?17:48??pub_iCore_fsmc_fpga\FPGA\
?????目錄???????????0??2012-10-31?15:48??pub_iCore_fsmc_fpga\FPGA\.qsys_edit\
?????文件??????????69??2012-05-01?23:49??pub_iCore_fsmc_fpga\FPGA\.qsys_edit\filters.xm
?????文件?????????619??2012-05-02?00:48??pub_iCore_fsmc_fpga\FPGA\.qsys_edit\preferences.xm
?????目錄???????????0??2012-10-31?15:48??pub_iCore_fsmc_fpga\FPGA\.sopc_builder\
?????文件??????????66??2012-06-29?22:14??pub_iCore_fsmc_fpga\FPGA\.sopc_builder\filters.xm
?????文件?????????498??2012-06-29?22:14??pub_iCore_fsmc_fpga\FPGA\.sopc_builder\preferences.xm
?????文件????????1836??2012-05-06?02:42??pub_iCore_fsmc_fpga\FPGA\csta.bsf
?????文件????????3528??2012-05-06?02:42??pub_iCore_fsmc_fpga\FPGA\csta.vhd
?????文件????????1836??2012-05-06?02:44??pub_iCore_fsmc_fpga\FPGA\cstb.bsf
?????文件????????3534??2012-05-06?02:44??pub_iCore_fsmc_fpga\FPGA\cstb.vhd
?????文件????????2072??2012-05-01?20:10??pub_iCore_fsmc_fpga\FPGA\CT24.bsf
?????文件?????????915??2012-05-01?20:10??pub_iCore_fsmc_fpga\FPGA\CT24.cmp
?????文件?????????357??2012-05-01?20:10??pub_iCore_fsmc_fpga\FPGA\CT24.qip
?????文件????????4221??2012-05-01?20:10??pub_iCore_fsmc_fpga\FPGA\CT24.vhd
?????目錄???????????0??2012-10-31?17:47??pub_iCore_fsmc_fpga\FPGA\db\
?????文件????????3563??2012-05-06?01:55??pub_iCore_fsmc_fpga\FPGA\DECODER_3_8.bsf
?????文件????????1132??2012-05-06?01:55??pub_iCore_fsmc_fpga\FPGA\DECODER_3_8.cmp
?????文件?????????377??2012-05-06?01:56??pub_iCore_fsmc_fpga\FPGA\DECODER_3_8.qip
?????文件????????5953??2012-05-06?01:55??pub_iCore_fsmc_fpga\FPGA\DECODER_3_8.vhd
?????文件????????4962??2012-05-27?04:12??pub_iCore_fsmc_fpga\FPGA\EP4CE6E144_2.tcl
?????文件????????5867??2012-05-02?00:14??pub_iCore_fsmc_fpga\FPGA\EP4CE6E144_2.tcl.bak
?????文件????????5863??2012-05-01?20:11??pub_iCore_fsmc_fpga\FPGA\EP4CE6E144_2.tcl~
?????文件????????1779??2012-05-06?02:01??pub_iCore_fsmc_fpga\FPGA\fd16.bsf
?????文件?????????120??2012-05-06?02:01??pub_iCore_fsmc_fpga\FPGA\fd16.v
?????目錄???????????0??2012-10-31?15:48??pub_iCore_fsmc_fpga\FPGA\flash\
?????文件???????22336??2012-05-27?05:16??pub_iCore_fsmc_fpga\FPGA\flash\iCore_niosII_epcs_flash_controller_0.flash
?????文件???????22336??2012-05-15?16:19??pub_iCore_fsmc_fpga\FPGA\flash\icore_nsoft_epcs_flash_controller_0.flash
?????文件????????5538??2012-10-31?16:56??pub_iCore_fsmc_fpga\FPGA\fsmc.bsf
?????文件????????2217??2012-10-31?17:09??pub_iCore_fsmc_fpga\FPGA\fsmc.v
............此處省略252個文件信息
- 上一篇:RMUSetup.exe
- 下一篇:網上商城規劃方案
評論
共有 條評論