|
18 | 18 |
|
19 | 19 | #include <stdint.h>
|
20 | 20 |
|
21 |
| -// Target flash algorithm structure |
| 21 | +/** Target flash algorithm structure |
| 22 | + */ |
22 | 23 | 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 */ |
29 | 30 | } flash_algo_t;
|
30 | 31 |
|
| 32 | +/** Sector information structure |
| 33 | + */ |
31 | 34 | 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 */ |
34 | 37 | } sector_info_t;
|
35 | 38 |
|
| 39 | +/** Flash configuration structure |
| 40 | + */ |
36 | 41 | 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 */ |
42 | 47 | } flash_target_config_t;
|
43 | 48 |
|
44 |
| -// Target flash configuration |
| 49 | +/** Target flash configuration |
| 50 | + */ |
45 | 51 | struct flash_s {
|
46 | 52 | const flash_target_config_t *target_config;
|
47 | 53 | const flash_algo_t *flash_algo;
|
48 | 54 | };
|
49 | 55 |
|
| 56 | +/** Flash algo argument structure |
| 57 | + * Contains all registers that should be preserved |
| 58 | + */ |
50 | 59 | typedef struct {
|
51 | 60 | uint32_t r0;
|
52 | 61 | uint32_t r1;
|
|
0 commit comments