|
这个工程主要是简单的显示SD卡的文件目录。4 M$ j d; X5 y This project implements a simple file explorer that displays the directory structure on the SD card.The included CircleOs binary include a SDIO driver and a Fat12/16/32 implementation based on DosFS. This a demo project to show usage of the SD card. This project is aimed to be a demo project about how to use the CircleOS filesystem. It can display PRM (converted BMP, JPG, etc) images with a sample viewer. Included in this project an application to convert BMP, JPG, etc files to PRM with the functionality to scale the image to a desired resolution.6 S L4 }3 v5 ^: r" l8 q Current layout of PRM image file: 8byte header:" W! s6 N3 R& r& d F/ t; K - byte 0: height& y& w, Q2 ?! Z, K0 p; z - byte 1: width - 6 bytes for future use7 F# `' }8 k7 O6 j7 g* e& l - pixel data (2 bytes per pixel) FS interface functions:% R" Y- J# G* M3 u& t% I& s u32 FS_Mount(enum STORAGE_device device);4 i5 V2 @5 c G1 S' p u32 FS_Unmount(enum STORAGE_device device);6 `" u ^: K$ q u32 FS_OpenFile(PVOLINFO volinfo, u8 *path, u8 mode, PFILEINFO fileinfo); u32 FS_ReadFile(PFILEINFO fileinfo, u8 *buffer, u32 *successcount, u32 len);! J- T! L* P: b9 G% ]/ p6 U u32 FS_WriteFile(PFILEINFO fileinfo, u8 *buffer, u32 *successcount, u32 len);/ K( G2 C# Z! v% n0 j u32 FS_Close(PFILEINFO fileinfo);6 U) X+ R1 o# d' Z4 M5 ~" Y void FS_Seek(PFILEINFO fileinfo, u32 offset); u32 FS_Delete(PVOLINFO volinfo, u8 *path);% w8 C# \4 g8 Z; T2 i u32 FS_GetNextEntry(PVOLINFO volinfo, PDIRINFO dirinfo, PDIRENT dirent); u32 FS_OpenDirectory(PVOLINFO volinfo,u8 *dirname, PDIRINFO dirinfo);7 [, k/ U' J; P8 ~& z6 P u32 FS_GetVolumeInfo(u8 unit, u32 startsector, PVOLINFO volinfo); - N7 v1 s9 P, O$ c This is a snapshot of my current work in progress with partially integrated jpg decompressor) O6 b9 @. Y" ~ 9 E- p6 D$ {* s9 C( r% z3 S |
微信公众号
手机版