Updated to use latest headers of USBDevice
Dependents: USBMSB_Ramdisk_kl25z 14_USBMSB_Ramdisk
Fork of RAM_DISK by
USBMSD_Ram.cpp@1:0b8a0be40802, 2013-05-15 (annotated)
- Committer:
- ragmondo
- Date:
- Wed May 15 22:38:36 2013 +0000
- Revision:
- 1:0b8a0be40802
- Parent:
- 0:ba333853266b
updated to match latest revision of usbdevice library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 0:ba333853266b | 1 | /* mbed USBMSD_Ram Library, for providing file access to SD cards |
samux | 0:ba333853266b | 2 | * Copyright (c) 2008-2010, sford |
samux | 0:ba333853266b | 3 | * |
samux | 0:ba333853266b | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
samux | 0:ba333853266b | 5 | * of this software and associated documentation files (the "Software"), to deal |
samux | 0:ba333853266b | 6 | * in the Software without restriction, including without limitation the rights |
samux | 0:ba333853266b | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
samux | 0:ba333853266b | 8 | * copies of the Software, and to permit persons to whom the Software is |
samux | 0:ba333853266b | 9 | * furnished to do so, subject to the following conditions: |
samux | 0:ba333853266b | 10 | * |
samux | 0:ba333853266b | 11 | * The above copyright notice and this permission notice shall be included in |
samux | 0:ba333853266b | 12 | * all copies or substantial portions of the Software. |
samux | 0:ba333853266b | 13 | * |
samux | 0:ba333853266b | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
samux | 0:ba333853266b | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
samux | 0:ba333853266b | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
samux | 0:ba333853266b | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
samux | 0:ba333853266b | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
samux | 0:ba333853266b | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
samux | 0:ba333853266b | 20 | * THE SOFTWARE. |
samux | 0:ba333853266b | 21 | */ |
samux | 0:ba333853266b | 22 | |
samux | 0:ba333853266b | 23 | #include "USBMSD_Ram.h" |
samux | 0:ba333853266b | 24 | |
samux | 0:ba333853266b | 25 | //5 sectors |
samux | 0:ba333853266b | 26 | const char disk[512*5] = { |
samux | 0:ba333853266b | 27 | |
samux | 0:ba333853266b | 28 | //sector 0: boot sector |
samux | 0:ba333853266b | 29 | 0xEB,0x3C,0x90,0x4D,0x53,0x44,0x4F,0x53,0x35,0x2E,0x30, 0x00,0x02,/*bytes per sector: 512*/ 0x08, /*sectors per cluster*/ 0x01,0x00,/*number of reserved sector*/ |
samux | 0:ba333853266b | 30 | 0x01, /* number of FATs*/ 0x10,0x00, /*Maximum number of root directory entries: 16*/ 0x20,0x00, /*Total sector count: 32*/ 0xF0, 0x02,0x00,/*sectors per FAT: 2*/ 0x01,0x00,/*Sectors per track*/ 0x01,0x00, /*Number of heads*/ 0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 31 | 0x00,0x01,0x00,0x00,0x00,0x00, 0x29, /*boot signature*/ 0x74,0x19,0x02,0x27, /*volume ID*/ 'M','b','e','d',' ', |
samux | 0:ba333853266b | 32 | 'U','S','B',' ',' ',' ', /*volume label: Mbed USB*/ 0x46,0x41,0x54,0x31,0x32,0x20,0x20,0x20,0x33,0xC9, |
samux | 0:ba333853266b | 33 | 0x8E,0xD1,0xBC,0xF0,0x7B,0x8E,0xD9,0xB8,0x00,0x20,0x8E,0xC0,0xFC,0xBD,0x00,0x7C, |
samux | 0:ba333853266b | 34 | 0x38,0x4E,0x24,0x7D,0x24,0x8B,0xC1,0x99,0xE8,0x3C,0x01,0x72,0x1C,0x83,0xEB,0x3A, |
samux | 0:ba333853266b | 35 | 0x66,0xA1,0x1C,0x7C,0x26,0x66,0x3B,0x07,0x26,0x8A,0x57,0xFC,0x75,0x06,0x80,0xCA, |
samux | 0:ba333853266b | 36 | 0x02,0x88,0x56,0x02,0x80,0xC3,0x10,0x73,0xEB,0x33,0xC9,0x8A,0x46,0x10,0x98,0xF7, |
samux | 0:ba333853266b | 37 | 0x66,0x16,0x03,0x46,0x1C,0x13,0x56,0x1E,0x03,0x46,0x0E,0x13,0xD1,0x8B,0x76,0x11, |
samux | 0:ba333853266b | 38 | 0x60,0x89,0x46,0xFC,0x89,0x56,0xFE,0xB8,0x20,0x00,0xF7,0xE6,0x8B,0x5E,0x0B,0x03, |
samux | 0:ba333853266b | 39 | 0xC3,0x48,0xF7,0xF3,0x01,0x46,0xFC,0x11,0x4E,0xFE,0x61,0xBF,0x00,0x00,0xE8,0xE6, |
samux | 0:ba333853266b | 40 | 0x00,0x72,0x39,0x26,0x38,0x2D,0x74,0x17,0x60,0xB1,0x0B,0xBE,0xA1,0x7D,0xF3,0xA6, |
samux | 0:ba333853266b | 41 | 0x61,0x74,0x32,0x4E,0x74,0x09,0x83,0xC7,0x20,0x3B,0xFB,0x72,0xE6,0xEB,0xDC,0xA0, |
samux | 0:ba333853266b | 42 | 0xFB,0x7D,0xB4,0x7D,0x8B,0xF0,0xAC,0x98,0x40,0x74,0x0C,0x48,0x74,0x13,0xB4,0x0E, |
samux | 0:ba333853266b | 43 | 0xBB,0x07,0x00,0xCD,0x10,0xEB,0xEF,0xA0,0xFD,0x7D,0xEB,0xE6,0xA0,0xFC,0x7D,0xEB, |
samux | 0:ba333853266b | 44 | 0xE1,0xCD,0x16,0xCD,0x19,0x26,0x8B,0x55,0x1A,0x52,0xB0,0x01,0xBB,0x00,0x00,0xE8, |
samux | 0:ba333853266b | 45 | 0x3B,0x00,0x72,0xE8,0x5B,0x8A,0x56,0x24,0xBE,0x0B,0x7C,0x8B,0xFC,0xC7,0x46,0xF0, |
samux | 0:ba333853266b | 46 | 0x3D,0x7D,0xC7,0x46,0xF4,0x29,0x7D,0x8C,0xD9,0x89,0x4E,0xF2,0x89,0x4E,0xF6,0xC6, |
samux | 0:ba333853266b | 47 | 0x06,0x96,0x7D,0xCB,0xEA,0x03,0x00,0x00,0x20,0x0F,0xB6,0xC8,0x66,0x8B,0x46,0xF8, |
samux | 0:ba333853266b | 48 | 0x66,0x03,0x46,0x1C,0x66,0x8B,0xD0,0x66,0xC1,0xEA,0x10,0xEB,0x5E,0x0F,0xB6,0xC8, |
samux | 0:ba333853266b | 49 | 0x4A,0x4A,0x8A,0x46,0x0D,0x32,0xE4,0xF7,0xE2,0x03,0x46,0xFC,0x13,0x56,0xFE,0xEB, |
samux | 0:ba333853266b | 50 | 0x4A,0x52,0x50,0x06,0x53,0x6A,0x01,0x6A,0x10,0x91,0x8B,0x46,0x18,0x96,0x92,0x33, |
samux | 0:ba333853266b | 51 | 0xD2,0xF7,0xF6,0x91,0xF7,0xF6,0x42,0x87,0xCA,0xF7,0x76,0x1A,0x8A,0xF2,0x8A,0xE8, |
samux | 0:ba333853266b | 52 | 0xC0,0xCC,0x02,0x0A,0xCC,0xB8,0x01,0x02,0x80,0x7E,0x02,0x0E,0x75,0x04,0xB4,0x42, |
samux | 0:ba333853266b | 53 | 0x8B,0xF4,0x8A,0x56,0x24,0xCD,0x13,0x61,0x61,0x72,0x0B,0x40,0x75,0x01,0x42,0x03, |
samux | 0:ba333853266b | 54 | 0x5E,0x0B,0x49,0x75,0x06,0xF8,0xC3,0x41,0xBB,0x00,0x00,0x60,0x66,0x6A,0x00,0xEB, |
samux | 0:ba333853266b | 55 | 0xB0,0x4E,0x54,0x4C,0x44,0x52,0x20,0x20,0x20,0x20,0x20,0x20,0x0D,0x0A,0x52,0x65, |
samux | 0:ba333853266b | 56 | 0x6D,0x6F,0x76,0x65,0x20,0x64,0x69,0x73,0x6B,0x73,0x20,0x6F,0x72,0x20,0x6F,0x74, |
samux | 0:ba333853266b | 57 | 0x68,0x65,0x72,0x20,0x6D,0x65,0x64,0x69,0x61,0x2E,0xFF,0x0D,0x0A,0x44,0x69,0x73, |
samux | 0:ba333853266b | 58 | 0x6B,0x20,0x65,0x72,0x72,0x6F,0x72,0xFF,0x0D,0x0A,0x50,0x72,0x65,0x73,0x73,0x20, |
samux | 0:ba333853266b | 59 | 0x61,0x6E,0x79,0x20,0x6B,0x65,0x79,0x20,0x74,0x6F,0x20,0x72,0x65,0x73,0x74,0x61, |
samux | 0:ba333853266b | 60 | 0x72,0x74,0x0D,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xCB,0xD8,0x55,0xAA, |
samux | 0:ba333853266b | 61 | |
samux | 0:ba333853266b | 62 | //sector 1: FAT 1 |
samux | 0:ba333853266b | 63 | 0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 64 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 65 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 66 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 67 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 68 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 69 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 70 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 71 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 72 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 73 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 74 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 75 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 76 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 77 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 79 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 80 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 81 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 82 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 83 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 84 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 85 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 86 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 87 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 88 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 89 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 90 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 91 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 92 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 93 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 94 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 95 | |
samux | 0:ba333853266b | 96 | //sector 2: FAT1: two sectors per FAT |
samux | 0:ba333853266b | 97 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 98 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 99 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 100 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 101 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 102 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 103 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 104 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 105 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 106 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 107 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 108 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 109 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 110 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 111 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 112 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 113 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 114 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 115 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 116 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 117 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 118 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 119 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 120 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 121 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 122 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 123 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 124 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 125 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 126 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 127 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 128 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 129 | |
samux | 0:ba333853266b | 130 | //sector 3: root directory |
samux | 0:ba333853266b | 131 | //entry 1 |
samux | 0:ba333853266b | 132 | 'M','b','e','d',' ','U','S','B',' ',' ',' ', 0x28,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 133 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 134 | //entry 2 |
samux | 0:ba333853266b | 135 | 0x52,0x45,0x41,0x44,0x4D,0x45,0x20,0x20,0x54,0x58,0x54, /*readme.txt*/ 0x20,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 136 | 0x21,0x00,0xBB,0x32,0x00,0x00, 0xDC,0x83,/*hour/min/doublesec*/ 0x6A,0x3F,/*year/month/day*/ 0x02,0x00, /*starting cluster*/ 0x1e,0x00,0x00,0x00, /*size*/ |
samux | 0:ba333853266b | 137 | |
samux | 0:ba333853266b | 138 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 139 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 140 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 141 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 142 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 143 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 144 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 145 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 146 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 147 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 148 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 149 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 150 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 151 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 152 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 153 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 154 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 155 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 156 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 157 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 158 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 159 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 160 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 161 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 162 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 163 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 164 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 165 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 166 | |
samux | 0:ba333853266b | 167 | //sector 4: data |
samux | 0:ba333853266b | 168 | 'H','e','l','l','o',' ','f','r','o','m',' ','M','b','e','d','!', |
samux | 0:ba333853266b | 169 | '\r','\n','U','S','B',' ','M','S','D',' ','d','e','m','o',0x00,0x00, |
samux | 0:ba333853266b | 170 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 171 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 172 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 173 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 174 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 175 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 176 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 177 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 178 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 179 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 180 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 181 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 182 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 183 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 184 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 185 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 186 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 187 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 188 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 189 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 190 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 191 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 192 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 193 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 194 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 195 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 196 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 197 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 198 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 199 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
samux | 0:ba333853266b | 200 | }; |
samux | 0:ba333853266b | 201 | |
samux | 0:ba333853266b | 202 | |
samux | 0:ba333853266b | 203 | |
samux | 0:ba333853266b | 204 | USBMSD_Ram::USBMSD_Ram() { |
samux | 0:ba333853266b | 205 | //no init |
samux | 0:ba333853266b | 206 | _status = 0x01; |
samux | 0:ba333853266b | 207 | memcpy(disk_image, disk, 512*5); |
samux | 0:ba333853266b | 208 | connect(); |
samux | 0:ba333853266b | 209 | } |
samux | 0:ba333853266b | 210 | |
samux | 0:ba333853266b | 211 | int USBMSD_Ram::disk_initialize() { |
samux | 0:ba333853266b | 212 | // OK |
samux | 0:ba333853266b | 213 | _status = 0x00; |
samux | 0:ba333853266b | 214 | return 0; |
samux | 0:ba333853266b | 215 | } |
samux | 0:ba333853266b | 216 | |
ragmondo | 1:0b8a0be40802 | 217 | int USBMSD_Ram::disk_write(const uint8_t * buffer, uint64_t block_number) { |
samux | 0:ba333853266b | 218 | memcpy((void *)&disk_image[block_number*512], buffer, 512); |
samux | 0:ba333853266b | 219 | return 0; |
samux | 0:ba333853266b | 220 | } |
samux | 0:ba333853266b | 221 | |
ragmondo | 1:0b8a0be40802 | 222 | int USBMSD_Ram::disk_read(uint8_t * buffer, uint64_t block_number) { |
samux | 0:ba333853266b | 223 | memcpy(buffer, &disk_image[block_number*512], 512); |
samux | 0:ba333853266b | 224 | return 0; |
samux | 0:ba333853266b | 225 | } |
samux | 0:ba333853266b | 226 | |
samux | 0:ba333853266b | 227 | int USBMSD_Ram::disk_status() { return _status; } |
samux | 0:ba333853266b | 228 | int USBMSD_Ram::disk_sync() { return 0; } |
ragmondo | 1:0b8a0be40802 | 229 | uint64_t USBMSD_Ram::disk_sectors() { return 32; } |
ragmondo | 1:0b8a0be40802 | 230 | uint64_t USBMSD_Ram::disk_size() { return 32*512;} |
samux | 0:ba333853266b | 231 |