@@ -30,22 +30,63 @@ typedef struct flash_s flash_t;
30
30
extern "C" {
31
31
#endif
32
32
33
- // maps to FlashAlgo Init
33
+ /**
34
+ * \defgroup flash_hal Flash HAL API
35
+ * @{
36
+ */
37
+
38
+ /** Initialize the flash peripheral and the flash_t object
39
+ *
40
+ * @param obj The flash object
41
+ * @return 0 for success, -1 for error
42
+ */
34
43
int32_t flash_init (flash_t * obj );
35
44
36
- // maps to FlashAlgo UnInit
45
+ /** Uninitialize the flash peripheral and the flash_t object
46
+ *
47
+ * @param obj The flash object
48
+ * @return 0 for success, -1 for error
49
+ */
37
50
int32_t flash_free (flash_t * obj );
38
51
39
- // maps to FlashAlgo EraseSector
52
+ /** Erase one sector starting at defined address
53
+ *
54
+ * The address should be at sector boundary
55
+ * @param obj The flash object
56
+ * @param address The sector starting address
57
+ * @return 0 for success, -1 for error
58
+ */
40
59
int32_t flash_erase_sector (flash_t * obj , uint32_t address );
41
60
42
- // maps FlashAlgo to ProgramPage
61
+ /** Program one page starting at defined address
62
+ *
63
+ * The page should be at page boundary, should not cross multiple sectors
64
+ * @param obj The flash object
65
+ * @param address The sector starting address
66
+ * @param data The data buffer to be programmed
67
+ * @param size The number of in bytes
68
+ * @return 0 for success, -1 for error
69
+ */
43
70
int32_t flash_program_page (flash_t * obj , uint32_t address , const uint8_t * data , uint32_t size );
44
71
72
+ /** Get sector size
73
+ *
74
+ * @param obj The flash object
75
+ * @param address The sector starting address
76
+ * @return The size of a sector
77
+ */
45
78
uint32_t flash_get_sector_size (flash_t * obj , uint32_t address );
46
79
80
+ /** Get page size
81
+ *
82
+ * @param obj The flash object
83
+ * @param address The page starting address
84
+ * @return The size of a page
85
+ */
47
86
uint32_t flash_get_page_size (flash_t * obj );
48
87
88
+ /**@}*/
89
+
49
90
#ifdef __cplusplus
50
91
}
51
92
#endif
0 commit comments