libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
exti_common_v2.c
Go to the documentation of this file.
1/** @addtogroup exti_file EXTI peripheral API
2 * @ingroup peripheral_apis
3 *
4 * @author @htmlonly &copy; @endhtmlonly 2019 Guillaume Revaillot <g.revaillot@gmail.com>
5 *
6 * @date 10 January 2019
7 *
8 * LGPL License Terms @ref lgpl_license
9 */
10/*
11 * This file is part of the libopencm3 project.
12 *
13 * This library is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU Lesser General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27/**@{*/
28
30
31/* @brief Get the rising edge interrupt requestf flag of a given EXTI interrupt.
32 *
33 * @param[in] exti unsigned int32 Exti line.
34 *
35 * */
36uint32_t exti_get_rising_flag_status(uint32_t exti)
37{
38 return (EXTI_RPR1 & exti);
39}
40
41/* @brief Get the rising edge interrupt request flag of a given EXTI interrupt.
42 *
43 * @param[in] exti unsigned int32 Exti line.
44 *
45 * */
46uint32_t exti_get_falling_flag_status(uint32_t exti)
47{
48 return (EXTI_FPR1 & exti);
49}
50
51/* @brief Resets the rising edge interrupt request pending flag of a given EXTI interrupt.
52 *
53 * @param[in] exti unsigned int32 Exti line.
54 *
55 * */
56void exti_reset_rising_request(uint32_t extis)
57{
58 EXTI_RPR1 = extis;
59}
60
61/* @brief Resets the falling edge interrupt request pending flag of a given EXTI interrupt.
62 *
63 * @param[in] exti unsigned int32 Exti line.
64 *
65 * */
66void exti_reset_falling_request(uint32_t extis)
67{
68 EXTI_FPR1 = extis;
69}
70
71/**@}*/
#define EXTI_FPR1
EXTI Falling Edge Pending Register.
Definition: g0/exti.h:45
#define EXTI_RPR1
EXTI Rising Edge Pending Register.
Definition: g0/exti.h:43
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)