@@ -28,7 +28,7 @@ enum spif_bd_error {
28
28
SPIF_BD_ERROR_OK = 0 , /* !< no error */
29
29
SPIF_BD_ERROR_DEVICE_ERROR = BD_ERROR_DEVICE_ERROR, /* !< device specific error -4001 */
30
30
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 */
32
32
SPIF_BD_ERROR_WREN_FAILED = -4004 , /* Write Enable Failed */
33
33
SPIF_BD_ERROR_INVALID_ERASE_PARAMS = -4005 , /* Erase command not on sector aligned addresses or exceeds device size */
34
34
};
@@ -40,7 +40,7 @@ enum spif_bd_error {
40
40
/* * BlockDevice for SFDP based flash devices over SPI bus
41
41
*
42
42
* @code
43
- * // Here's an example using SPI flash device on K82F target
43
+ * // An example using SPI flash device on K82F target
44
44
* #include "mbed.h"
45
45
* #include "SPIFBlockDevice.h"
46
46
*
@@ -88,7 +88,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
88
88
*
89
89
* @return SPIF_BD_ERROR_OK(0) - success
90
90
* 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
92
92
* SPIF_BD_ERROR_PARSING_FAILED - unexpected format or values in one of the SFDP tables
93
93
*/
94
94
virtual int init ();
@@ -99,7 +99,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
99
99
*/
100
100
virtual int deinit ();
101
101
102
- /* * Desctruct SPIFBlockDevie
102
+ /* * Desctruct SPIFBlockDevice
103
103
*/
104
104
~SPIFBlockDevice ()
105
105
{
@@ -118,7 +118,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
118
118
119
119
/* * Program blocks to a block device
120
120
*
121
- * The blocks must have been erased prior to being programmed
121
+ * @note The blocks must have been erased prior to being programmed
122
122
*
123
123
* @param buffer Buffer of data to write to blocks
124
124
* @param addr Address of block to begin writing to
@@ -132,14 +132,13 @@ class SPIFBlockDevice : public mbed::BlockDevice {
132
132
133
133
/* * Erase blocks on a block device
134
134
*
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
136
136
*
137
137
* @param addr Address of block to begin erasing
138
138
* @param size Size to erase in bytes, must be a multiple of erase block size
139
139
* @return SPIF_BD_ERROR_OK(0) - success
140
140
* SPIF_BD_ERROR_DEVICE_ERROR - device driver transaction failed
141
141
* SPIF_BD_ERROR_READY_FAILED - Waiting for Memory ready failed or timed out
142
- * SPIF_BD_ERROR_WREN_FAILED - Write Enable failed
143
142
* SPIF_BD_ERROR_INVALID_ERASE_PARAMS - Trying to erase unaligned address or size
144
143
*/
145
144
virtual int erase (mbed::bd_addr_t addr, mbed::bd_size_t size);
@@ -157,14 +156,14 @@ class SPIFBlockDevice : public mbed::BlockDevice {
157
156
*/
158
157
virtual mbed::bd_size_t get_program_size () const ;
159
158
160
- /* * Get the size of a eraseable block
159
+ /* * Get the size of an erasable block
161
160
*
162
- * @return Size of a eraseable block in bytes
161
+ * @return Size of an erasable block in bytes
163
162
* @note Must be a multiple of the program size
164
163
*/
165
164
virtual mbed::bd_size_t get_erase_size () const ;
166
165
167
- /* * Get the size of minimal eraseable sector size of given address
166
+ /* * Get the size of minimal erasable sector size of given address
168
167
*
169
168
* @param addr Any address within block queried for erase sector size (can be any address within flash size offset)
170
169
* @return Size of minimal erase sector size, in given address region, in bytes
@@ -191,7 +190,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
191
190
192
191
/* * Get the BlockDevice class type.
193
192
*
194
- * @return A string represent the BlockDevice class type.
193
+ * @return A string representation of the BlockDevice class type.
195
194
*/
196
195
virtual const char *get_type () const ;
197
196
@@ -209,7 +208,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
209
208
// Parse and Detect required Basic Parameters from Table
210
209
int _sfdp_parse_basic_param_table (uint32_t basic_table_addr, size_t basic_table_size);
211
210
212
- // Parse and read information required by Regions Secotr Map
211
+ // Parse and read information required by Regions Sector Map
213
212
int _sfdp_parse_sector_map_table (uint32_t sector_map_table_addr, size_t sector_map_table_size);
214
213
215
214
// Detect fastest read Bus mode supported by device
@@ -226,10 +225,10 @@ class SPIFBlockDevice : public mbed::BlockDevice {
226
225
/* **********************/
227
226
/* Utilities Functions */
228
227
/* **********************/
229
- // Find the region to which the given offset belong to
228
+ // Find the region to which the given offset belongs to
230
229
int _utils_find_addr_region (bd_size_t offset);
231
230
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.
233
232
// Iterates from highest type to lowest
234
233
int _utils_iterate_next_largest_erase_type (uint8_t &bitfield, int size, int offset, int boundry);
235
234
@@ -266,7 +265,7 @@ class SPIFBlockDevice : public mbed::BlockDevice {
266
265
private:
267
266
// Master side hardware
268
267
mbed::SPI _spi;
269
- // Enable CS control (low/high) for SPI driver operatios
268
+ // Enable CS control (low/high) for SPI driver operations
270
269
mbed::DigitalOut _cs;
271
270
272
271
// 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