Added Exti support

This commit is contained in:
Mateusz Myalski
2024-10-20 12:58:33 +02:00
committed by Piotr Esden-Tempski
parent 3f5e250f42
commit ab284959f3
4 changed files with 62 additions and 3 deletions

View File

@@ -40,6 +40,8 @@
# include <libopencm3/stm32/l1/exti.h>
#elif defined(STM32L4)
# include <libopencm3/stm32/l4/exti.h>
#elif defined(STM32U5)
# include <libopencm3/stm32/u5/exti.h>
#elif defined(STM32G0)
# include <libopencm3/stm32/g0/exti.h>
#elif defined(STM32H7)

View File

@@ -0,0 +1,56 @@
/** @defgroup exti_defines EXTI Defines
*
* @brief <b>Defined Constants and Types for the STM32U5xx External Interrupts
* </b>
*
* @ingroup STM32U5xx_defines
*
* @version 1.0.0
*
* @date 20 October 2024
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
* Copyright (C) 2013 Frantisek Burian <BuFran@seznam.cz>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_EXTI_H
#define LIBOPENCM3_EXTI_H
/**@{*/
#include <libopencm3/stm32/common/exti_common_all.h>
#include <libopencm3/stm32/common/exti_common_v2.h>
/** EXTI External Interrupt Selection Registers */
#define EXTI_EXTICR(i) MMIO32(EXTI_BASE + 0x60 + (i)*4)
#define EXTI_EXTICR1 MMIO32(EXTI_BASE + 0x60)
#define EXTI_EXTICR2 MMIO32(EXTI_BASE + 0x64)
#define EXTI_EXTICR3 MMIO32(EXTI_BASE + 0x68)
#define EXTI_EXTICR4 MMIO32(EXTI_BASE + 0x6c)
/** EXTI Rising Edge Pending Register */
#define EXTI_RPR1 MMIO32(EXTI_BASE + 0x0c)
/** EXTI Falling Edge Pending Register */
#define EXTI_FPR1 MMIO32(EXTI_BASE + 0x10)
/**@}*/
#endif

View File

@@ -158,7 +158,7 @@
/* PERIPH_BASE_AHB2 + 0xC800 (0x4202 C800 - 0x4203 FFFF): Reserved */
#define OTG_FS_BASE (PERIPH_BASE_AHB2 + 0x20000U)
#define OTG_HS_BASE (PERIPH_BASE_AHB2 + 0x20000U)
#define AES AES_BASE (PERIPH_BASE_AHB2 + 0xA0000U)
#define AES_BASE (PERIPH_BASE_AHB2 + 0xA0000U)
#define HASH_BASE (PERIPH_BASE_AHB2 + 0xA0400U)
#define RNG_BASE (PERIPH_BASE_AHB2 + 0xA0800U)
#define SAES_BASE (PERIPH_BASE_AHB2 + 0xA0C00U)
@@ -190,7 +190,7 @@
#define SYSCFG_BASE (PERIPH_BASE_APB3 + 0x0000U)
/* PERIPH_BASE_APB3 + 0x0400 (0x4600 0800 - 0x4600 1FFF): Reserved */
#define SPI3_BASE (PERIPH_BASE_APB3 + 0x1C00U)
#define LPUART1_BASE PERIPH_BASE_APB3 + 0x2000U)
#define LPUART1_BASE (PERIPH_BASE_APB3 + 0x2000U)
#define I2C3_BASE (PERIPH_BASE_APB3 + 0x2400U)
/* PERIPH_BASE_APB3 + 0x2800 (0x4600 2C00 - 0x4600 43FF): Reserved */
#define LPTIM1_BASE (PERIPH_BASE_APB3 + 0x4000U)
@@ -212,7 +212,7 @@
#define ADC4_BASE (PERIPH_BASE_AHB3 + 0x1000U)
/* PERIPH_BASE_AHB3 + 0x1400 (0x4602 1400 - 0x4602 17FF): Reserved */
#define DAC1_BASE (PERIPH_BASE_AHB3 + 0x1800U)
/* PERIPH_BASE_AHB3 + 0x1C00 ( 0x4602 1C00 - 0x4602 1FFF): Reserved */
/* PERIPH_BASE_AHB3 + 0x1C00 (0x4602 1C00 - 0x4602 1FFF): Reserved */
#define EXTI_BASE (PERIPH_BASE_AHB3 + 0x2000U)
/* PERIPH_BASE_AHB3 + 0x2400 (0x4602 2400 - 0x4602 2FFF): Reserved */
#define GTZC2_TZSC_BASE (PERIPH_BASE_AHB3 + 0x3000U)