Skip to content

Commit 47e477c

Browse files
authored
Merge pull request #9310 from juhaylinen/spifblockdevice-doc
SPIFBlockDevice docs update
2 parents 7addb80 + 96877b8 commit 47e477c

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum spif_bd_error {
2828
SPIF_BD_ERROR_OK = 0, /*!< no error */
2929
SPIF_BD_ERROR_DEVICE_ERROR = BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */
3030
SPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */
31-
SPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */
31+
SPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Memory Ready failed */
3232
SPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */
3333
SPIF_BD_ERROR_INVALID_ERASE_PARAMS = -4005, /* Erase command not on sector aligned addresses or exceeds device size */
3434
};
@@ -40,7 +40,7 @@ enum spif_bd_error {
4040
/** BlockDevice for SFDP based flash devices over SPI bus
4141
*
4242
* @code
43-
* // Here's an example using SPI flash device on K82F target
43+
* // An example using SPI flash device on K82F target
4444
* #include "mbed.h"
4545
* #include "SPIFBlockDevice.h"
4646
*
@@ -88,7 +88,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
8888
*
8989
* @return SPIF_BD_ERROR_OK(0) - success
9090
* SPIF_BD_ERROR_DEVICE_ERROR - device driver transaction failed
91-
* SPIF_BD_ERROR_READY_FAILED - Waiting for Memory ready failed or timedout
91+
* SPIF_BD_ERROR_READY_FAILED - Waiting for Memory ready failed or timed out
9292
* SPIF_BD_ERROR_PARSING_FAILED - unexpected format or values in one of the SFDP tables
9393
*/
9494
virtual int init();
@@ -99,7 +99,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
9999
*/
100100
virtual int deinit();
101101

102-
/** Desctruct SPIFBlockDevie
102+
/** Desctruct SPIFBlockDevice
103103
*/
104104
~SPIFBlockDevice()
105105
{
@@ -118,7 +118,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
118118

119119
/** Program blocks to a block device
120120
*
121-
* The blocks must have been erased prior to being programmed
121+
* @note The blocks must have been erased prior to being programmed
122122
*
123123
* @param buffer Buffer of data to write to blocks
124124
* @param addr Address of block to begin writing to
@@ -132,14 +132,13 @@ class SPIFBlockDevice : public mbed::BlockDevice {
132132

133133
/** Erase blocks on a block device
134134
*
135-
* The state of an erased block is undefined until it has been programmed
135+
* @note The state of an erased block is undefined until it has been programmed
136136
*
137137
* @param addr Address of block to begin erasing
138138
* @param size Size to erase in bytes, must be a multiple of erase block size
139139
* @return SPIF_BD_ERROR_OK(0) - success
140140
* SPIF_BD_ERROR_DEVICE_ERROR - device driver transaction failed
141141
* SPIF_BD_ERROR_READY_FAILED - Waiting for Memory ready failed or timed out
142-
* SPIF_BD_ERROR_WREN_FAILED - Write Enable failed
143142
* SPIF_BD_ERROR_INVALID_ERASE_PARAMS - Trying to erase unaligned address or size
144143
*/
145144
virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size);
@@ -157,14 +156,14 @@ class SPIFBlockDevice : public mbed::BlockDevice {
157156
*/
158157
virtual mbed::bd_size_t get_program_size() const;
159158

160-
/** Get the size of a eraseable block
159+
/** Get the size of an erasable block
161160
*
162-
* @return Size of a eraseable block in bytes
161+
* @return Size of an erasable block in bytes
163162
* @note Must be a multiple of the program size
164163
*/
165164
virtual mbed::bd_size_t get_erase_size() const;
166165

167-
/** Get the size of minimal eraseable sector size of given address
166+
/** Get the size of minimal erasable sector size of given address
168167
*
169168
* @param addr Any address within block queried for erase sector size (can be any address within flash size offset)
170169
* @return Size of minimal erase sector size, in given address region, in bytes
@@ -191,7 +190,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
191190

192191
/** Get the BlockDevice class type.
193192
*
194-
* @return A string represent the BlockDevice class type.
193+
* @return A string representation of the BlockDevice class type.
195194
*/
196195
virtual const char *get_type() const;
197196

@@ -209,7 +208,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
209208
// Parse and Detect required Basic Parameters from Table
210209
int _sfdp_parse_basic_param_table(uint32_t basic_table_addr, size_t basic_table_size);
211210

212-
// Parse and read information required by Regions Secotr Map
211+
// Parse and read information required by Regions Sector Map
213212
int _sfdp_parse_sector_map_table(uint32_t sector_map_table_addr, size_t sector_map_table_size);
214213

215214
// Detect fastest read Bus mode supported by device
@@ -226,10 +225,10 @@ class SPIFBlockDevice : public mbed::BlockDevice {
226225
/***********************/
227226
/* Utilities Functions */
228227
/***********************/
229-
// Find the region to which the given offset belong to
228+
// Find the region to which the given offset belongs to
230229
int _utils_find_addr_region(bd_size_t offset);
231230

232-
// Iterate on all supported Erase Types of the Region to which the offset belong to.
231+
// Iterate on all supported Erase Types of the Region to which the offset belongs to.
233232
// Iterates from highest type to lowest
234233
int _utils_iterate_next_largest_erase_type(uint8_t &bitfield, int size, int offset, int boundry);
235234

@@ -266,7 +265,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
266265
private:
267266
// Master side hardware
268267
mbed::SPI _spi;
269-
// Enable CS control (low/high) for SPI driver operatios
268+
// Enable CS control (low/high) for SPI driver operations
270269
mbed::DigitalOut _cs;
271270

272271
// Mutex is used to protect Flash device for some SPI Driver commands that must be done sequentially with no other commands in between

0 commit comments

Comments
 (0)