Skip to content

Commit 7dde677

Browse files
Yossi LevyYossi Levy
authored andcommitted
Some Doxygen fixes in MBRBlockDevice and BlockDevice
1 parent c27dabe commit 7dde677

File tree

2 files changed

+9
-55
lines changed

2 files changed

+9
-55
lines changed

features/storage/blockdevice/BlockDevice.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class BlockDevice {
9191
* @param buffer Buffer to write blocks to
9292
* @param addr Address of block to begin reading from
9393
* @param size Size to read in bytes, must be a multiple of read block size
94-
* @return 0 on success, negative error code on failure
94+
* @return 0 on success or a negative error code on failure
9595
*/
9696
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size) = 0;
9797

@@ -104,7 +104,7 @@ class BlockDevice {
104104
* @param buffer Buffer of data to write to blocks
105105
* @param addr Address of block to begin writing to
106106
* @param size Size to write in bytes, must be a multiple of program block size
107-
* @return 0 on success, negative error code on failure
107+
* @return 0 on success or a negative error code on failure
108108
*/
109109
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size) = 0;
110110

@@ -115,7 +115,7 @@ class BlockDevice {
115115
*
116116
* @param addr Address of block to begin erasing
117117
* @param size Size to erase in bytes, must be a multiple of erase block size
118-
* @return 0 on success, negative error code on failure
118+
* @return 0 on success or a negative error code on failure
119119
*/
120120
virtual int erase(bd_addr_t addr, bd_size_t size)
121121
{
@@ -131,7 +131,7 @@ class BlockDevice {
131131
*
132132
* @param addr Address of block to mark as unused
133133
* @param size Size to mark as unused in bytes, must be a multiple of erase block size
134-
* @return 0 on success, negative error code on failure
134+
* @return 0 on success or a negative error code on failure
135135
*/
136136
virtual int trim(bd_addr_t addr, bd_size_t size)
137137
{

features/storage/blockdevice/MBRBlockDevice.h

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -41,52 +41,6 @@ enum {
4141
/** Block device for managing a Master Boot Record
4242
* https://en.wikipedia.org/wiki/Master_boot_record
4343
*
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-
*
9044
* @note
9145
* The MBR partition table is relatively limited:
9246
* - At most 4 partitions are supported
@@ -98,7 +52,7 @@ class MBRBlockDevice : public BlockDevice {
9852
*
9953
* @param bd Block device to partition
10054
* @param part Partition to use, 1-4
101-
* @param type 8-bit partition type to identitfy partition's contents
55+
* @param type 8-bit partition type to identify partition's contents
10256
* @param start Start block address to map to block 0 of partition,
10357
* negative addresses are calculated from the end of the
10458
* underlying block devices. Block 0 is implicitly ignored
@@ -112,7 +66,7 @@ class MBRBlockDevice : public BlockDevice {
11266
*
11367
* @param bd Block device to partition
11468
* @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's contents
11670
* @param start Start block address to map to block 0 of partition,
11771
* negative addresses are calculated from the end of the
11872
* underlying block devices. Block 0 is implicitly ignored
@@ -158,7 +112,7 @@ class MBRBlockDevice : public BlockDevice {
158112
* @param buffer Buffer to read blocks into
159113
* @param addr Address of block to begin reading from
160114
* @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
162116
*/
163117
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size);
164118

@@ -169,7 +123,7 @@ class MBRBlockDevice : public BlockDevice {
169123
* @param buffer Buffer of data to write to blocks
170124
* @param addr Address of block to begin writing to
171125
* @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
173127
*/
174128
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size);
175129

@@ -180,7 +134,7 @@ class MBRBlockDevice : public BlockDevice {
180134
*
181135
* @param addr Address of block to begin erasing
182136
* @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
184138
*/
185139
virtual int erase(bd_addr_t addr, bd_size_t size);
186140

0 commit comments

Comments
 (0)