@@ -41,52 +41,6 @@ enum {
41
41
/* * Block device for managing a Master Boot Record
42
42
* https://en.wikipedia.org/wiki/Master_boot_record
43
43
*
44
- * Here is an example of partitioning a heap backed block device
45
- * @code
46
- * #include "mbed.h"
47
- * #include "HeapBlockDevice.h"
48
- * #include "MBRBlockDevice.h"
49
- *
50
- * // Create a block device with 64 blocks of size 512
51
- * HeapBlockDevice mem(64*512, 512);
52
- *
53
- * // Partition into two partitions with ~half the blocks
54
- * MBRBlockDevice::partition(&mem, 1, 0x83, 0*512, 32*512);
55
- * MBRBlockDevice::partition(&mem, 2, 0x83, 32*512);
56
- *
57
- * // Create a block device that maps to the first 32 blocks (excluding MBR block)
58
- * MBRBlockDevice part1(&mem, 1);
59
- *
60
- * // Create a block device that maps to the last 32 blocks
61
- * MBRBlockDevice part2(&mem, 2);
62
- * @endcode
63
- *
64
- * Here is a more realistic example where the MBRBlockDevice is used
65
- * to partition a region of space on an SD card. When plugged into a computer,
66
- * the partitions will be recognized appropriately.
67
- * @code
68
- * #include "mbed.h"
69
- * #include "SDBlockDevice.h"
70
- * #include "MBRBlockDevice.h"
71
- * #include "FATFileSystem.h"
72
- *
73
- * // Create an SD card
74
- * SDBlockDevice sd(s0, s1, s2, s3);
75
- *
76
- * // Create a partition with 1 GB of space
77
- * MBRBlockDevice::partition(&sd, 1, 0x83, 0, 1024*1024);
78
- *
79
- * // Create the block device that represents the partition
80
- * MBRBlockDevice part1(&sd, 1);
81
- *
82
- * // Format the partition with a FAT filesystem
83
- * FATFileSystem::format(&part1);
84
- *
85
- * // Create the FAT filesystem instance, files can now be written to
86
- * // the FAT filesystem in partition 1
87
- * FATFileSystem fat("fat", &part1);
88
- * @endcode
89
- *
90
44
* @note
91
45
* The MBR partition table is relatively limited:
92
46
* - At most 4 partitions are supported
@@ -98,12 +52,12 @@ class MBRBlockDevice : public BlockDevice {
98
52
*
99
53
* @param bd Block device to partition
100
54
* @param part Partition to use, 1-4
101
- * @param type 8-bit partition type to identitfy partition's contents
102
- * @param start Start block address to map to block 0 of partition,
103
- * negative addresses are calculated from the end of the
55
+ * @param type 8-bit partition type to identify partition contents
56
+ * @param start Start block address to map to block 0 of partition.
57
+ * Negative addresses are calculated from the end of the
104
58
* underlying block devices. Block 0 is implicitly ignored
105
59
* from the range to store the MBR.
106
- * @return 0 on success or a negative error code on failure
60
+ * @return 0 on success or a negative error code on failure.
107
61
* @note This is the same as partition(bd, part, type, start, bd->size())
108
62
*/
109
63
static int partition (BlockDevice *bd, int part, uint8_t type, bd_addr_t start);
@@ -112,15 +66,15 @@ class MBRBlockDevice : public BlockDevice {
112
66
*
113
67
* @param bd Block device to partition
114
68
* @param part Partition to use, 1-4
115
- * @param type 8-bit partition type to identitfy partition's contents
69
+ * @param type 8-bit partition type to identify partition contents
116
70
* @param start Start block address to map to block 0 of partition,
117
71
* negative addresses are calculated from the end of the
118
72
* underlying block devices. Block 0 is implicitly ignored
119
73
* from the range to store the MBR.
120
- * @param stop End block address to mark the end of the partition,
121
- * this block is not mapped, negative addresses are calculated
74
+ * @param stop End block address to mark the end of the partition.
75
+ * This block is not mapped: negative addresses are calculated
122
76
* from the end of the underlying block device.
123
- * @return 0 on success or a negative error code on failure
77
+ * @return 0 on success or a negative error code on failure.
124
78
*/
125
79
static int partition (BlockDevice *bd, int part, uint8_t type, bd_addr_t start, bd_addr_t stop);
126
80
@@ -158,7 +112,7 @@ class MBRBlockDevice : public BlockDevice {
158
112
* @param buffer Buffer to read blocks into
159
113
* @param addr Address of block to begin reading from
160
114
* @param size Size to read in bytes, must be a multiple of read block size
161
- * @return 0 on success, negative error code on failure
115
+ * @return 0 on success or a negative error code on failure
162
116
*/
163
117
virtual int read (void *buffer, bd_addr_t addr, bd_size_t size);
164
118
@@ -169,7 +123,7 @@ class MBRBlockDevice : public BlockDevice {
169
123
* @param buffer Buffer of data to write to blocks
170
124
* @param addr Address of block to begin writing to
171
125
* @param size Size to write in bytes, must be a multiple of program block size
172
- * @return 0 on success, negative error code on failure
126
+ * @return 0 on success or a negative error code on failure
173
127
*/
174
128
virtual int program (const void *buffer, bd_addr_t addr, bd_size_t size);
175
129
@@ -180,7 +134,7 @@ class MBRBlockDevice : public BlockDevice {
180
134
*
181
135
* @param addr Address of block to begin erasing
182
136
* @param size Size to erase in bytes, must be a multiple of erase block size
183
- * @return 0 on success, negative error code on failure
137
+ * @return 0 on success or a negative error code on failure
184
138
*/
185
139
virtual int erase (bd_addr_t addr, bd_size_t size);
186
140
0 commit comments