libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
exti_common_v2.h
Go to the documentation of this file.
1/** @addtogroup exti_defines
2 *
3 * @author @htmlonly &copy; @endhtmlonly 2019 Guillaume Revaillot <g.revaillot@gmail.com>
4 *
5 */
6/*
7 * This file is part of the libopencm3 project.
8 *
9 * Copyright (C) 2019 Guillaume Revaillot <g.revaillot@gmail.com>
10 *
11 * This library is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this library. If not, see <http://www.gnu.org/licenses/>.
23 */
24
25/**@{*/
26
27/** @cond */
28#if defined(LIBOPENCM3_EXTI_H)
29/** @endcond */
30#ifndef LIBOPENCM3_EXTI_COMMON_V2_H
31#define LIBOPENCM3_EXTI_COMMON_V2_H
32
33/* --- EXTI registers ------------------------------------------------------ */
34
35/** @defgroup exti_registers EXTI Registers
36@{*/
37/** EXTI Rising Trigger Selection Register 1 */
38#define EXTI_RTSR1 MMIO32(EXTI_BASE + 0x00)
39#define EXTI_RTSR EXTI_RTSR1
40
41/** EXTI Falling Trigger Selection Register 1 */
42#define EXTI_FTSR1 MMIO32(EXTI_BASE + 0x04)
43#define EXTI_FTSR EXTI_FTSR1
44
45/** EXTI Software Interrupt Event Register */
46#define EXTI_SWIER1 MMIO32(EXTI_BASE + 0x08)
47
48/** EXTI Interrupt Mask Registers 1 */
49#define EXTI_IMR1 MMIO32(EXTI_BASE + 0x80)
50#define EXTI_IMR EXTI_IMR1
51
52/** EXTI Event Mask Registers 1 */
53#define EXTI_EMR1 MMIO32(EXTI_BASE + 0x84)
54#define EXTI_EMR EXTI_EMR1
55
56/** EXTI Interrupt Mask Registers 2 */
57#define EXTI_IMR2 MMIO32(EXTI_BASE + 0x90)
58/** EXTI Event Mask Registers 2 */
59#define EXTI_EMR2 MMIO32(EXTI_BASE + 0x94)
60/**@}*/
61
62/* --- EXTI_EXTICR Values -------------------------------------------------*/
63
64#define EXTI_EXTICR_FIELDSIZE 8
65#define EXTI_EXTICR_GPIOA 0
66#define EXTI_EXTICR_GPIOB 1
67#define EXTI_EXTICR_GPIOC 2
68#define EXTI_EXTICR_GPIOD 3
69#define EXTI_EXTICR_GPIOE 4
70#define EXTI_EXTICR_GPIOF 5
71#define EXTI_EXTICR_GPIOG 6
72#define EXTI_EXTICR_GPIOH 7
73
75
76uint32_t exti_get_rising_flag_status(uint32_t exti);
77uint32_t exti_get_falling_flag_status(uint32_t exti);
78
79void exti_reset_rising_request(uint32_t extis);
80void exti_reset_falling_request(uint32_t extis);
81
83
84#endif
85/** @cond */
86#else
87#warning "exti_common_v2.h should not be included directly, only via exti.h"
88#endif
89/** @endcond */
90
91/**@}*/
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void exti_reset_falling_request(uint32_t extis)
uint32_t exti_get_rising_flag_status(uint32_t exti)
void exti_reset_rising_request(uint32_t extis)
uint32_t exti_get_falling_flag_status(uint32_t exti)