Skip to content

Commit 773fb90

Browse files
authored
Merge pull request #6373 from 0xc0170/fix_flash_docs
flash: add docs for user defined data
2 parents 25a2d15 + e828b39 commit 773fb90

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,44 @@
1818

1919
#include <stdint.h>
2020

21-
// Target flash algorithm structure
21+
/** Target flash algorithm structure
22+
*/
2223
typedef struct {
23-
const uint32_t init;
24-
const uint32_t uninit;
25-
const uint32_t erase_sector;
26-
const uint32_t program_page;
27-
const uint32_t static_base;
28-
uint32_t *algo_blob;
24+
const uint32_t init; /**< Init function address */
25+
const uint32_t uninit; /**< Uninit function address */
26+
const uint32_t erase_sector; /**< Erase sector function address */
27+
const uint32_t program_page; /**< Program page function address */
28+
const uint32_t static_base; /**< Static base address */
29+
uint32_t *algo_blob; /**< Pointer to flash algo binary blob */
2930
} flash_algo_t;
3031

32+
/** Sector information structure
33+
*/
3134
typedef struct {
32-
const uint32_t start;
33-
const uint32_t size;
35+
const uint32_t start; /**< Sector start address */
36+
const uint32_t size; /**< Sector size */
3437
} sector_info_t;
3538

39+
/** Flash configuration structure
40+
*/
3641
typedef struct {
37-
const uint32_t page_size;
38-
const uint32_t flash_start;
39-
const uint32_t flash_size;
40-
const sector_info_t *sectors;
41-
const uint32_t sector_info_count;
42+
const uint32_t page_size; /**< The minimum program page size that can be written */
43+
const uint32_t flash_start; /**< Start address of the flash <0, flash_size) */
44+
const uint32_t flash_size; /**< Flash size. The size is accumulative sum of all sector sizes */
45+
const sector_info_t *sectors; /**< List of sectors - sector can vary in sizes */
46+
const uint32_t sector_info_count; /**< Number of sectors */
4247
} flash_target_config_t;
4348

44-
// Target flash configuration
49+
/** Target flash configuration
50+
*/
4551
struct flash_s {
4652
const flash_target_config_t *target_config;
4753
const flash_algo_t *flash_algo;
4854
};
4955

56+
/** Flash algo argument structure
57+
* Contains all registers that should be preserved
58+
*/
5059
typedef struct {
5160
uint32_t r0;
5261
uint32_t r1;

0 commit comments

Comments
 (0)