libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
l0/syscfg.h
Go to the documentation of this file.
1
/** @defgroup syscfg_defines SYSCFG Defines
2
*
3
* @brief <b>Defined Constants and Types for the STM32L0xx System Config</b>
4
*
5
* @ingroup STM32L0xx_defines
6
*
7
* @version 1.0.0
8
*
9
* @author @htmlonly © @endhtmlonly 2015
10
* Robin Kreis <r.kreis@uni-bremen.de>
11
*
12
* @date 1 May 2015
13
*
14
* LGPL License Terms @ref lgpl_license
15
*/
16
/*
17
* This file is part of the libopencm3 project.
18
*
19
* Copyright (C) 2015 Robin Kreis <r.kreis@uni-bremen.de>
20
*
21
* This library is free software: you can redistribute it and/or modify
22
* it under the terms of the GNU Lesser General Public License as published by
23
* the Free Software Foundation, either version 3 of the License, or
24
* (at your option) any later version.
25
*
26
* This library is distributed in the hope that it will be useful,
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
* GNU Lesser General Public License for more details.
30
*
31
* You should have received a copy of the GNU Lesser General Public License
32
* along with this library. If not, see <http://www.gnu.org/licenses/>.
33
*/
34
35
#ifndef LIBOPENCM3_SYSCFG_H
36
#define LIBOPENCM3_SYSCFG_H
37
/**@{*/
38
39
/*****************************************************************************/
40
/* Module definitions */
41
/*****************************************************************************/
42
43
/*****************************************************************************/
44
/* Register definitions */
45
/*****************************************************************************/
46
47
#define SYSCFG_CFGR1 MMIO32(SYSCFG_BASE + 0x00)
48
#define SYSCFG_CFGR2 MMIO32(SYSCFG_BASE + 0x04)
49
#define SYSCFG_EXTICR(i) MMIO32(SYSCFG_BASE + 0x08 + (i)*4)
50
#define SYSCFG_EXTICR1 SYSCFG_EXTICR(0)
51
#define SYSCFG_EXTICR2 SYSCFG_EXTICR(1)
52
#define SYSCFG_EXTICR3 SYSCFG_EXTICR(2)
53
#define SYSCFG_EXTICR4 SYSCFG_EXTICR(3)
54
#define COMP1_CTRL MMIO32(SYSCFG_BASE + 0x18)
55
#define COMP2_CTRL MMIO32(SYSCFG_BASE + 0x1C)
56
#define SYSCFG_CFGR3 MMIO32(SYSCFG_BASE + 0x20)
57
58
/*****************************************************************************/
59
/* Register values */
60
/*****************************************************************************/
61
62
/* SYSCFG_CFGR1 Values -- ---------------------------------------------------*/
63
64
#define SYSCFG_CFGR1_MEM_MODE_SHIFT 0
65
#define SYSCFG_CFGR1_MEM_MODE (3 << SYSCFG_CFGR1_MEM_MODE_SHIFT)
66
#define SYSCFG_CFGR1_MEM_MODE_FLASH (0 << SYSCFG_CFGR1_MEM_MODE_SHIFT)
67
#define SYSCFG_CFGR1_MEM_MODE_SYSTEM (1 << SYSCFG_CFGR1_MEM_MODE_SHIFT)
68
#define SYSCFG_CFGR1_MEM_MODE_SRAM (3 << SYSCFG_CFGR1_MEM_MODE_SHIFT)
69
70
#define SYSCFG_CFGR1_UFB (1<<3)
71
72
#define SYSCFG_CFGR1_BOOT_MODE_SHIFT 8
73
#define SYSCFG_CFGR1_BOOT_MODE (3 << SYSCFG_CFGR1_BOOT_MODE_SHIFT)
74
#define SYSCFG_CFGR1_BOOT_MODE_FLASH (0 << SYSCFG_CFGR1_BOOT_MODE_SHIFT)
75
#define SYSCFG_CFGR1_BOOT_MODE_SYSTEM (1 << SYSCFG_CFGR1_BOOT_MODE_SHIFT)
76
#define SYSCFG_CFGR1_BOOT_MODE_SRAM (3 << SYSCFG_CFGR1_BOOT_MODE_SHIFT)
77
78
/* SYSCFG_CFGR2 Values -- ---------------------------------------------------*/
79
80
#define SYSCFG_CFGR2_FWDIS (1 << 0)
81
82
#define SYSCFG_CFGR2_I2C_PB6_FMP (1 << 8)
83
#define SYSCFG_CFGR2_I2C_PB7_FMP (1 << 9)
84
#define SYSCFG_CFGR2_I2C_PB8_FMP (1 << 10)
85
#define SYSCFG_CFGR2_I2C_PB9_FMP (1 << 11)
86
87
#define SYSCFG_CFGR2_I2C1_FMP (1 << 12)
88
#define SYSCFG_CFGR2_I2C2_FMP (1 << 13)
89
#define SYSCFG_CFGR2_I2C3_FMP (1 << 14)
90
91
/* REF_CFGR3 Values -- ---------------------------------------------------*/
92
93
#define SYSCFG_CFGR3_EN_VREFINT (1 << 0)
94
95
#define SYSCFG_CFGR3_SEL_VREF_OUT_SHIFT 4
96
#define SYSCFG_CFGR3_SEL_VREF_OUT (3 << SYSCFG_CFGR3_EN_VREFINT_SHIFT)
97
#define SYSCFG_CFGR3_SEL_VREF_OUT_PB0 (1 << SYSCFG_CFGR3_EN_VREFINT_SHIFT)
98
#define SYSCFG_CFGR3_SEL_VREF_OUT_PB1 (2 << SYSCFG_CFGR3_EN_VREFINT_SHIFT)
99
100
#define SYSCFG_CFGR3_ENBUF_VREFINT_ADC (1 << 8)
101
#define SYSCFG_CFGR3_ENBUF_SENSOR_ADC (1 << 9)
102
#define SYSCFG_CFGR3_ENBUF_VREFINT_COMP (1 << 12)
103
#define SYSCFG_CFGR3_ENREF_HSI48 (1 << 13)
104
105
#define SYSCFG_CFGR3_REF_HSI48_RDYF (1 << 26)
106
#define SYSCFG_CFGR3_SENSOR_ADC_RDYF (1 << 27)
107
#define SYSCFG_CFGR3_VREFINT_ADC_RDYF (1 << 28)
108
#define SYSCFG_CFGR3_VREFINT_COMP_RDYF (1 << 29)
109
#define SYSCFG_CFGR3_VREFINT_RDYF (1 << 30)
110
#define SYSCFG_CFGR3_REF_LOCK (1 << 31)
111
112
/* SYSCFG_EXTICR Values -- --------------------------------------------------*/
113
114
#define SYSCFG_EXTICR_FIELDSIZE 4
115
#define SYSCFG_EXTICR_GPIOA 0
116
#define SYSCFG_EXTICR_GPIOB 1
117
#define SYSCFG_EXTICR_GPIOC 2
118
#define SYSCFG_EXTICR_GPIOD 3
119
#define SYSCFG_EXTICR_GPIOE 4
120
#define SYSCFG_EXTICR_GPIOH 5
121
122
/*****************************************************************************/
123
/* API definitions */
124
/*****************************************************************************/
125
126
/*****************************************************************************/
127
/* API Functions */
128
/*****************************************************************************/
129
130
BEGIN_DECLS
131
132
END_DECLS
133
/**@}*/
134
135
#endif
END_DECLS
#define END_DECLS
Definition:
common.h:34
BEGIN_DECLS
#define BEGIN_DECLS
Definition:
common.h:33
include
libopencm3
stm32
l0
syscfg.h
Generated on Tue Mar 7 2023 16:12:00 for libopencm3 by
1.9.4