资源简介
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
- 下一篇:网上商城规划方案
相关资源
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- FPGA彩条显示
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- Xilinx-FPGA-引脚功能详细介绍.doc
- 基于xilinx FPGA的PCIe设计实战
- 基于PCIe的FPGA动态配置设计与实现
- 为什么工程师要掌握FPGA开发知识?
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- 数字频率合成dds正弦波基于FPGA的DDS产
- Verilog FPGA UART串口控制器
- STM32基于rt_thread操作系统的SDHC卡文件
- gmsk调制在FPGA上实现
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- 一个简单的verilog编写的DMA IP CORE,和
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- FPGA在步进电机驱动上的应用实例及代
- [免费]基于stm32f103ze 的OLED驱动代码
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- STM32F103 CC2500完整驱动(模拟SPI)
- AD7606采集程序
评论
共有 条评论