f55a2879ca
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. |
||
---|---|---|
.. | ||
configs | ||
include | ||
scripts | ||
src | ||
Kconfig | ||
README.txt |
nRF52840-DK =========== README for NuttX port to NRF52840-DK (PCA10056) boards. Status ====== Only the basic NSH configuration is supported for now.