资源简介
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 < bh.height; 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 < bh.width; 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
- 下一篇:网上商城规划方案
相关资源
- stm32f4 ad波形采集用da接示波器
- STM32 超声波测距例程
- stm32+MLX90614测温代码.rar
- STM32实现GPRS与服务器数据传输 相关源
- 使用Altera的FPGA内核建立PCI/PXI接口
- stm32超声波读取数据串口输出数据
- LDC1000 STM32
- 正点原子STM32F407 BMP180测试程序
- stm32f103的SD卡-SDIO-FATFS
- STM32L152程序模板
- STM32 实现二维码解码
- 数据采集系统设计 用FPGA+程序代码
- stm32控制迪文液晶
- W25Q64Flash芯片STM32操作
- STM32 SHT30温湿度检测
- stm32-sx1278-lora驱动程序
- STM32F103RCT6 12864液晶驱动
- FPGA等精度频率计
- QPSK调制的FPGA实现源程序
- UM0492_STM32F103XX_永磁同步电机_PMSM_FOC软
- stm32f103双串口收发结构体版本.zip
- 基于stm32制作的电子体重秤源码
- 基于FPGA的出租车计价器设计verilog源代
- STM32驱动新西达2212无刷电机程序
- 基于stm32的超声波测距串口输出US100模
- STM32F103RCT6程序例
- 地铁自动售票机(基于FPGA)设计
- 基于FPGA的直流电机PWM控制
- 基于物联网的多功能电子药箱
- 书上有关fpga和pci9054的例程
评论
共有 条评论