Skip to content

Commit e784c15

Browse files
author
Veijo Pesonen
committed
SFDP: doxygen improvements
1 parent ba71b09 commit e784c15

File tree

1 file changed

+43
-36
lines changed

1 file changed

+43
-36
lines changed

drivers/internal/SFDP.h

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,45 @@
2525

2626
namespace mbed {
2727

28-
static const int SFDP_HEADER_SIZE = 8; ///< Size of an SFDP header */
29-
static const int SFDP_BASIC_PARAMS_TBL_SIZE = 80; ///< Basic Parameter Table size in Bytes, 20 DWORDS */
30-
static const int SFDP_SECTOR_MAP_MAX_REGIONS = 10;
28+
/** \defgroup drivers-internal-api-sfdp SFDP
29+
* \ingroup drivers-internal-api
30+
* Serial Flash Discoverable Parameters.
31+
*
32+
* Based on <a href="https://www.jedec.org/standards-documents/docs/jesd216b">JESD216D.01 Standard</a>.
33+
* @{
34+
*/
35+
36+
static const int SFDP_HEADER_SIZE = 8; ///< Size of an SFDP header in bytes, 2 DWORDS
37+
static const int SFDP_BASIC_PARAMS_TBL_SIZE = 80; ///< Basic Parameter Table size in bytes, 20 DWORDS
38+
static const int SFDP_SECTOR_MAP_MAX_REGIONS = 10; ///< Maximum number of regions with different erase granularity
3139

3240
// Erase Types Per Region BitMask
33-
static const int SFDP_ERASE_BITMASK_TYPE4 = 0x08;
34-
static const int SFDP_ERASE_BITMASK_TYPE3 = 0x04;
35-
static const int SFDP_ERASE_BITMASK_TYPE2 = 0x02;
36-
static const int SFDP_ERASE_BITMASK_TYPE1 = 0x01;
37-
static const int SFDP_ERASE_BITMASK_NONE = 0x00;
38-
static const int SFDP_ERASE_BITMASK_ALL = 0x0F;
41+
static const int SFDP_ERASE_BITMASK_TYPE4 = 0x08; ///< Erase type 4 (erase granularity) identifier
42+
static const int SFDP_ERASE_BITMASK_TYPE3 = 0x04; ///< Erase type 3 (erase granularity) identifier
43+
static const int SFDP_ERASE_BITMASK_TYPE2 = 0x02; ///< Erase type 2 (erase granularity) identifier
44+
static const int SFDP_ERASE_BITMASK_TYPE1 = 0x01; ///< Erase type 1 (erase granularity) identifier
45+
static const int SFDP_ERASE_BITMASK_NONE = 0x00; ///< Erase type None
46+
static const int SFDP_ERASE_BITMASK_ALL = 0x0F; ///< Erase type All
3947

40-
static const int SFDP_MAX_NUM_OF_ERASE_TYPES = 4;
48+
static const int SFDP_MAX_NUM_OF_ERASE_TYPES = 4; ///< Maximum number of different erase types (erase granularity)
4149

4250
/** SFDP Basic Parameter Table info */
4351
struct sfdp_bptbl_info {
44-
uint32_t addr;
45-
size_t size;
52+
uint32_t addr; ///< Address
53+
size_t size; ///< Size
4654
};
4755

4856
/** SFDP Sector Map Table info */
4957
struct sfdp_smptbl_info {
50-
uint32_t addr;
51-
size_t size;
52-
int region_cnt;
53-
int region_size[SFDP_SECTOR_MAP_MAX_REGIONS]; // [Bytes]
54-
//Each Region can support a bit combination of any of the 4 Erase Types
55-
uint8_t region_erase_types_bitfld[SFDP_SECTOR_MAP_MAX_REGIONS];
56-
unsigned int regions_min_common_erase_size; // minimal common erase size for all regions (0 if none exists)
57-
bd_size_t region_high_boundary[SFDP_SECTOR_MAP_MAX_REGIONS]; //region high address offset boundary
58-
// Up To 4 Erase Types are supported by SFDP (each with its own command Instruction and Size)
59-
int erase_type_inst_arr[SFDP_MAX_NUM_OF_ERASE_TYPES];
60-
unsigned int erase_type_size_arr[SFDP_MAX_NUM_OF_ERASE_TYPES];
58+
uint32_t addr; ///< Address
59+
size_t size; ///< Size
60+
int region_cnt; ///< Number of erase regions
61+
int region_size[SFDP_SECTOR_MAP_MAX_REGIONS]; ///< Erase region size in bytes
62+
uint8_t region_erase_types_bitfld[SFDP_SECTOR_MAP_MAX_REGIONS]; ///< Each Region can support a bit combination of any of the 4 Erase Types
63+
unsigned int regions_min_common_erase_size; ///< Minimal common erase size for all regions (0 if none exists)
64+
bd_size_t region_high_boundary[SFDP_SECTOR_MAP_MAX_REGIONS]; ///< Region high address offset boundary
65+
int erase_type_inst_arr[SFDP_MAX_NUM_OF_ERASE_TYPES]; ///< // Up To 4 Erase Types are supported by SFDP (each with its own command Instruction and Size)
66+
unsigned int erase_type_size_arr[SFDP_MAX_NUM_OF_ERASE_TYPES]; ///< Erase sizes for all different erase types
6167
};
6268

6369
/** SFDP Parameter Table addresses and sizes */
@@ -68,23 +74,23 @@ struct sfdp_hdr_info {
6874

6975
/** SFDP Header */
7076
struct sfdp_hdr {
71-
uint8_t SIG_B0; // SFDP Signature, Byte 0
72-
uint8_t SIG_B1; // SFDP Signature, Byte 1
73-
uint8_t SIG_B2; // SFDP Signature, Byte 2
74-
uint8_t SIG_B3; // SFDP Signature, Byte 3
75-
uint8_t R_MINOR; // SFDP Minor Revision
76-
uint8_t R_MAJOR; // SFDP Major Revision
77-
uint8_t NPH; // Number of parameter headers (0-based, 0 indicates 1 parameter header)
78-
uint8_t ACP; // SFDP Access Protocol
77+
uint8_t SIG_B0; ///< SFDP Signature, Byte 0
78+
uint8_t SIG_B1; ///< SFDP Signature, Byte 1
79+
uint8_t SIG_B2; ///< SFDP Signature, Byte 2
80+
uint8_t SIG_B3; ///< SFDP Signature, Byte 3
81+
uint8_t R_MINOR; ///< SFDP Minor Revision
82+
uint8_t R_MAJOR; ///< SFDP Major Revision
83+
uint8_t NPH; ///< Number of parameter headers (0-based, 0 indicates 1 parameter header)
84+
uint8_t ACP; ///< SFDP Access Protocol
7985
};
8086

8187
/** SFDP Parameter header */
8288
struct sfdp_prm_hdr {
83-
uint8_t PID_LSB; // Parameter ID LSB
84-
uint8_t P_MINOR; // Parameter Minor Revision
85-
uint8_t P_MAJOR; // Parameter Major Revision
86-
uint8_t P_LEN; // Parameter length in DWORDS
87-
uint32_t DWORD2; // Parameter ID MSB + Parameter Table Pointer
89+
uint8_t PID_LSB; ///< Parameter ID LSB
90+
uint8_t P_MINOR; ///< Parameter Minor Revision
91+
uint8_t P_MAJOR; ///< Parameter Major Revision
92+
uint8_t P_LEN; ///< Parameter length in DWORDS
93+
uint32_t DWORD2; ///< Parameter ID MSB + Parameter Table Pointer
8894
};
8995

9096
/** Parse SFDP Header
@@ -120,5 +126,6 @@ int sfdp_parse_headers(Callback<int(bd_addr_t, void *, bd_size_t)> sfdp_reader,
120126
*/
121127
int sfdp_parse_sector_map_table(Callback<int(bd_addr_t, void *, bd_size_t)> sfdp_reader, sfdp_smptbl_info &smtbl);
122128

129+
/** @}*/
123130
} /* namespace mbed */
124131
#endif

0 commit comments

Comments
 (0)