libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
flash_common_all.c
Go to the documentation of this file.
1/** @addtogroup flash_file FLASH peripheral API
2 * @ingroup peripheral_apis
3 */
4
5/*
6 * This file is part of the libopencm3 project.
7 *
8 * This library is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22/**@{*/
23
25
27{
29}
30
32{
33 FLASH_ACR &= ~FLASH_ACR_PRFTEN;
34}
35
36void flash_set_ws(uint32_t ws)
37{
38 uint32_t reg32;
39
40 reg32 = FLASH_ACR;
42 reg32 |= (ws << FLASH_ACR_LATENCY_SHIFT);
43 FLASH_ACR = reg32;
44}
45
47{
50}
51
52/**@}*/
#define FLASH_ACR_PRFTEN
Definition: l4/flash.h:71
#define FLASH_ACR
Definition: l4/flash.h:50
#define FLASH_ACR_LATENCY_MASK
Definition: l4/flash.h:74
#define FLASH_OPTKEYR_KEY1
Definition: l4/flash.h:218
#define FLASH_OPTKEYR_KEY2
Definition: l4/flash.h:219
#define FLASH_ACR_LATENCY_SHIFT
Definition: l4/flash.h:73
#define FLASH_OPTKEYR
Definition: l4/flash.h:53
void flash_prefetch_enable(void)
This buffer is used for instruction fetches and may or may not be enabled by default,...
void flash_prefetch_disable(void)
Note carefully the clock restrictions under which the prefetch buffer may be set to disabled.
void flash_unlock_option_bytes(void)
Unlock the Option Byte Access.
void flash_set_ws(uint32_t ws)
Set the Number of Wait States.