2015-04-16 08:33:35 +02:00
|
|
|
/*
|
2015-06-03 18:22:24 +02:00
|
|
|
* Copyright (C) 2014-2015 Freie Universität Berlin
|
2015-04-16 08:33:35 +02:00
|
|
|
* 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
* 2015 FreshTemp, LLC.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2017-08-31 21:59:33 +02:00
|
|
|
* @ingroup cpu_sam0_common
|
2017-06-22 15:43:17 +02:00
|
|
|
* @ingroup drivers_periph_gpio
|
2015-04-16 08:33:35 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file gpio.c
|
|
|
|
* @brief Low-level GPIO driver implementation
|
|
|
|
*
|
|
|
|
* @author Troels Hoffmeyer <troels.d.hoffmeyer@gmail.com>
|
|
|
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
2015-06-03 18:22:24 +02:00
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
2015-04-16 08:33:35 +02:00
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cpu.h"
|
2016-12-15 11:59:22 +01:00
|
|
|
#include "periph/gpio.h"
|
2017-08-31 21:59:33 +02:00
|
|
|
#include "periph_conf.h"
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
#define ENABLE_DEBUG (0)
|
2015-04-16 08:33:35 +02:00
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
/**
|
2018-09-21 08:19:31 +02:00
|
|
|
* @brief Mask to get PINCFG reg value from mode value
|
2015-04-16 08:33:35 +02:00
|
|
|
*/
|
2018-09-21 08:19:31 +02:00
|
|
|
#define MODE_PINCFG_MASK (0x06)
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2020-06-19 12:35:04 +02:00
|
|
|
/**
|
|
|
|
* @brief The GCLK used for clocking EXTI
|
|
|
|
*/
|
|
|
|
#ifndef CONFIG_SAM0_GCLK_GPIO
|
|
|
|
#define CONFIG_SAM0_GCLK_GPIO (SAM0_GCLK_MAIN)
|
|
|
|
#endif
|
|
|
|
|
2018-09-21 08:19:31 +02:00
|
|
|
#ifdef MODULE_PERIPH_GPIO_IRQ
|
2019-01-21 17:06:58 +01:00
|
|
|
|
2016-02-20 15:45:23 +01:00
|
|
|
/**
|
2018-09-21 08:19:31 +02:00
|
|
|
* @brief Number of external interrupt lines
|
2016-02-20 15:45:23 +01:00
|
|
|
*/
|
2019-01-21 17:06:58 +01:00
|
|
|
#ifdef CPU_SAML1X
|
|
|
|
#define NUMOF_IRQS (8U)
|
|
|
|
#else
|
2018-09-21 08:19:31 +02:00
|
|
|
#define NUMOF_IRQS (16U)
|
2019-01-21 17:06:58 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief External Interrupts Controller selection macros
|
|
|
|
*/
|
|
|
|
#ifdef CPU_FAM_SAML11
|
|
|
|
#define _EIC EIC_SEC
|
|
|
|
#else
|
|
|
|
#define _EIC EIC
|
|
|
|
#endif
|
2016-02-20 15:45:23 +01:00
|
|
|
|
2020-02-21 16:25:45 +01:00
|
|
|
/**
|
|
|
|
* @brief Clock source for the External Interrupt Controller
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
_EIC_CLOCK_FAST,
|
|
|
|
_EIC_CLOCK_SLOW
|
|
|
|
} gpio_eic_clock_t;
|
|
|
|
|
2016-01-27 17:00:37 +01:00
|
|
|
static gpio_isr_ctx_t gpio_config[NUMOF_IRQS];
|
2018-10-09 14:59:17 +02:00
|
|
|
#endif /* MODULE_PERIPH_GPIO_IRQ */
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
static inline PortGroup *_port(gpio_t pin)
|
|
|
|
{
|
|
|
|
return (PortGroup *)(pin & ~(0x1f));
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
2015-06-03 18:22:24 +02:00
|
|
|
|
|
|
|
static inline int _pin_pos(gpio_t pin)
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2015-06-03 18:22:24 +02:00
|
|
|
return (pin & 0x1f);
|
|
|
|
}
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
static inline int _pin_mask(gpio_t pin)
|
|
|
|
{
|
|
|
|
return (1 << _pin_pos(pin));
|
|
|
|
}
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
void gpio_init_mux(gpio_t pin, gpio_mux_t mux)
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2015-06-03 18:22:24 +02:00
|
|
|
PortGroup* port = _port(pin);
|
|
|
|
int pin_pos = _pin_pos(pin);
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
port->PINCFG[pin_pos].reg |= PORT_PINCFG_PMUXEN;
|
|
|
|
port->PMUX[pin_pos >> 1].reg &= ~(0xf << (4 * (pin_pos & 0x1)));
|
|
|
|
port->PMUX[pin_pos >> 1].reg |= (mux << (4 * (pin_pos & 0x1)));
|
|
|
|
}
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2020-02-21 15:20:24 +01:00
|
|
|
void gpio_disable_mux(gpio_t pin)
|
|
|
|
{
|
|
|
|
PortGroup* port = _port(pin);
|
|
|
|
int pin_pos = _pin_pos(pin);
|
|
|
|
|
|
|
|
port->PINCFG[pin_pos].reg &= ~PORT_PINCFG_PMUXEN;
|
|
|
|
}
|
|
|
|
|
2016-02-20 15:45:23 +01:00
|
|
|
int gpio_init(gpio_t pin, gpio_mode_t mode)
|
2015-06-03 18:22:24 +02:00
|
|
|
{
|
|
|
|
PortGroup* port = _port(pin);
|
|
|
|
int pin_pos = _pin_pos(pin);
|
|
|
|
int pin_mask = _pin_mask(pin);
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2016-02-20 15:45:23 +01:00
|
|
|
/* make sure pin mode is applicable */
|
|
|
|
if (mode > 0x7) {
|
|
|
|
return -1;
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
2016-02-20 15:45:23 +01:00
|
|
|
|
|
|
|
/* set pin direction */
|
|
|
|
if (mode & 0x2) {
|
|
|
|
port->DIRCLR.reg = pin_mask;
|
2015-06-03 18:22:24 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-02-20 15:45:23 +01:00
|
|
|
port->DIRSET.reg = pin_mask;
|
2015-06-03 18:22:24 +02:00
|
|
|
}
|
2016-02-20 15:45:23 +01:00
|
|
|
|
2017-06-12 17:17:44 +02:00
|
|
|
/* configure the pin cfg */
|
2016-02-20 15:45:23 +01:00
|
|
|
port->PINCFG[pin_pos].reg = (mode & MODE_PINCFG_MASK);
|
|
|
|
|
|
|
|
/* and set pull-up/pull-down if applicable */
|
2017-11-10 10:43:40 +01:00
|
|
|
if (mode == GPIO_IN_PU) {
|
2016-02-20 15:45:23 +01:00
|
|
|
port->OUTSET.reg = pin_mask;
|
|
|
|
}
|
2017-11-10 10:43:40 +01:00
|
|
|
else if (mode == GPIO_IN_PD) {
|
|
|
|
port->OUTCLR.reg = pin_mask;
|
|
|
|
}
|
2016-02-20 15:45:23 +01:00
|
|
|
|
2015-04-16 08:33:35 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-21 08:19:31 +02:00
|
|
|
int gpio_read(gpio_t pin)
|
|
|
|
{
|
|
|
|
PortGroup *port = _port(pin);
|
|
|
|
int mask = _pin_mask(pin);
|
|
|
|
|
|
|
|
if (port->DIR.reg & mask) {
|
|
|
|
return (port->OUT.reg & mask) ? 1 : 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return (port->IN.reg & mask) ? 1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_set(gpio_t pin)
|
|
|
|
{
|
|
|
|
_port(pin)->OUTSET.reg = _pin_mask(pin);
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_clear(gpio_t pin)
|
|
|
|
{
|
|
|
|
_port(pin)->OUTCLR.reg = _pin_mask(pin);
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_toggle(gpio_t pin)
|
|
|
|
{
|
|
|
|
_port(pin)->OUTTGL.reg = _pin_mask(pin);
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_write(gpio_t pin, int value)
|
|
|
|
{
|
|
|
|
if (value) {
|
|
|
|
_port(pin)->OUTSET.reg = _pin_mask(pin);
|
|
|
|
} else {
|
|
|
|
_port(pin)->OUTCLR.reg = _pin_mask(pin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MODULE_PERIPH_GPIO_IRQ
|
2020-02-21 16:25:45 +01:00
|
|
|
|
|
|
|
#ifdef CPU_FAM_SAMD21
|
|
|
|
#define EIC_SYNC() while (_EIC->STATUS.bit.SYNCBUSY)
|
|
|
|
#else
|
|
|
|
#define EIC_SYNC() while (_EIC->SYNCBUSY.bit.ENABLE)
|
|
|
|
#endif
|
|
|
|
|
2018-09-21 08:19:31 +02:00
|
|
|
static int _exti(gpio_t pin)
|
|
|
|
{
|
2019-08-29 15:27:42 +02:00
|
|
|
unsigned port_num = ((pin >> 7) & 0x03);
|
2018-09-21 08:19:31 +02:00
|
|
|
|
2019-08-29 15:27:42 +02:00
|
|
|
if (port_num >= ARRAY_SIZE(exti_config)) {
|
2018-09-21 08:19:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return exti_config[port_num][_pin_pos(pin)];
|
|
|
|
}
|
|
|
|
|
2016-02-20 15:45:23 +01:00
|
|
|
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
|
2015-06-03 18:22:24 +02:00
|
|
|
gpio_cb_t cb, void *arg)
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2015-06-03 18:22:24 +02:00
|
|
|
int exti = _exti(pin);
|
2015-04-16 08:33:35 +02:00
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
/* make sure EIC channel is valid */
|
|
|
|
if (exti == -1) {
|
2015-04-16 08:33:35 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
/* save callback */
|
|
|
|
gpio_config[exti].cb = cb;
|
|
|
|
gpio_config[exti].arg = arg;
|
2015-10-31 17:35:41 +01:00
|
|
|
/* configure pin as input and set MUX to peripheral function A */
|
2016-02-20 15:45:23 +01:00
|
|
|
gpio_init(pin, mode);
|
2015-06-03 18:22:24 +02:00
|
|
|
gpio_init_mux(pin, GPIO_MUX_A);
|
2017-08-31 21:59:33 +02:00
|
|
|
#ifdef CPU_FAM_SAMD21
|
|
|
|
/* enable clocks for the EIC module */
|
|
|
|
PM->APBAMASK.reg |= PM_APBAMASK_EIC;
|
2020-02-21 14:25:43 +01:00
|
|
|
GCLK->CLKCTRL.reg = EIC_GCLK_ID
|
|
|
|
| GCLK_CLKCTRL_CLKEN
|
2020-06-19 12:35:04 +02:00
|
|
|
| GCLK_CLKCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
|
2017-08-31 21:59:33 +02:00
|
|
|
while (GCLK->STATUS.bit.SYNCBUSY) {}
|
|
|
|
#else /* CPU_FAM_SAML21 */
|
2015-06-03 18:22:24 +02:00
|
|
|
/* enable clocks for the EIC module */
|
2015-04-16 08:33:35 +02:00
|
|
|
MCLK->APBAMASK.reg |= MCLK_APBAMASK_EIC;
|
2020-06-19 12:35:04 +02:00
|
|
|
GCLK->PCHCTRL[EIC_GCLK_ID].reg = GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
|
2017-04-19 12:43:09 +02:00
|
|
|
/* disable the EIC module*/
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->CTRLA.reg = 0;
|
2020-02-21 16:25:45 +01:00
|
|
|
EIC_SYNC();
|
2017-08-31 21:59:33 +02:00
|
|
|
#endif
|
2015-06-03 18:22:24 +02:00
|
|
|
/* configure the active flank */
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->CONFIG[exti >> 3].reg &= ~(0xf << ((exti & 0x7) * 4));
|
|
|
|
_EIC->CONFIG[exti >> 3].reg |= (flank << ((exti & 0x7) * 4));
|
2015-06-03 18:22:24 +02:00
|
|
|
/* enable the global EIC interrupt */
|
2019-01-21 17:06:58 +01:00
|
|
|
#ifdef CPU_SAML1X
|
|
|
|
/* EXTI[4..7] are binded to EIC_OTHER_IRQn */
|
|
|
|
NVIC_EnableIRQ((exti > 3 )? EIC_OTHER_IRQn : (EIC_0_IRQn + exti));
|
2019-03-12 13:57:27 +01:00
|
|
|
#elif defined(CPU_SAMD5X)
|
|
|
|
NVIC_EnableIRQ(EIC_0_IRQn + exti);
|
2019-01-21 17:06:58 +01:00
|
|
|
#else
|
2015-04-16 08:33:35 +02:00
|
|
|
NVIC_EnableIRQ(EIC_IRQn);
|
2019-01-21 17:06:58 +01:00
|
|
|
#endif
|
2017-08-31 21:59:33 +02:00
|
|
|
/* clear interrupt flag and enable the interrupt line and line wakeup */
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->INTFLAG.reg = (1 << exti);
|
|
|
|
_EIC->INTENSET.reg = (1 << exti);
|
2017-08-31 21:59:33 +02:00
|
|
|
#ifdef CPU_FAM_SAMD21
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->WAKEUP.reg |= (1 << exti);
|
2017-08-31 21:59:33 +02:00
|
|
|
/* enable the EIC module*/
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->CTRL.reg = EIC_CTRL_ENABLE;
|
2020-02-21 16:25:45 +01:00
|
|
|
EIC_SYNC();
|
2017-08-31 21:59:33 +02:00
|
|
|
#else /* CPU_FAM_SAML21 */
|
2015-06-03 18:22:24 +02:00
|
|
|
/* enable the EIC module*/
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->CTRLA.reg = EIC_CTRLA_ENABLE;
|
2020-02-21 16:25:45 +01:00
|
|
|
EIC_SYNC();
|
2017-08-31 21:59:33 +02:00
|
|
|
#endif
|
2015-04-16 08:33:35 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-02-21 16:25:45 +01:00
|
|
|
inline static void reenable_eic(gpio_eic_clock_t clock) {
|
2020-02-21 18:05:35 +01:00
|
|
|
#if defined(CPU_SAMD21)
|
|
|
|
if (clock == _EIC_CLOCK_SLOW) {
|
|
|
|
GCLK->CLKCTRL.reg = EIC_GCLK_ID
|
|
|
|
| GCLK_CLKCTRL_CLKEN
|
|
|
|
| GCLK_CLKCTRL_GEN(SAM0_GCLK_32KHZ);
|
|
|
|
} else {
|
|
|
|
GCLK->CLKCTRL.reg = EIC_GCLK_ID
|
|
|
|
| GCLK_CLKCTRL_CLKEN
|
2020-06-19 12:35:04 +02:00
|
|
|
| GCLK_CLKCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
|
2020-02-21 18:05:35 +01:00
|
|
|
}
|
|
|
|
while (GCLK->STATUS.bit.SYNCBUSY) {}
|
|
|
|
#else
|
2020-02-21 16:25:45 +01:00
|
|
|
uint32_t ctrla_reg = EIC_CTRLA_ENABLE;
|
|
|
|
|
|
|
|
EIC->CTRLA.reg = 0;
|
|
|
|
EIC_SYNC();
|
|
|
|
|
|
|
|
if (clock == _EIC_CLOCK_SLOW) {
|
|
|
|
ctrla_reg |= EIC_CTRLA_CKSEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EIC->CTRLA.reg = ctrla_reg;
|
|
|
|
EIC_SYNC();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_pm_cb_enter(int deep)
|
|
|
|
{
|
|
|
|
#if defined(PM_SLEEPCFG_SLEEPMODE_STANDBY)
|
|
|
|
(void) deep;
|
|
|
|
|
|
|
|
if (PM->SLEEPCFG.bit.SLEEPMODE == PM_SLEEPCFG_SLEEPMODE_STANDBY) {
|
|
|
|
DEBUG_PUTS("gpio: switching EIC to slow clock");
|
|
|
|
reenable_eic(_EIC_CLOCK_SLOW);
|
|
|
|
}
|
2020-02-21 18:05:35 +01:00
|
|
|
#else
|
|
|
|
if (deep) {
|
|
|
|
DEBUG_PUTS("gpio: switching EIC to slow clock");
|
|
|
|
reenable_eic(_EIC_CLOCK_SLOW);
|
|
|
|
}
|
2020-02-21 16:25:45 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_pm_cb_leave(int deep)
|
|
|
|
{
|
|
|
|
#if defined(PM_SLEEPCFG_SLEEPMODE_STANDBY)
|
|
|
|
(void) deep;
|
|
|
|
|
|
|
|
if (PM->SLEEPCFG.bit.SLEEPMODE == PM_SLEEPCFG_SLEEPMODE_STANDBY) {
|
|
|
|
DEBUG_PUTS("gpio: switching EIC to fast clock");
|
|
|
|
reenable_eic(_EIC_CLOCK_FAST);
|
|
|
|
}
|
2020-02-21 18:05:35 +01:00
|
|
|
#else
|
|
|
|
if (deep) {
|
|
|
|
DEBUG_PUTS("gpio: switching EIC to fast clock");
|
|
|
|
reenable_eic(_EIC_CLOCK_FAST);
|
|
|
|
}
|
2020-02-21 16:25:45 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
void gpio_irq_enable(gpio_t pin)
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2015-06-03 18:22:24 +02:00
|
|
|
int exti = _exti(pin);
|
|
|
|
if (exti == -1) {
|
|
|
|
return;
|
|
|
|
}
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->INTENSET.reg = (1 << exti);
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
|
|
|
|
2015-06-03 18:22:24 +02:00
|
|
|
void gpio_irq_disable(gpio_t pin)
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2015-06-03 18:22:24 +02:00
|
|
|
int exti = _exti(pin);
|
|
|
|
if (exti == -1) {
|
|
|
|
return;
|
|
|
|
}
|
2019-01-21 17:06:58 +01:00
|
|
|
_EIC->INTENCLR.reg = (1 << exti);
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
|
|
|
|
2020-03-09 18:35:29 +01:00
|
|
|
#if defined(CPU_SAML1X)
|
|
|
|
void isr_eic_other(void)
|
|
|
|
#else
|
2015-04-16 08:33:35 +02:00
|
|
|
void isr_eic(void)
|
2020-03-09 18:35:29 +01:00
|
|
|
#endif
|
2015-04-16 08:33:35 +02:00
|
|
|
{
|
2020-03-09 18:34:06 +01:00
|
|
|
/* read & clear interrupt flags */
|
|
|
|
uint32_t state = _EIC->INTFLAG.reg;
|
|
|
|
state &= (1 << NUMOF_IRQS) - 1;
|
|
|
|
_EIC->INTFLAG.reg = state;
|
|
|
|
|
|
|
|
/* execute interrupt callbacks */
|
|
|
|
while (state) {
|
|
|
|
unsigned pin = 8 * sizeof(state) - __builtin_clz(state) - 1;
|
|
|
|
state &= ~(1 << pin);
|
|
|
|
gpio_config[pin].cb(gpio_config[pin].arg);
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
2020-03-09 18:34:06 +01:00
|
|
|
|
2016-11-30 18:26:05 +01:00
|
|
|
cortexm_isr_end();
|
2015-04-16 08:33:35 +02:00
|
|
|
}
|
2019-01-21 17:06:58 +01:00
|
|
|
|
2019-03-12 13:57:27 +01:00
|
|
|
#if defined(CPU_SAML1X) || defined(CPU_SAMD5X)
|
2019-01-21 17:06:58 +01:00
|
|
|
|
2019-03-12 13:57:27 +01:00
|
|
|
#define ISR_EICn(n) \
|
|
|
|
void isr_eic ## n (void) \
|
|
|
|
{ \
|
2020-03-09 18:35:29 +01:00
|
|
|
_EIC->INTFLAG.reg = 1 << n; \
|
|
|
|
gpio_config[n].cb(gpio_config[n].arg); \
|
|
|
|
cortexm_isr_end(); \
|
2019-01-21 17:06:58 +01:00
|
|
|
}
|
|
|
|
|
2019-03-12 13:57:27 +01:00
|
|
|
ISR_EICn(0)
|
|
|
|
ISR_EICn(1)
|
|
|
|
ISR_EICn(2)
|
|
|
|
ISR_EICn(3)
|
|
|
|
#if defined(CPU_SAMD5X)
|
|
|
|
ISR_EICn(4)
|
|
|
|
ISR_EICn(5)
|
|
|
|
ISR_EICn(6)
|
|
|
|
ISR_EICn(7)
|
2020-03-09 18:35:29 +01:00
|
|
|
#if (NUMOF_IRQS > 8)
|
2019-03-12 13:57:27 +01:00
|
|
|
ISR_EICn(8)
|
|
|
|
ISR_EICn(9)
|
|
|
|
ISR_EICn(10)
|
|
|
|
ISR_EICn(11)
|
|
|
|
ISR_EICn(12)
|
|
|
|
ISR_EICn(13)
|
|
|
|
ISR_EICn(14)
|
|
|
|
ISR_EICn(15)
|
2020-03-09 18:35:29 +01:00
|
|
|
#endif /* NUMOF_IRQS > 8 */
|
|
|
|
#endif /* CPU_SAMD5X */
|
2019-03-12 13:57:27 +01:00
|
|
|
#endif /* CPU_SAML1X || CPU_SAMD5X */
|
2019-01-21 17:06:58 +01:00
|
|
|
|
2020-02-21 16:25:45 +01:00
|
|
|
#else /* MODULE_PERIPH_GPIO_IRQ */
|
|
|
|
|
|
|
|
void gpio_pm_cb_enter(int deep)
|
|
|
|
{
|
|
|
|
(void) deep;
|
|
|
|
}
|
|
|
|
|
|
|
|
void gpio_pm_cb_leave(int deep)
|
|
|
|
{
|
|
|
|
(void) deep;
|
|
|
|
}
|
|
|
|
|
2018-10-09 14:59:17 +02:00
|
|
|
#endif /* MODULE_PERIPH_GPIO_IRQ */
|