nuttx/boards/arm
Matias N f55a2879ca nrf52 GPIO/GPIOTE: better expose pin interrupt capability
This change improves upon current support for pin interrupts. Before,
a pin interrupt was handled (with nrf52_gpiote_setevent) using one
of the eight available GPIOTE channels. Moreover, it didn't event let
the user specify which channel to use (simply tried to get a free one).
Also, it was buggy since it did not consider unsetting the callback.

Besides GPIOTE channels, there is another way to deal with pin interrupts.
The GPIO peripheral is capable of generating a PORT event
(for the whole GPIO port) depending on the pin SENSE configuration
(HIGH or LOW, or NONE) and GPIO DETECTMODE register
(latching or non-latching).

This change then renames nrf52_gpiote_setevent into nrf52_gpiote_set_ch_event,
maintaining functionality of original function, but now allows specifying
channel (and correctly handles unsetting the callback). Then, a
new nrf52_gpiote_set_pin_event is added, which allows to set a callback
for a given pin. During initialization, interrupt for the PORT event is
enabled and handled in such way that for each pin whose corresponding
bit in LATCH register (indicates the result of pin SENSEing) the
callback for this pin will be invoked. This mechanism means that
every pin can get an ISR. It also avoids using GPIOTE channels for this
purpose which carry higher current consumption.

This new per-pin callback mechanism has some added memory requirement
so it can be disabled and its default is dependant on DEFAULT_SMALL.
When disabled, a callback for the PORT event can be set directly
with nrf52_gpiote_set_port_event

There was only one use of nrf52_gpio_setevent() which was migrated
into nrf52_gpio_set_ch_event() passing channel zero.
2020-11-09 20:23:29 +01:00
..
a1x/pcduino-a10 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
am335x/beaglebone-black make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
c5471/c5471evm make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
cxd56xx make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
dm320/ntosd-dm320 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
efm32 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
eoss3/quickfeather make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
imx6/sabre-6quad make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
imxrt build: Move __NuttX__ definition to tools/Config.mk 2020-11-02 13:22:39 -03:00
kinetis make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
kl make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lc823450/lc823450-xgevk make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lpc17xx_40xx make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lpc31xx make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lpc43xx build: Move __NuttX__ definition to tools/Config.mk 2020-11-02 13:22:39 -03:00
lpc54xx/lpcxpresso-lpc54628 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lpc214x make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
lpc2378/olimex-lpc2378 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
max326xx/max32660-evsys make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
moxart/moxa make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
nrf52 nrf52 GPIO/GPIOTE: better expose pin interrupt capability 2020-11-09 20:23:29 +01:00
nuc1xx/nutiny-nuc120 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
s32k1xx make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
sam34 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
sama5 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
samd2l2 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
samd5e5 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
samv7 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
stm32 build: Move __NuttX__ definition to tools/Config.mk 2020-11-02 13:22:39 -03:00
stm32f0l0g0 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
stm32f7 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
stm32h7 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
stm32l4 Add fuction to set timer frequency. 2020-11-05 11:36:40 -03:00
str71x/olimex-strp711 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
tiva Added Support for more TI Tiva Microcontrollers: 2020-11-03 08:07:24 -08:00
tms570 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
xmc4 make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00