libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
l1/flash.h
Go to the documentation of this file.
1/** @defgroup flash_defines FLASH Defines
2 *
3 * @ingroup STM32L1xx_defines
4 *
5 * @brief Defined Constants and Types for the STM32L1xx FLASH Memory
6 *
7 * @version 1.0.0
8 *
9 * @author @htmlonly © @endhtmlonly 2012
10 * Karl Palsson <karlp@tweak.net.au>
11 *
12 * @date 14 January 2014
13 *
14 * LGPL License Terms @ref lgpl_license
15 */
16
17/*
18 * This file is part of the libopencm3 project.
19 *
20 * Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
21 * Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
22 * Copyright (C) 2012 Karl Palsson <karlp@tweak.net.au>
23 *
24 * This library is free software: you can redistribute it and/or modify
25 * it under the terms of the GNU Lesser General Public License as published by
26 * the Free Software Foundation, either version 3 of the License, or
27 * (at your option) any later version.
28 *
29 * This library is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU Lesser General Public License for more details.
33 *
34 * You should have received a copy of the GNU Lesser General Public License
35 * along with this library. If not, see <http://www.gnu.org/licenses/>.
36 */
37
38/*
39 * All extracted from PM0062 rev2, L15xx and L16xx Flash/EEPROM programming
40 * manual.
41 */
42
43#ifndef LIBOPENCM3_FLASH_H
44#define LIBOPENCM3_FLASH_H
45/**@{*/
46
49
50/* --- FLASH registers ----------------------------------------------------- */
51#define FLASH_WRPR3 MMIO32(FLASH_MEM_INTERFACE_BASE + 0x84)
52
53/* --- FLASH_ACR values ---------------------------------------------------- */
54#define FLASH_ACR_ACC64 (1 << 2)
55
56/* --- FLASH_SR values ----------------------------------------------------- */
57#define FLASH_SR_OPTVERRUSR (1 << 12)
58
59#define FLASH_HALF_PAGE_SIZE 32
60
62
63void flash_64bit_enable(void);
64void flash_64bit_disable(void);
65
67/**@}*/
68
69#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void flash_64bit_enable(void)
Enable 64 Bit Programming Mode.
Definition: flash.c:57
void flash_64bit_disable(void)
Enable 32 Bit Programming Mode.
Definition: flash.c:69