Make RNDISHost demo validate the set Packet Filter to ensure that it is being sent...
[pub/lufa.git] / Projects / Incomplete / StandaloneProgrammer / Lib / PetiteFATFs / diskio.c
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
new file mode 100644 (file)
index 0000000..0084fa5
--- /dev/null
@@ -0,0 +1,46 @@
+/*-----------------------------------------------------------------------*/\r
+/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2009      */\r
+/*-----------------------------------------------------------------------*/\r
+\r
+#include "diskio.h"\r
+\r
+#include <string.h>\r
+#include "../DataflashManager.h"\r
+\r
+/*-----------------------------------------------------------------------*/\r
+/* Initialize Disk Drive                                                 */\r
+/*-----------------------------------------------------------------------*/\r
+\r
+DSTATUS disk_initialize (void)\r
+{\r
+       DSTATUS stat;\r
+\r
+       stat = RES_OK;\r
+\r
+       return stat;\r
+}\r
+\r
+\r
+\r
+/*-----------------------------------------------------------------------*/\r
+/* Read Partial Sector                                                   */\r
+/*-----------------------------------------------------------------------*/\r
+\r
+DRESULT disk_readp (\r
+       void* dest,                     /* Pointer to the destination object */\r
+       DWORD sector,           /* Sector number (LBA) */\r
+       WORD sofs,                      /* Offset in the sector */\r
+       WORD count                      /* Byte count (bit15:destination) */\r
+)\r
+{\r
+       DRESULT res;\r
+\r
+       uint8_t BlockTemp[512];\r
+       DataflashManager_ReadBlocks_RAM(sector, 1, BlockTemp);\r
+       memcpy(dest, &BlockTemp[sofs], count);\r
+\r
+       res = RES_OK;\r
+\r
+       return res;\r
+}\r
+\r