libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
flash.c
Go to the documentation of this file.
1/** @defgroup flash_file FLASH peripheral API
2 *
3 * @ingroup peripheral_apis
4 *
5 * @brief <b>libopencm3 STM32F2xx FLASH</b>
6 *
7 * @version 1.0.0
8 *
9 * @author @htmlonly &copy; @endhtmlonly 2010
10 * Thomas Otto <tommi@viadmin.org>
11 * @author @htmlonly &copy; @endhtmlonly 2010
12 * Mark Butler <mbutler@physics.otago.ac.nz>
13 *
14 * @date 14 January 2014
15 *
16 * This library supports the FLASH memory controller in the STM32F2
17 * series of ARM Cortex Microcontrollers by ST Microelectronics.
18 *
19 * For the STM32F2xx, accessing FLASH memory is described briefly in
20 * section 2.3.3 of the STM32F2xx Reference Manual.
21 * For detailed programming information see:
22 * PM0059 programming manual: STM32F10xxx Flash programming
23 * June 2013, Doc ID DocID15687 Rev 5
24 *
25 * LGPL License Terms @ref lgpl_license
26 */
27
28/*
29 * This file is part of the libopencm3 project.
30 *
31 * Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
32 * Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
33 *
34 * This library is free software: you can redistribute it and/or modify
35 * it under the terms of the GNU Lesser General Public License as published by
36 * the Free Software Foundation, either version 3 of the License, or
37 * (at your option) any later version.
38 *
39 * This library is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU Lesser General Public License for more details.
43 *
44 * You should have received a copy of the GNU Lesser General Public License
45 * along with this library. If not, see <http://www.gnu.org/licenses/>.
46 */
47
48/**@{*/
49
51
53{
54 while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY);
55}
56
57/*---------------------------------------------------------------------------*/
58/** @brief Clear the Programming Sequence Error Flag
59
60This flag is set when incorrect programming configuration has been made.
61*/
62
64{
66}
67
68/*---------------------------------------------------------------------------*/
69/** @brief Clear All Status Flags
70
71Program error, end of operation, write protect error, busy.
72*/
74{
80}
81
82/**@}*/
83
#define FLASH_SR_PGSERR
Definition: f2/flash.h:38
void flash_clear_pgperr_flag(void)
Clear programming parallelism error flag.
#define FLASH_SR_BSY
void flash_clear_pgaerr_flag(void)
Clear the Programming Alignment Error Flag.
void flash_clear_wrperr_flag(void)
Clear the Write Protect Error Flag.
void flash_wait_for_last_operation(void)
Wait until Last Operation has Ended.
Definition: flash.c:52
void flash_clear_pgserr_flag(void)
Clear the Programming Sequence Error Flag.
Definition: flash.c:63
void flash_clear_eop_flag(void)
Clear the End of OPeration flag.
void flash_clear_status_flags(void)
Clear All Status Flags.
Definition: flash.c:73
#define FLASH_SR
Flash Status register.