4462069d74
This adds interrupt support to the SAM0 GPIO driver. This is heavily inspired by @nzmichaelh work in #5715. The primary difference from that implementation is that here the External Interrupt Controller (EIC) is separated out into an interrupt controller driver that is less tightly coupled to the GPIO API. Instead it implements more of a conversion from the EIC's own odd multiplexing to a more traditional port and pin mask IRQ-like callback. Unfortunately, through the EIC on the SAMD2x are relatively well behaved in terms of pin to EIC line mappings, other chips that share the peripheral interface are not. So the EIC driver implements a per-line lookup to the pin and port pair using definitions extracted from the ASF headers. The EIC driver still makes some assumptions about how it will be used: mostly it assumes exactly one callback per port. This should be fine as the only intended user is the GPIO driver itself. This has been tested with some simple programs and with tests/drivers/gpio/gpio_basic_api on a SAMD21 breakout and an adafruit_trinket_m0 board. Signed-off-by: Derek Hageman <hageman@inthat.cloud>
18 lines
387 B
Plaintext
18 lines
387 B
Plaintext
# Kconfig - SAM0 EIC configuration
|
|
#
|
|
# Copyright (c) 2019 Derek Hageman <hageman@inthat.cloud>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
if SOC_FAMILY_SAM0
|
|
|
|
config SAM0_EIC
|
|
bool "External Interrupt Controller (EIC) Driver for SAM0 series devices"
|
|
default y
|
|
help
|
|
Enable EIC driver for SAM0 series of devices. This is required for
|
|
GPIO interrupt support.
|
|
|
|
endif # SOC_FAMILY_SAM0
|