@@ -35,35 +35,36 @@ namespace mbed {
35
35
*/
36
36
class BufferedBlockDevice : public BlockDevice {
37
37
public:
38
- /* * Lifetime of the memory block device
38
+ /* * Create a memory-buffered block device wrapping an underlying block device
39
39
*
40
40
* @param bd Block device to back the BufferedBlockDevice
41
41
*/
42
42
BufferedBlockDevice (BlockDevice *bd);
43
43
44
- /* * Lifetime of a block device
44
+ /* * Destroy the memory-buffered block device
45
45
*/
46
46
virtual ~BufferedBlockDevice ();
47
47
48
- /* * Initialize a block device
48
+ /* * Initialize a buffered-memory block device and its underlying block device
49
49
*
50
50
* @return 0 on success or a negative error code on failure
51
51
*/
52
52
virtual int init ();
53
53
54
- /* * Deinitialize a block device
54
+ /* * Deinitialize the buffered-memory block device and its underlying block device
55
55
*
56
56
* @return 0 on success or a negative error code on failure
57
57
*/
58
58
virtual int deinit ();
59
59
60
- /* * Ensure data on storage is in sync with the driver
60
+ /* * Ensure that data on the underlying storage block device is in sync with the
61
+ * memory-buffered block device
61
62
*
62
63
* @return 0 on success or a negative error code on failure
63
64
*/
64
65
virtual int sync ();
65
66
66
- /* * Read blocks from a block device
67
+ /* * Read blocks from the memory-buffered block device
67
68
*
68
69
* @param buffer Buffer to read blocks into
69
70
* @param addr Address of block to begin reading from
@@ -72,9 +73,9 @@ class BufferedBlockDevice : public BlockDevice {
72
73
*/
73
74
virtual int read (void *buffer, bd_addr_t addr, bd_size_t size);
74
75
75
- /* * Program blocks to a block device
76
+ /* * Program data to the memory-buffered block device
76
77
*
77
- * The blocks must have been erased prior to being programmed
78
+ * The write address blocks must be erased prior to being programmed.
78
79
*
79
80
* @param buffer Buffer of data to write to blocks
80
81
* @param addr Address of block to begin writing to
@@ -83,10 +84,10 @@ class BufferedBlockDevice : public BlockDevice {
83
84
*/
84
85
virtual int program (const void *buffer, bd_addr_t addr, bd_size_t size);
85
86
86
- /* * Erase blocks on a block device
87
+ /* * Erase blocks from the memory-buffered block device
87
88
*
88
89
* The state of an erased block is undefined until it has been programmed,
89
- * unless get_erase_value returns a non-negative byte value
90
+ * unless get_erase_value returns a non-negative byte value.
90
91
*
91
92
* @param addr Address of block to begin erasing
92
93
* @param size Size to erase in bytes, must be a multiple of erase block size
@@ -127,15 +128,15 @@ class BufferedBlockDevice : public BlockDevice {
127
128
*/
128
129
virtual bd_size_t get_erase_size () const ;
129
130
130
- /* * Get the size of an erasable block given address
131
+ /* * Get the size of an erasable block of a given address
131
132
*
132
133
* @param addr Address within the erasable block
133
134
* @return Size of an erasable block in bytes
134
135
* @note Must be a multiple of the program size
135
136
*/
136
137
virtual bd_size_t get_erase_size (bd_addr_t addr) const ;
137
138
138
- /* * Get the value of storage when erased
139
+ /* * Get the value of storage data after being erased
139
140
*
140
141
* If get_erase_value returns a non-negative byte value, the underlying
141
142
* storage is set to that value when erased, and storage containing
@@ -152,9 +153,9 @@ class BufferedBlockDevice : public BlockDevice {
152
153
*/
153
154
virtual bd_size_t size () const ;
154
155
155
- /* * Get the BlockDevice class type.
156
+ /* * Get the underlying BlockDevice class type
156
157
*
157
- * @return A string represent the BlockDevice class type.
158
+ * @return A string representing the underlying BlockDevice class type
158
159
*/
159
160
virtual const char *get_type () const ;
160
161
@@ -170,6 +171,7 @@ class BufferedBlockDevice : public BlockDevice {
170
171
uint32_t _init_ref_count;
171
172
bool _is_initialized;
172
173
174
+ #if !(DOXYGEN_ONLY)
173
175
/* * Flush data in cache
174
176
*
175
177
* @return 0 on success or a negative error code on failure
@@ -181,7 +183,7 @@ class BufferedBlockDevice : public BlockDevice {
181
183
* @return none
182
184
*/
183
185
void invalidate_write_cache ();
184
-
186
+ # endif // #if !(DOXYGEN_ONLY)
185
187
};
186
188
} // namespace mbed
187
189
0 commit comments