Skip to content

Commit 058f011

Browse files
bcostm0xc0170
authored andcommitted
STM32F1: Remove flash functions doc
1 parent ca24ee4 commit 058f011

File tree

1 file changed

+15
-66
lines changed

1 file changed

+15
-66
lines changed

targets/TARGET_STM/TARGET_STM32F1/flash_api.c

Lines changed: 15 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,9 @@
2828
// Minimum number of bytes to be programmed at a time
2929
#define MIN_PROG_SIZE (4U)
3030

31-
/** Initialize the flash peripheral and the flash_t object
32-
*
33-
* @param obj The flash object
34-
* @return 0 for success, -1 for error
35-
*/
36-
int32_t flash_init(flash_t *obj)
37-
{
38-
return 0;
39-
}
40-
41-
/** Uninitialize the flash peripheral and the flash_t object
42-
*
43-
* @param obj The flash object
44-
* @return 0 for success, -1 for error
45-
*/
46-
int32_t flash_free(flash_t *obj)
47-
{
48-
return 0;
49-
}
50-
5131
static int32_t flash_unlock(void)
5232
{
53-
/* Allow Access to Flash control registers and user Falsh */
33+
/* Allow Access to Flash control registers and user Flash */
5434
if (HAL_FLASH_Unlock()) {
5535
return -1;
5636
} else {
@@ -69,13 +49,16 @@ static int32_t flash_lock(void)
6949
}
7050
}
7151

72-
/** Erase one sector starting at defined address
73-
*
74-
* The address should be at sector boundary. This function does not do any check for address alignments
75-
* @param obj The flash object
76-
* @param address The sector starting address
77-
* @return 0 for success, -1 for error
78-
*/
52+
int32_t flash_init(flash_t *obj)
53+
{
54+
return 0;
55+
}
56+
57+
int32_t flash_free(flash_t *obj)
58+
{
59+
return 0;
60+
}
61+
7962
int32_t flash_erase_sector(flash_t *obj, uint32_t address)
8063
{
8164
uint32_t PAGEError = 0;
@@ -113,19 +96,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
11396
return status;
11497
}
11598

116-
/** Program one page starting at defined address
117-
*
118-
* The page should be at page boundary, should not cross multiple sectors.
119-
* This function does not do any check for address alignments or if size
120-
* is aligned to a page size.
121-
* @param obj The flash object
122-
* @param address The sector starting address
123-
* @param data The data buffer to be programmed
124-
* @param size The number of bytes to program
125-
* @return 0 for success, -1 for error
126-
*/
127-
int32_t flash_program_page(flash_t *obj, uint32_t address,
128-
const uint8_t *data, uint32_t size)
99+
int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data, uint32_t size)
129100
{
130101
uint32_t StartAddress = 0;
131102
int32_t status = 0;
@@ -177,13 +148,7 @@ int32_t flash_program_page(flash_t *obj, uint32_t address,
177148
return status;
178149
}
179150

180-
/** Get sector size
181-
*
182-
* @param obj The flash object
183-
* @param address The sector starting address
184-
* @return The size of a sector (in our case considering 1 sector = 1 page)
185-
*/
186-
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
151+
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
187152
{
188153
if (!(IS_FLASH_PROGRAM_ADDRESS(address))) {
189154
return MBED_FLASH_INVALID_SIZE;
@@ -192,33 +157,17 @@ uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
192157
}
193158
}
194159

195-
/** Get page size
196-
*
197-
* @param obj The flash object
198-
* @param address The page starting address
199-
* @return The size of a page (in our case the minimum programmable size)
200-
*/
201160
uint32_t flash_get_page_size(const flash_t *obj)
202161
{
203162
return MIN_PROG_SIZE;
204163
}
205164

206-
/** Get start address for the flash region
207-
*
208-
* @param obj The flash object
209-
* @return The start address for the flash region
210-
*/
211-
uint32_t flash_get_start_address(const flash_t *obj)
165+
uint32_t flash_get_start_address(const flash_t *obj)
212166
{
213167
return FLASH_BASE;
214168
}
215169

216-
/** Get the flash region size
217-
*
218-
* @param obj The flash object
219-
* @return The flash region size
220-
*/
221-
uint32_t flash_get_size(const flash_t *obj)
170+
uint32_t flash_get_size(const flash_t *obj)
222171
{
223172
return FLASH_SIZE;
224173
}

0 commit comments

Comments
 (0)