Skip to content

Commit

Permalink
nrfx 1.8.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kl-cruz committed Oct 21, 2019
1 parent 06c0b98 commit ecc3616
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 51 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
56 changes: 53 additions & 3 deletions drivers/include/nrfx_gpiote.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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.
Expand Down
51 changes: 37 additions & 14 deletions drivers/src/nrfx_gpiote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <nrfx.h>

#if NRFX_CHECK(NRFX_GPIOTE_ENABLED)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mdk/nrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||\
Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf51.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52805.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52810.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52811.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52833.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf52840.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions mdk/nrf9160.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down
6 changes: 3 additions & 3 deletions templates/nRF52833/nrfx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2600,12 +2600,12 @@
#ifndef NRFX_UARTE_ENABLED
#define NRFX_UARTE_ENABLED 1
#endif
// <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance
// <q> NRFX_UARTE0_ENABLED - Enable UARTE0 instance
#ifndef NRFX_UARTE0_ENABLED
#define NRFX_UARTE0_ENABLED 1
#endif

// <o> NRFX_UARTE1_ENABLED - Enable UARTE1 instance
// <q> NRFX_UARTE1_ENABLED - Enable UARTE1 instance
#ifndef NRFX_UARTE1_ENABLED
#define NRFX_UARTE1_ENABLED 1
#endif
Expand Down Expand Up @@ -2726,7 +2726,7 @@
#ifndef NRFX_UART_ENABLED
#define NRFX_UART_ENABLED 1
#endif
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
// <q> NRFX_UART0_ENABLED - Enable UART0 instance
#ifndef NRFX_UART0_ENABLED
#define NRFX_UART0_ENABLED 1
#endif
Expand Down
16 changes: 10 additions & 6 deletions templates/nRF9160/nrfx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ecc3616

Please sign in to comment.