Skip to content

Commit 0d3e189

Browse files
committed
STM32F2: Remove flash functions doc
1 parent c86f1ef commit 0d3e189

File tree

1 file changed

+13
-63
lines changed

1 file changed

+13
-63
lines changed

targets/TARGET_STM/TARGET_STM32F2/flash_api.c

Lines changed: 13 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,6 @@
2323
static uint32_t GetSector(uint32_t Address);
2424
static uint32_t GetSectorSize(uint32_t Sector);
2525

26-
/** Initialize the flash peripheral and the flash_t object
27-
*
28-
* @param obj The flash object
29-
* @return 0 for success, -1 for error
30-
*/
31-
int32_t flash_init(flash_t *obj)
32-
{
33-
return 0;
34-
}
35-
36-
/** Uninitialize the flash peripheral and the flash_t object
37-
*
38-
* @param obj The flash object
39-
* @return 0 for success, -1 for error
40-
*/
41-
int32_t flash_free(flash_t *obj)
42-
{
43-
return 0;
44-
}
45-
4626
static int32_t flash_unlock(void)
4727
{
4828
/* Allow Access to Flash control registers and user Falsh */
@@ -64,13 +44,16 @@ static int32_t flash_lock(void)
6444
}
6545
}
6646

67-
/** Erase one sector starting at defined address
68-
*
69-
* The address should be at sector boundary. This function does not do any check for address alignments
70-
* @param obj The flash object
71-
* @param address The sector starting address
72-
* @return 0 for success, -1 for error
73-
*/
47+
int32_t flash_init(flash_t *obj)
48+
{
49+
return 0;
50+
}
51+
52+
int32_t flash_free(flash_t *obj)
53+
{
54+
return 0;
55+
}
56+
7457
int32_t flash_erase_sector(flash_t *obj, uint32_t address)
7558
{
7659
static FLASH_EraseInitTypeDef EraseInitStruct;
@@ -104,17 +87,6 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
10487
return status;
10588
}
10689

107-
/** Program one page starting at defined address
108-
*
109-
* The page should be at page boundary, should not cross multiple sectors.
110-
* This function does not do any check for address alignments or if size
111-
* is aligned to a page size.
112-
* @param obj The flash object
113-
* @param address The sector starting address
114-
* @param data The data buffer to be programmed
115-
* @param size The number of bytes to program
116-
* @return 0 for success, -1 for error
117-
*/
11890
int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data, uint32_t size)
11991
{
12092
int32_t status = 0;
@@ -155,13 +127,7 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
155127
return status;
156128
}
157129

158-
/** Get sector size
159-
*
160-
* @param obj The flash object
161-
* @param address The sector starting address
162-
* @return The size of a sector (in our case considering 1 sector = 1 page)
163-
*/
164-
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
130+
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
165131
{
166132
if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
167133
return MBED_FLASH_INVALID_SIZE;
@@ -170,34 +136,18 @@ uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
170136
}
171137
}
172138

173-
/** Get page size
174-
*
175-
* @param obj The flash object
176-
* @param address The page starting address
177-
* @return The size of a page (in our case the minimum programmable size)
178-
*/
179139
uint32_t flash_get_page_size(const flash_t *obj)
180140
{
181141
// Flash of STM32F2 devices can be programed 1 byte at a time
182142
return 1;
183143
}
184144

185-
/** Get start address for the flash region
186-
*
187-
* @param obj The flash object
188-
* @return The start address for the flash region
189-
*/
190-
uint32_t flash_get_start_address(const flash_t *obj)
145+
uint32_t flash_get_start_address(const flash_t *obj)
191146
{
192147
return FLASH_BASE;
193148
}
194149

195-
/** Get the flash region size
196-
*
197-
* @param obj The flash object
198-
* @return The flash region size
199-
*/
200-
uint32_t flash_get_size(const flash_t *obj)
150+
uint32_t flash_get_size(const flash_t *obj)
201151
{
202152
return FLASH_SIZE;
203153
}

0 commit comments

Comments
 (0)