32
32
namespace mbed {
33
33
34
34
/* * Block device for mapping to a slice of another block device
35
- *
36
- * @code
37
- * #include "mbed.h"
38
- * #include "HeapBlockDevice.h"
39
- * #include "SlicingBlockDevice.h"
40
- *
41
- * // Create a block device with 64 blocks of size 512
42
- * HeapBlockDevice mem(64*512, 512);
43
- *
44
- * // Create a block device that maps to the first 32 blocks
45
- * SlicingBlockDevice slice1(&mem, 0*512, 32*512);
46
- *
47
- * // Create a block device that maps to the last 32 blocks
48
- * SlicingBlockDevice slice2(&mem, 32*512);
49
- *
50
- * // Create a block device that maps to the middle 32 blocks
51
- * SlicingBlockDevice slice3(&mem, 16*512, -16*512);
52
- * @endcode
53
35
*/
54
36
class SlicingBlockDevice : public BlockDevice {
55
37
public:
@@ -92,7 +74,7 @@ class SlicingBlockDevice : public BlockDevice {
92
74
* @param buffer Buffer to read blocks into
93
75
* @param addr Address of block to begin reading from
94
76
* @param size Size to read in bytes, must be a multiple of read block size
95
- * @return 0 on success, negative error code on failure
77
+ * @return 0 on success or a negative error code on failure
96
78
*/
97
79
virtual int read (void *buffer, bd_addr_t addr, bd_size_t size);
98
80
@@ -103,7 +85,7 @@ class SlicingBlockDevice : public BlockDevice {
103
85
* @param buffer Buffer of data to write to blocks
104
86
* @param addr Address of block to begin writing to
105
87
* @param size Size to write in bytes, must be a multiple of program block size
106
- * @return 0 on success, negative error code on failure
88
+ * @return 0 on success or a negative error code on failure
107
89
*/
108
90
virtual int program (const void *buffer, bd_addr_t addr, bd_size_t size);
109
91
@@ -114,7 +96,7 @@ class SlicingBlockDevice : public BlockDevice {
114
96
*
115
97
* @param addr Address of block to begin erasing
116
98
* @param size Size to erase in bytes, must be a multiple of erase block size
117
- * @return 0 on success, negative error code on failure
99
+ * @return 0 on success or a negative error code on failure
118
100
*/
119
101
virtual int erase (bd_addr_t addr, bd_size_t size);
120
102
0 commit comments