From d19018ed334c26f0d9eb35cf7f5a622df8d54346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 6 Sep 2018 14:13:37 +0200 Subject: [PATCH] nrfx 1.2.0 release --- CHANGELOG.md | 14 ++++++++++++-- doc/nrfx.doxyfile | 2 +- drivers/src/nrfx_qdec.c | 9 ++++++--- drivers/src/nrfx_uarte.c | 18 +++++++++++++++--- hal/nrf_gpiote.h | 14 ++++++++++++++ hal/nrf_qdec.h | 7 +++++++ hal/nrf_usbd.h | 14 +++++++------- 7 files changed, 62 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f3737a9..462a6edd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,19 @@ # Changelog All notable changes to this project are documented in this file. -## [Unreleased] +## [1.2.0] - 2018-09-06 +### Added +- Added function for checking if a specific channel is enabled in the GPIOTE HAL. +- Added support for using the QDEC driver without LED. +- Added functions for modifying only the event endpoint or only the task endpoint in the PPI HAL. +- Added function for reading the pin pull configuration in the GPIO HAL. + ### Fixed -- Fixed starting TWIM TXRX transfer after preceding transfer was without stop condition. +- Fixed a double buffering bug that occurred in the UARTE driver after the RX abort. +- Fixed the TXRX transfers in the TWIM driver. They can now be started after transfers that are not ended with the stop condition. + +### Changed +- Corrected ISOSPLIT enumerator names in the USBD HAL. ## [1.1.0] - 2018-06-15 ### Added diff --git a/doc/nrfx.doxyfile b/doc/nrfx.doxyfile index b957e56ef..3b0c5e9aa 100644 --- a/doc/nrfx.doxyfile +++ b/doc/nrfx.doxyfile @@ -33,7 +33,7 @@ PROJECT_NAME = "nrfx" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.1" +PROJECT_NUMBER = "1.2" ### EDIT THIS ### # Using the PROJECT_BRIEF tag one can provide an optional one line description diff --git a/drivers/src/nrfx_qdec.c b/drivers/src/nrfx_qdec.c index 9ecf82f86..a86ff780b 100644 --- a/drivers/src/nrfx_qdec.c +++ b/drivers/src/nrfx_qdec.c @@ -107,12 +107,15 @@ nrfx_err_t nrfx_qdec_init(nrfx_qdec_config_t const * p_config, m_qdec_event_handler = event_handler; nrf_qdec_sampleper_set(p_config->sampleper); - nrf_gpio_cfg_input(p_config->pselled, NRF_GPIO_PIN_NOPULL); nrf_gpio_cfg_input(p_config->psela, NRF_GPIO_PIN_NOPULL); nrf_gpio_cfg_input(p_config->pselb, NRF_GPIO_PIN_NOPULL); + if (p_config->pselled != NRF_QDEC_LED_NOT_CONNECTED) + { + nrf_gpio_cfg_input(p_config->pselled, NRF_GPIO_PIN_NOPULL); + nrf_qdec_ledpre_set(p_config->ledpre); + nrf_qdec_ledpol_set(p_config->ledpol); + } nrf_qdec_pio_assign(p_config->psela, p_config->pselb, p_config->pselled); - nrf_qdec_ledpre_set(p_config->ledpre); - nrf_qdec_ledpol_set(p_config->ledpol); nrf_qdec_shorts_enable(NRF_QDEC_SHORT_REPORTRDY_READCLRACC_MASK); if (p_config->dbfen) diff --git a/drivers/src/nrfx_uarte.c b/drivers/src/nrfx_uarte.c index c9560bce5..39d0c2835 100644 --- a/drivers/src/nrfx_uarte.c +++ b/drivers/src/nrfx_uarte.c @@ -488,6 +488,14 @@ void nrfx_uarte_tx_abort(nrfx_uarte_t const * p_instance) void nrfx_uarte_rx_abort(nrfx_uarte_t const * p_instance) { + uarte_control_block_t * p_cb = &m_cb[p_instance->drv_inst_idx]; + + // Short between ENDRX event and STARTRX task must be disabled before + // aborting transmission. + if (p_cb->rx_secondary_buffer_length != 0) + { + nrf_uarte_shorts_disable(p_instance->p_reg, NRF_UARTE_SHORT_ENDRX_STARTRX); + } nrf_uarte_task_trigger(p_instance->p_reg, NRF_UARTE_TASK_STOPRX); NRFX_LOG_INFO("RX transaction aborted."); } @@ -520,7 +528,7 @@ static void uarte_irq_handler(NRF_UARTE_Type * p_uarte, // will not be equal to the buffer length. Interrupted transfer is ignored. if (amount == p_cb->rx_buffer_length) { - if (p_cb->rx_secondary_buffer_length) + if (p_cb->rx_secondary_buffer_length != 0) { uint8_t * p_data = p_cb->p_rx_buffer; nrf_uarte_shorts_disable(p_uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); @@ -540,9 +548,13 @@ static void uarte_irq_handler(NRF_UARTE_Type * p_uarte, if (nrf_uarte_event_check(p_uarte, NRF_UARTE_EVENT_RXTO)) { nrf_uarte_event_clear(p_uarte, NRF_UARTE_EVENT_RXTO); - if (p_cb->rx_buffer_length) + + if (p_cb->rx_buffer_length != 0) { p_cb->rx_buffer_length = 0; + // In case of using double-buffered reception both variables storing buffer length + // have to be cleared to prevent incorrect behaviour of the driver. + p_cb->rx_secondary_buffer_length = 0; rx_done_event(p_cb, nrf_uarte_rx_amount_get(p_uarte), p_cb->p_rx_buffer); } } @@ -550,7 +562,7 @@ static void uarte_irq_handler(NRF_UARTE_Type * p_uarte, if (nrf_uarte_event_check(p_uarte, NRF_UARTE_EVENT_ENDTX)) { nrf_uarte_event_clear(p_uarte, NRF_UARTE_EVENT_ENDTX); - if (p_cb->tx_buffer_length) + if (p_cb->tx_buffer_length != 0) { tx_done_event(p_cb, nrf_uarte_tx_amount_get(p_uarte)); } diff --git a/hal/nrf_gpiote.h b/hal/nrf_gpiote.h index 649c49010..ab923af74 100644 --- a/hal/nrf_gpiote.h +++ b/hal/nrf_gpiote.h @@ -292,6 +292,15 @@ __STATIC_INLINE void nrf_gpiote_task_force(uint32_t idx, nrf_gpiote_outinit_t in */ __STATIC_INLINE void nrf_gpiote_te_default(uint32_t idx); +/**@brief Function for checking if particular Task-Event is enabled. + * + * @param[in] idx Task-Event index. + * + * @retval true If the Task-Event mode is set to Task or Event. + * @retval false If the Task-Event mode is set to Disabled. + */ +__STATIC_INLINE bool nrf_gpiote_te_is_enabled(uint32_t idx); + #ifndef SUPPRESS_INLINE_IMPLEMENTATION __STATIC_INLINE void nrf_gpiote_task_set(nrf_gpiote_tasks_t task) { @@ -408,6 +417,11 @@ __STATIC_INLINE void nrf_gpiote_te_default(uint32_t idx) { NRF_GPIOTE->CONFIG[idx] = 0; } + +__STATIC_INLINE bool nrf_gpiote_te_is_enabled(uint32_t idx) +{ + return (NRF_GPIOTE->CONFIG[idx] & GPIOTE_CONFIG_MODE_Msk) != GPIOTE_CONFIG_MODE_Disabled; +} #endif //SUPPRESS_INLINE_IMPLEMENTATION /** @} */ diff --git a/hal/nrf_qdec.h b/hal/nrf_qdec.h index 0653c6211..e87c65d23 100644 --- a/hal/nrf_qdec.h +++ b/hal/nrf_qdec.h @@ -44,6 +44,13 @@ extern "C" { * @brief Hardware access layer for managing the Quadrature Decoder (QDEC) peripheral. */ +/** + * @brief This value can be provided as a parameter for the @ref nrf_qdec_pio_assign + * function call to specify that a LED signal shall not be use by the QDEC and + * connected to a physical pin. + */ +#define NRF_QDEC_LED_NOT_CONNECTED 0xFFFFFFFF + /** * @enum nrf_qdec_task_t * @brief QDEC tasks. diff --git a/hal/nrf_usbd.h b/hal/nrf_usbd.h index 6a8df9dc4..46fa1ab20 100644 --- a/hal/nrf_usbd.h +++ b/hal/nrf_usbd.h @@ -531,11 +531,11 @@ void nrf_usbd_int_disable(uint32_t int_mask) */ typedef enum { - NRF_USBD_EVENTCAUSE_ISOOUTCRC_MASK = USBD_EVENTCAUSE_ISOOUTCRC_Msk, /**< CRC error was detected on isochronous OUT endpoint 8. */ - NRF_USBD_EVENTCAUSE_SUSPEND_MASK = USBD_EVENTCAUSE_SUSPEND_Msk , /**< Signals that the USB lines have been seen idle long enough for the device to enter suspend. */ - NRF_USBD_EVENTCAUSE_RESUME_MASK = USBD_EVENTCAUSE_RESUME_Msk , /**< Signals that a RESUME condition (K state or activity restart) has been detected on the USB lines. */ - NRF_USBD_EVENTCAUSE_READY_MASK = USBD_EVENTCAUSE_READY_Msk, /**< MAC is ready for normal operation, rised few us after USBD enabling */ - NRF_USBD_EVENTCAUSE_WUREQ_MASK = (1U << 10) /**< The USBD peripheral has exited Low Power mode */ + NRF_USBD_EVENTCAUSE_ISOOUTCRC_MASK = USBD_EVENTCAUSE_ISOOUTCRC_Msk, /**< CRC error was detected on isochronous OUT endpoint 8. */ + NRF_USBD_EVENTCAUSE_SUSPEND_MASK = USBD_EVENTCAUSE_SUSPEND_Msk, /**< Signals that the USB lines have been seen idle long enough for the device to enter suspend. */ + NRF_USBD_EVENTCAUSE_RESUME_MASK = USBD_EVENTCAUSE_RESUME_Msk, /**< Signals that a RESUME condition (K state or activity restart) has been detected on the USB lines. */ + NRF_USBD_EVENTCAUSE_WUREQ_MASK = USBD_EVENTCAUSE_USBWUALLOWED_Msk, /**< The USBD peripheral has exited Low Power mode */ + NRF_USBD_EVENTCAUSE_READY_MASK = USBD_EVENTCAUSE_READY_Msk, /**< MAC is ready for normal operation, rised few us after USBD enabling */ }nrf_usbd_eventcause_mask_t; /** @@ -613,8 +613,8 @@ typedef enum */ typedef enum { - NRF_USBD_ISOSPLIT_OneDir = USBD_ISOSPLIT_SPLIT_OneDir, /**< Full buffer dedicated to either iso IN or OUT */ - NRF_USBD_ISOSPLIT_Half = USBD_ISOSPLIT_SPLIT_HalfIN, /**< Buffer divided in half */ + NRF_USBD_ISOSPLIT_ONEDIR = USBD_ISOSPLIT_SPLIT_OneDir, /**< Full buffer dedicated to either iso IN or OUT */ + NRF_USBD_ISOSPLIT_HALF = USBD_ISOSPLIT_SPLIT_HalfIN, /**< Buffer divided in half */ }nrf_usbd_isosplit_t; /**