Skip to content

Commit edf7fb3

Browse files
committed
flash: add doxygen documentation
1 parent a9a0507 commit edf7fb3

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

hal/flash_api.h

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,63 @@ typedef struct flash_s flash_t;
3030
extern "C" {
3131
#endif
3232

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+
*/
3443
int32_t flash_init(flash_t *obj);
3544

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+
*/
3750
int32_t flash_free(flash_t *obj);
3851

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+
*/
4059
int32_t flash_erase_sector(flash_t *obj, uint32_t address);
4160

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+
*/
4370
int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data, uint32_t size);
4471

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+
*/
4578
uint32_t flash_get_sector_size(flash_t *obj, uint32_t address);
4679

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+
*/
4786
uint32_t flash_get_page_size(flash_t *obj);
4887

88+
/**@}*/
89+
4990
#ifdef __cplusplus
5091
}
5192
#endif

0 commit comments

Comments
 (0)