From ecc3616b8ea766ba0c921681258463696ad47930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Mon, 21 Oct 2019 15:27:52 +0200 Subject: [PATCH] nrfx 1.8.1 release --- CHANGELOG.md | 9 +++++ drivers/include/nrfx_gpiote.h | 56 +++++++++++++++++++++++++++-- drivers/src/nrfx_gpiote.c | 51 ++++++++++++++++++-------- helpers/{nrfx_gppi => }/nrfx_gppi.h | 0 mdk/nrf.h | 2 +- mdk/nrf51.h | 6 ++-- mdk/nrf52.h | 6 ++-- mdk/nrf52805.h | 6 ++-- mdk/nrf52810.h | 6 ++-- mdk/nrf52811.h | 6 ++-- mdk/nrf52833.h | 6 ++-- mdk/nrf52840.h | 6 ++-- mdk/nrf9160.h | 6 ++-- templates/nRF52833/nrfx_config.h | 6 ++-- templates/nRF9160/nrfx_config.h | 16 +++++---- 15 files changed, 137 insertions(+), 51 deletions(-) rename helpers/{nrfx_gppi => }/nrfx_gppi.h (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a148f3340..2e63dde43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Changelog All notable changes to this project are documented in this file. +## [1.8.1] - 2019-10-21 +### Added +- Added functions in the GPIOTE driver for getting task or event for the specified GPIO pin. + +### Changed +- Updated MDK to version 8.27.1. +- Moved the nrfx_gppi helper from helpers/nrfx_gppi/ to helpers/. +- Changed the interrupt initialization in the GPIOTE driver, so that mapping of the GPIOTEx_IRQn enumeration values is no longer needed for nRF9160. + ## [1.8.0] - 2019-08-27 ### Added - Added support for nRF52833. diff --git a/drivers/include/nrfx_gpiote.h b/drivers/include/nrfx_gpiote.h index 126f0f57c..2b953cdb2 100644 --- a/drivers/include/nrfx_gpiote.h +++ b/drivers/include/nrfx_gpiote.h @@ -285,7 +285,19 @@ void nrfx_gpiote_out_task_enable(nrfx_gpiote_pin_t pin); void nrfx_gpiote_out_task_disable(nrfx_gpiote_pin_t pin); /** - * @brief Function for getting the address of a configurable GPIOTE task. + * @brief Function for getting the OUT task for the specified output pin. + * + * @details The returned task identifier can be used within @ref nrf_gpiote_hal, + * for example, to configure a DPPI channel. + * + * @param[in] pin Pin. + * + * @return OUT task associated with the specified output pin. + */ +nrf_gpiote_tasks_t nrfx_gpiote_out_task_get(nrfx_gpiote_pin_t pin); + +/** + * @brief Function for getting the address of the OUT task for the specified output pin. * * @param[in] pin Pin. * @@ -295,7 +307,19 @@ uint32_t nrfx_gpiote_out_task_addr_get(nrfx_gpiote_pin_t pin); #if defined(GPIOTE_FEATURE_SET_PRESENT) || defined(__NRFX_DOXYGEN__) /** - * @brief Function for getting the address of a configurable GPIOTE task. + * @brief Function for getting the SET task for the specified output pin. + * + * @details The returned task identifier can be used within @ref nrf_gpiote_hal, + * for example, to configure a DPPI channel. + * + * @param[in] pin Pin. + * + * @return SET task associated with the specified output pin. + */ +nrf_gpiote_tasks_t nrfx_gpiote_set_task_get(nrfx_gpiote_pin_t pin); + +/** + * @brief Function for getting the address of the SET task for the specified output pin. * * @param[in] pin Pin. * @@ -306,7 +330,19 @@ uint32_t nrfx_gpiote_set_task_addr_get(nrfx_gpiote_pin_t pin); #if defined(GPIOTE_FEATURE_CLR_PRESENT) || defined(__NRFX_DOXYGEN__) /** - * @brief Function for getting the address of a configurable GPIOTE task. + * @brief Function for getting the CLR task for the specified output pin. + * + * @details The returned task identifier can be used within @ref nrf_gpiote_hal, + * for example, to configure a DPPI channel. + * + * @param[in] pin Pin. + * + * @return CLR task associated with the specified output pin. + */ +nrf_gpiote_tasks_t nrfx_gpiote_clr_task_get(nrfx_gpiote_pin_t pin); + +/** + * @brief Function for getting the address of the SET task for the specified output pin. * * @param[in] pin Pin. * @@ -379,6 +415,20 @@ void nrfx_gpiote_in_event_disable(nrfx_gpiote_pin_t pin); */ bool nrfx_gpiote_in_is_set(nrfx_gpiote_pin_t pin); +/** + * @brief Function for getting the GPIOTE event for the specified input pin. + * + * @details The returned event identifier can be used within @ref nrf_gpiote_hal, + * for example, to configure a DPPI channel. + * If the pin is configured to use low-accuracy mode, the PORT event + * is returned. + * + * @param[in] pin Pin. + * + * @return Event associated with the specified input pin. + */ +nrf_gpiote_events_t nrfx_gpiote_in_event_get(nrfx_gpiote_pin_t pin); + /** * @brief Function for getting the address of a GPIOTE input pin event. * @details If the pin is configured to use low-accuracy mode, the address of the PORT event is returned. diff --git a/drivers/src/nrfx_gpiote.c b/drivers/src/nrfx_gpiote.c index e68fdcb22..4269dc638 100644 --- a/drivers/src/nrfx_gpiote.c +++ b/drivers/src/nrfx_gpiote.c @@ -28,6 +28,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + #include #if NRFX_CHECK(NRFX_GPIOTE_ENABLED) @@ -246,8 +247,8 @@ nrfx_err_t nrfx_gpiote_init(void) memset(m_cb.configured_pins, 0, sizeof(m_cb.configured_pins)); - NRFX_IRQ_PRIORITY_SET(GPIOTE_IRQn, NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); - NRFX_IRQ_ENABLE(GPIOTE_IRQn); + NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number(NRF_GPIOTE), NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); + NRFX_IRQ_ENABLE(nrfx_get_irq_number(NRF_GPIOTE)); nrf_gpiote_event_clear(NRF_GPIOTE_EVENTS_PORT); nrf_gpiote_int_enable(GPIOTE_INTENSET_PORT_Msk); m_cb.state = NRFX_DRV_STATE_INITIALIZED; @@ -416,42 +417,58 @@ void nrfx_gpiote_out_task_disable(nrfx_gpiote_pin_t pin) } -uint32_t nrfx_gpiote_out_task_addr_get(nrfx_gpiote_pin_t pin) +nrf_gpiote_tasks_t nrfx_gpiote_out_task_get(nrfx_gpiote_pin_t pin) { NRFX_ASSERT(pin < NUMBER_OF_PINS); NRFX_ASSERT(pin_in_use_by_te(pin)); - nrf_gpiote_tasks_t task = TE_OUT_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); + return TE_OUT_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); +} + + +uint32_t nrfx_gpiote_out_task_addr_get(nrfx_gpiote_pin_t pin) +{ + nrf_gpiote_tasks_t task = nrfx_gpiote_out_task_get(pin); return nrf_gpiote_task_addr_get(task); } #if defined(GPIOTE_FEATURE_SET_PRESENT) -uint32_t nrfx_gpiote_set_task_addr_get(nrfx_gpiote_pin_t pin) +nrf_gpiote_tasks_t nrfx_gpiote_set_task_get(nrfx_gpiote_pin_t pin) { NRFX_ASSERT(pin < NUMBER_OF_PINS); NRFX_ASSERT(pin_in_use_by_te(pin)); - nrf_gpiote_tasks_t task = TE_SET_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); - return nrf_gpiote_task_addr_get(task); + return TE_SET_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); } +uint32_t nrfx_gpiote_set_task_addr_get(nrfx_gpiote_pin_t pin) +{ + nrf_gpiote_tasks_t task = nrfx_gpiote_set_task_get(pin); + return nrf_gpiote_task_addr_get(task); +} #endif // defined(GPIOTE_FEATURE_SET_PRESENT) + #if defined(GPIOTE_FEATURE_CLR_PRESENT) -uint32_t nrfx_gpiote_clr_task_addr_get(nrfx_gpiote_pin_t pin) +nrf_gpiote_tasks_t nrfx_gpiote_clr_task_get(nrfx_gpiote_pin_t pin) { NRFX_ASSERT(pin < NUMBER_OF_PINS); NRFX_ASSERT(pin_in_use_by_te(pin)); - nrf_gpiote_tasks_t task = TE_CLR_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); - return nrf_gpiote_task_addr_get(task); + return TE_CLR_IDX_TO_TASK_ADDR((uint32_t)channel_port_get(pin)); } +uint32_t nrfx_gpiote_clr_task_addr_get(nrfx_gpiote_pin_t pin) +{ + nrf_gpiote_tasks_t task = nrfx_gpiote_clr_task_get(pin); + return nrf_gpiote_task_addr_get(task); +} #endif // defined(GPIOTE_FEATURE_CLR_PRESENT) + void nrfx_gpiote_out_task_force(nrfx_gpiote_pin_t pin, uint8_t state) { NRFX_ASSERT(pin < NUMBER_OF_PINS); @@ -641,17 +658,23 @@ bool nrfx_gpiote_in_is_set(nrfx_gpiote_pin_t pin) } -uint32_t nrfx_gpiote_in_event_addr_get(nrfx_gpiote_pin_t pin) +nrf_gpiote_events_t nrfx_gpiote_in_event_get(nrfx_gpiote_pin_t pin) { NRFX_ASSERT(pin < NUMBER_OF_PINS); NRFX_ASSERT(pin_in_use_by_port(pin) || pin_in_use_by_te(pin)); - nrf_gpiote_events_t event = NRF_GPIOTE_EVENTS_PORT; - if (pin_in_use_by_te(pin)) { - event = TE_IDX_TO_EVENT_ADDR((uint32_t)channel_port_get(pin)); + return TE_IDX_TO_EVENT_ADDR((uint32_t)channel_port_get(pin)); } + + return NRF_GPIOTE_EVENTS_PORT; +} + + +uint32_t nrfx_gpiote_in_event_addr_get(nrfx_gpiote_pin_t pin) +{ + nrf_gpiote_events_t event = nrfx_gpiote_in_event_get(pin); return nrf_gpiote_event_addr_get(event); } diff --git a/helpers/nrfx_gppi/nrfx_gppi.h b/helpers/nrfx_gppi.h similarity index 100% rename from helpers/nrfx_gppi/nrfx_gppi.h rename to helpers/nrfx_gppi.h diff --git a/mdk/nrf.h b/mdk/nrf.h index becee3d87..d7684aff7 100644 --- a/mdk/nrf.h +++ b/mdk/nrf.h @@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. /* MDK version */ #define MDK_MAJOR_VERSION 8 #define MDK_MINOR_VERSION 27 -#define MDK_MICRO_VERSION 0 +#define MDK_MICRO_VERSION 1 /* Define NRF51_SERIES for common use in nRF51 series devices. Only if not previously defined. */ #if defined (NRF51422_XXAA) ||\ diff --git a/mdk/nrf51.h b/mdk/nrf51.h index d8c101edd..e9d4d7b66 100644 --- a/mdk/nrf51.h +++ b/mdk/nrf51.h @@ -30,10 +30,10 @@ * @file nrf51.h * @brief CMSIS HeaderFile * @version 522 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:12 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:34 * from File 'nrf51.svd', - * last modified on Friday, 23.08.2019 10:15:08 + * last modified on Thursday, 17.10.2019 14:07:29 */ diff --git a/mdk/nrf52.h b/mdk/nrf52.h index 7496083b9..b47aee7be 100644 --- a/mdk/nrf52.h +++ b/mdk/nrf52.h @@ -30,10 +30,10 @@ * @file nrf52.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52.svd', - * last modified on Friday, 23.08.2019 10:15:08 + * last modified on Thursday, 17.10.2019 14:07:29 */ diff --git a/mdk/nrf52805.h b/mdk/nrf52805.h index e1f2b5484..192f9f768 100644 --- a/mdk/nrf52805.h +++ b/mdk/nrf52805.h @@ -30,10 +30,10 @@ * @file nrf52805.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52805.svd', - * last modified on Friday, 23.08.2019 10:15:08 + * last modified on Thursday, 17.10.2019 14:07:29 */ diff --git a/mdk/nrf52810.h b/mdk/nrf52810.h index 289a23ccf..d90a9a1f1 100644 --- a/mdk/nrf52810.h +++ b/mdk/nrf52810.h @@ -30,10 +30,10 @@ * @file nrf52810.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52810.svd', - * last modified on Friday, 23.08.2019 10:15:08 + * last modified on Thursday, 17.10.2019 14:07:30 */ diff --git a/mdk/nrf52811.h b/mdk/nrf52811.h index 6df51f96a..09c5d2364 100644 --- a/mdk/nrf52811.h +++ b/mdk/nrf52811.h @@ -30,10 +30,10 @@ * @file nrf52811.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52811.svd', - * last modified on Friday, 23.08.2019 10:15:08 + * last modified on Thursday, 17.10.2019 14:07:30 */ diff --git a/mdk/nrf52833.h b/mdk/nrf52833.h index d03eb9ecf..6b838fe59 100644 --- a/mdk/nrf52833.h +++ b/mdk/nrf52833.h @@ -30,10 +30,10 @@ * @file nrf52833.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52833.svd', - * last modified on Friday, 23.08.2019 10:15:09 + * last modified on Thursday, 17.10.2019 14:07:30 */ diff --git a/mdk/nrf52840.h b/mdk/nrf52840.h index 2c0abbf02..ea76346ae 100644 --- a/mdk/nrf52840.h +++ b/mdk/nrf52840.h @@ -30,10 +30,10 @@ * @file nrf52840.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:13 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:35 * from File 'nrf52840.svd', - * last modified on Friday, 23.08.2019 10:15:09 + * last modified on Thursday, 17.10.2019 14:07:30 */ diff --git a/mdk/nrf9160.h b/mdk/nrf9160.h index 505034db8..a371be9ae 100644 --- a/mdk/nrf9160.h +++ b/mdk/nrf9160.h @@ -30,10 +30,10 @@ * @file nrf9160.h * @brief CMSIS HeaderFile * @version 1 - * @date 23. August 2019 - * @note Generated by SVDConv V3.3.25 on Friday, 23.08.2019 12:15:14 + * @date 17. October 2019 + * @note Generated by SVDConv V3.3.25 on Thursday, 17.10.2019 16:07:36 * from File 'nrf9160.svd', - * last modified on Friday, 23.08.2019 10:15:09 + * last modified on Thursday, 17.10.2019 14:07:30 */ diff --git a/templates/nRF52833/nrfx_config.h b/templates/nRF52833/nrfx_config.h index c946a8fb6..a1032d7bd 100644 --- a/templates/nRF52833/nrfx_config.h +++ b/templates/nRF52833/nrfx_config.h @@ -2600,12 +2600,12 @@ #ifndef NRFX_UARTE_ENABLED #define NRFX_UARTE_ENABLED 1 #endif -// NRFX_UARTE0_ENABLED - Enable UARTE0 instance +// NRFX_UARTE0_ENABLED - Enable UARTE0 instance #ifndef NRFX_UARTE0_ENABLED #define NRFX_UARTE0_ENABLED 1 #endif -// NRFX_UARTE1_ENABLED - Enable UARTE1 instance +// NRFX_UARTE1_ENABLED - Enable UARTE1 instance #ifndef NRFX_UARTE1_ENABLED #define NRFX_UARTE1_ENABLED 1 #endif @@ -2726,7 +2726,7 @@ #ifndef NRFX_UART_ENABLED #define NRFX_UART_ENABLED 1 #endif -// NRFX_UART0_ENABLED - Enable UART0 instance +// NRFX_UART0_ENABLED - Enable UART0 instance #ifndef NRFX_UART0_ENABLED #define NRFX_UART0_ENABLED 1 #endif diff --git a/templates/nRF9160/nrfx_config.h b/templates/nRF9160/nrfx_config.h index 31b6c898e..63c59001f 100644 --- a/templates/nRF9160/nrfx_config.h +++ b/templates/nRF9160/nrfx_config.h @@ -3,10 +3,11 @@ /* * The MDK provides macros for accessing the peripheral register structures - * by using their secure and non-secure address mappings (with the names containing - * the suffix _S or _NS, respectively). Because the nrfx drivers use the macros without - * any suffixes, you must translate the names. The following section provides configuration - * for the name translation. It must be modified to reflect the actual configuration set in NRF_SPU. + * by using their secure and non-secure address mappings (with the names + * containing the suffix _S or _NS, respectively). Because the nrfx drivers + * use the macros without any suffixes, you must translate the names. + * The following section provides configuration for the name translation. + * It must be modified to reflect the actual configuration set in NRF_SPU. */ #define NRF_CLOCK NRF_CLOCK_S #define NRF_DPPIC NRF_DPPIC_S @@ -57,7 +58,11 @@ #define NRF_VMC NRF_VMC_S #define NRF_WDT NRF_WDT_S -/* Unchangable configuration. */ +/* + * The following section provides the name translation for peripherals with + * only one type of access available. For these peripherals, you cannot choose + * between secure and non-secure mapping. + */ #define NRF_CRYPTOCELL NRF_CRYPTOCELL_S #define NRF_FICR NRF_FICR_S #define NRF_GPIOTE0 NRF_GPIOTE0_S @@ -67,7 +72,6 @@ /* Fixups for GPIOTE HAL and driver. */ #define NRF_GPIOTE NRF_GPIOTE0_S -#define GPIOTE_IRQn GPIOTE0_IRQn #define GPIOTE_IRQHandler GPIOTE0_IRQHandler // <<< Use Configuration Wizard in Context Menu >>>\n