aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-17 10:32:17 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-17 10:32:17 +0000
commit9b2011455585885748164ab76dfaae76fffb0ff9 (patch)
tree793afb8d681b07fc84582828735e23e90465d7d7 /Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
parent79e54580ae0ce192f6c66a11880136eac483fc29 (diff)
downloadlufa-9b2011455585885748164ab76dfaae76fffb0ff9.tar.gz
lufa-9b2011455585885748164ab76dfaae76fffb0ff9.tar.bz2
lufa-9b2011455585885748164ab76dfaae76fffb0ff9.zip
Make RNDISHost demo validate the set Packet Filter to ensure that it is being sent correctly.
Add new (incomplete) StandaloneProgrammer project, using the ELM Petite FAT library to read files stored on the board's dataflash by the host.
Diffstat (limited to 'Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c')
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
new file mode 100644
index 000000000..0084fa514
--- /dev/null
+++ b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
@@ -0,0 +1,46 @@
+/*-----------------------------------------------------------------------*/
+/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2009 */
+/*-----------------------------------------------------------------------*/
+
+#include "diskio.h"
+
+#include <string.h>
+#include "../DataflashManager.h"
+
+/*-----------------------------------------------------------------------*/
+/* Initialize Disk Drive */
+/*-----------------------------------------------------------------------*/
+
+DSTATUS disk_initialize (void)
+{
+ DSTATUS stat;
+
+ stat = RES_OK;
+
+ return stat;
+}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Read Partial Sector */
+/*-----------------------------------------------------------------------*/
+
+DRESULT disk_readp (
+ void* dest, /* Pointer to the destination object */
+ DWORD sector, /* Sector number (LBA) */
+ WORD sofs, /* Offset in the sector */
+ WORD count /* Byte count (bit15:destination) */
+)
+{
+ DRESULT res;
+
+ uint8_t BlockTemp[512];
+ DataflashManager_ReadBlocks_RAM(sector, 1, BlockTemp);
+ memcpy(dest, &BlockTemp[sofs], count);
+
+ res = RES_OK;
+
+ return res;
+}
+