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 STM32L1xx FLASH</b>
6
*
7
* @version 1.0.0
8
*
9
* @author @htmlonly © @endhtmlonly 2010
10
* Thomas Otto <tommi@viadmin.org>
11
* @author @htmlonly © @endhtmlonly 2010
12
* Mark Butler <mbutler@physics.otago.ac.nz>
13
* @author @htmlonly © @endhtmlonly 2012
14
* Karl Palsson <karlp@tweak.net.au>
15
*
16
* @date 14 January 2014
17
*
18
* For the STM32L1xx, accessing FLASH memory is described briefly in
19
* section 2.3.3 of the STM32L1xx Reference Manual.
20
* For detailed programming information see:
21
* PM0062 programming manual: STM32L1xxxx Flash and EEPROM programming
22
* March 2012, Doc ID 16024 Rev 5
23
*
24
* LGPL License Terms @ref lgpl_license
25
*/
26
27
/*
28
* This file is part of the libopencm3 project.
29
*
30
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
31
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
32
* Copyright (C) 2012-13 Karl Palsson <karlp@tweak.net.au>
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
50
#include <
libopencm3/stm32/flash.h
>
51
52
/*---------------------------------------------------------------------------*/
53
/** @brief Enable 64 Bit Programming Mode
54
55
*/
56
57
void
flash_64bit_enable
(
void
)
58
{
59
FLASH_ACR
|=
FLASH_ACR_ACC64
;
60
}
61
62
/*---------------------------------------------------------------------------*/
63
/** @brief Enable 32 Bit Programming Mode
64
65
This mode is a low power mode. It must be used at low frequencies and does not
66
allow prefetch or wait states to be used.
67
*/
68
69
void
flash_64bit_disable
(
void
)
70
{
71
FLASH_ACR
&= ~FLASH_ACR_ACC64;
72
}
73
74
/**@}*/
flash.h
FLASH_ACR
#define FLASH_ACR
Definition:
flash_common_l01.h:36
FLASH_ACR_ACC64
#define FLASH_ACR_ACC64
Definition:
l1/flash.h:54
flash_64bit_enable
void flash_64bit_enable(void)
Enable 64 Bit Programming Mode.
Definition:
flash.c:57
flash_64bit_disable
void flash_64bit_disable(void)
Enable 32 Bit Programming Mode.
Definition:
flash.c:69
lib
stm32
l1
flash.c
Generated on Tue Mar 7 2023 16:12:05 for libopencm3 by
1.9.4