Skip to content

Commit

Permalink
ext: hal: nordic: Update nrfx to version 1.5.0
Browse files Browse the repository at this point in the history
Updates nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v1.5.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.5.0
commit: 2f4572bd2ae640a6140959f39de282e9f58c739c
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Andrzej Głąbek <[email protected]>
  • Loading branch information
anangl authored and galak committed Dec 13, 2018
1 parent b8c8333 commit d315476
Show file tree
Hide file tree
Showing 66 changed files with 52,753 additions and 705 deletions.
28 changes: 16 additions & 12 deletions ext/hal/nordic/nrfx/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ nrfx
####

Origin:
https://github.com/NordicSemiconductor/nrfx/tree/v1.4.0
https://github.com/NordicSemiconductor/nrfx/tree/v1.5.0

Status:
v1.4.0
v1.5.0

Purpose:
With added proper shims adapting it to Zephyr's APIs, nrfx will provide
peripheral drivers for Nordic SoCs.

Description:
nrfx is an extract from the nRF5 SDK that contains solely the drivers
for peripherals present in Nordic SoCs, for convenience complemented with
the MDK package containing required structures and bitfields definitions,
startup files etc.

Only relevant files from nrfx were imported, for instance, template files
and the ones with startup code or strictly related to installation of IRQs
in the vector table were omitted.
nrfx is a standalone set of drivers for peripherals present in Nordic
Semiconductor's SoCs. It originated as an extract from the nRF5 SDK.
The intention was to provide drivers that can be used in various
environments without the necessity to integrate other parts of the SDK
into them. For the user's convenience, the drivers come with the MDK
package. This package contains definitions of register structures and
bitfields for all supported SoCs, as well as startup and initialization
files for them.

Only relevant files from nrfx are imported. For instance, template files,
the ones with startup code or strictly related to the installation of IRQs
in the vector table are omitted in the import.

Dependencies:
CMSIS header files
Expand All @@ -28,7 +32,7 @@ URL:
https://github.com/NordicSemiconductor/nrfx

commit:
595e79f63f21224f6a42325095be9940a4a62ffb
2f4572bd2ae640a6140959f39de282e9f58c739c

Maintained-by:
External
Expand All @@ -37,4 +41,4 @@ License:
BSD-3-Clause

License Link:
https://github.com/NordicSemiconductor/nrfx/blob/v1.4.0/LICENSE
https://github.com/NordicSemiconductor/nrfx/blob/v1.5.0/LICENSE
176 changes: 176 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_dppi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/*
* Copyright (c) 2018, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef NRFX_DPPI_H__
#define NRFX_DPPI_H__

#include <nrfx.h>
#include <hal/nrf_dppi.h>

/**
* @defgroup nrfx_dppi DPPI allocator
* @{
* @ingroup nrf_dppi
* @brief Distributed Programmable Peripheral Interconnect (DPPI) allocator.
*/

#ifdef __cplusplus
extern "C" {
#endif

/** @brief Function for freeing all allocated channels and groups. */
void nrfx_dppi_free(void);

/**
* @brief Function for allocating a DPPI channel.
* @details This function allocates the first unused DPPI channel.
*
* @param[out] p_channel Pointer to the DPPI channel number that has been allocated.
*
* @retval NRFX_SUCCESS If the channel was successfully allocated.
* @retval NRFX_ERROR_NO_MEM If there is no available channel to be used.
*/
nrfx_err_t nrfx_dppi_channel_alloc(uint8_t * p_channel);

/**
* @brief Function for freeing a DPPI channel.
* @details This function also disables the chosen channel.
*
* @param[in] channel DPPI channel to be freed.
*
* @retval NRFX_SUCCESS If the channel was successfully freed.
* @retval NRFX_ERROR_INVALID_PARAM If the specified channel is not allocated.
*/
nrfx_err_t nrfx_dppi_channel_free(uint8_t channel);

/**
* @brief Function for enabling a DPPI channel.
*
* @param[in] channel DPPI channel to be enabled.
*
* @retval NRFX_SUCCESS If the channel was successfully enabled.
* @retval NRFX_ERROR_INVALID_PARAM If the specified channel is not allocated.
*/
nrfx_err_t nrfx_dppi_channel_enable(uint8_t channel);

/**
* @brief Function for disabling a DPPI channel.
*
* @param[in] channel DPPI channel to be disabled.
*
* @retval NRFX_SUCCESS If the channel was successfully disabled.
* @retval NRFX_ERROR_INVALID_PARAM If the specified channel is not allocated.
*/
nrfx_err_t nrfx_dppi_channel_disable(uint8_t channel);

/**
* @brief Function for allocating a DPPI channel group.
* @details This function allocates the first unused DPPI group.
*
* @param[out] p_group Pointer to the DPPI channel group that has been allocated.
*
* @retval NRFX_SUCCESS If the channel group was successfully allocated.
* @retval NRFX_ERROR_NO_MEM If there is no available channel group to be used.
*/
nrfx_err_t nrfx_dppi_group_alloc(nrf_dppi_channel_group_t * p_group);

/**
* @brief Function for freeing a DPPI channel group.
* @details This function also disables the chosen group.
*
* @param[in] group DPPI channel group to be freed.
*
* @retval NRFX_SUCCESS If the channel group was successfully freed.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group is not allocated.
*/
nrfx_err_t nrfx_dppi_group_free(nrf_dppi_channel_group_t group);

/**
* @brief Function for including a DPPI channel in a channel group.
*
* @param[in] channel DPPI channel to be added.
* @param[in] group Channel group in which to include the channel.
*
* @retval NRFX_SUCCESS If the channel was successfully included.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group or channel is not allocated.
*/
nrfx_err_t nrfx_dppi_channel_include_in_group(uint8_t channel,
nrf_dppi_channel_group_t group);

/**
* @brief Function for removing a DPPI channel from a channel group.
*
* @param[in] channel DPPI channel to be removed.
* @param[in] group Channel group from which to remove the channel.
*
* @retval NRFX_SUCCESS If the channel was successfully removed.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group or channel is not allocated.
*/
nrfx_err_t nrfx_dppi_channel_remove_from_group(uint8_t channel,
nrf_dppi_channel_group_t group);

/**
* @brief Function for clearing a DPPI channel group.
*
* @param[in] group Channel group to be cleared.
*
* @retval NRFX_SUCCESS If the group was successfully cleared.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group is not allocated.
*/
nrfx_err_t nrfx_dppi_group_clear(nrf_dppi_channel_group_t group);

/**
* @brief Function for enabling a DPPI channel group.
*
* @param[in] group Channel group to be enabled.
*
* @retval NRFX_SUCCESS If the group was successfully enabled.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group is not allocated.
*/
nrfx_err_t nrfx_dppi_group_enable(nrf_dppi_channel_group_t group);

/**
* @brief Function for disabling a DPPI channel group.
*
* @param[in] group Channel group to be disabled.
*
* @retval NRFX_SUCCESS If the group was successfully disabled.
* @retval NRFX_ERROR_INVALID_PARAM If the specified group is not allocated.
*/
nrfx_err_t nrfx_dppi_group_disable(nrf_dppi_channel_group_t group);

/** @} */

#ifdef __cplusplus
}
#endif

#endif // NRFX_DPPI_H__
4 changes: 4 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_power.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ typedef struct
typedef struct
{
nrfx_power_pofwarn_event_handler_t handler; //!< Event handler
#if NRF_POWER_HAS_POFCON || defined(__NRFX_DOXYGEN__)
nrf_power_pof_thr_t thr; //!< Threshold for power failure detection
#endif
#if NRF_POWER_HAS_VDDH || defined(__NRFX_DOXYGEN__)
nrf_power_pof_thrvddh_t thrvddh; //!< Threshold for power failure detection on VDDH pin
#endif
Expand Down Expand Up @@ -233,6 +235,7 @@ nrfx_err_t nrfx_power_init(nrfx_power_config_t const * p_config);
*/
void nrfx_power_uninit(void);

#if NRF_POWER_HAS_POFCON || defined(__NRFX_DOXYGEN__)
/**
* @brief Initialize power failure comparator
*
Expand Down Expand Up @@ -268,6 +271,7 @@ void nrfx_power_pof_disable(void);
* Clears the settings of the power failure comparator.
*/
void nrfx_power_pof_uninit(void);
#endif // NRF_POWER_HAS_POFCON || defined(__NRFX_DOXYGEN__)

#if NRF_POWER_HAS_SLEEPEVT || defined(__NRFX_DOXYGEN__)
/**
Expand Down
6 changes: 3 additions & 3 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_power_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ __STATIC_INLINE void nrfx_power_clock_irq_init(void)
priority = NRFX_CLOCK_CONFIG_IRQ_PRIORITY;
#endif

if (!NRFX_IRQ_IS_ENABLED(POWER_CLOCK_IRQn))
if (!NRFX_IRQ_IS_ENABLED(nrfx_get_irq_number(NRF_CLOCK)))
{
NRFX_IRQ_PRIORITY_SET(POWER_CLOCK_IRQn, priority);
NRFX_IRQ_ENABLE(POWER_CLOCK_IRQn);
NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number(NRF_CLOCK), priority);
NRFX_IRQ_ENABLE(nrfx_get_irq_number(NRF_CLOCK));
}
}
#endif // SUPPRESS_INLINE_IMPLEMENTATION
Expand Down
4 changes: 4 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_spis.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ enum {
#endif
#if NRFX_CHECK(NRFX_SPIS2_ENABLED)
NRFX_SPIS2_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_SPIS3_ENABLED)
NRFX_SPIS3_INST_IDX,
#endif
NRFX_SPIS_ENABLED_COUNT
};
Expand Down Expand Up @@ -229,6 +232,7 @@ nrfx_err_t nrfx_spis_buffers_set(nrfx_spis_t const * const p_instance,
void nrfx_spis_0_irq_handler(void);
void nrfx_spis_1_irq_handler(void);
void nrfx_spis_2_irq_handler(void);
void nrfx_spis_3_irq_handler(void);


/** @} */
Expand Down
8 changes: 6 additions & 2 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_swi.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include <hal/nrf_egu.h>
#endif

#ifndef SWI_COUNT
#define SWI_COUNT EGU_COUNT
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -161,8 +165,8 @@ __STATIC_INLINE NRF_EGU_Type * nrfx_swi_egu_instance_get(nrfx_swi_t swi)
return NULL;
}
#endif
uint32_t offset = ((uint32_t)swi) * (NRF_EGU1_BASE - NRF_EGU0_BASE);
return (NRF_EGU_Type *)(NRF_EGU0_BASE + offset);
uint32_t offset = ((uint32_t)swi) * ((uint32_t)NRF_EGU1 - (uint32_t)NRF_EGU0);
return (NRF_EGU_Type *)((uint32_t)NRF_EGU0 + offset);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_twim.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ enum {
#endif
#if NRFX_CHECK(NRFX_TWIM1_ENABLED)
NRFX_TWIM1_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_TWIM2_ENABLED)
NRFX_TWIM2_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_TWIM3_ENABLED)
NRFX_TWIM3_INST_IDX,
#endif
NRFX_TWIM_ENABLED_COUNT
};
Expand Down Expand Up @@ -388,6 +394,8 @@ uint32_t nrfx_twim_stopped_event_get(nrfx_twim_t const * p_instance);

void nrfx_twim_0_irq_handler(void);
void nrfx_twim_1_irq_handler(void);
void nrfx_twim_2_irq_handler(void);
void nrfx_twim_3_irq_handler(void);


/** @} */
Expand Down
8 changes: 8 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_twis.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ enum {
#endif
#if NRFX_CHECK(NRFX_TWIS1_ENABLED)
NRFX_TWIS1_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_TWIS2_ENABLED)
NRFX_TWIS2_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_TWIS3_ENABLED)
NRFX_TWIS3_INST_IDX,
#endif
NRFX_TWIS_ENABLED_COUNT
};
Expand Down Expand Up @@ -385,6 +391,8 @@ __STATIC_INLINE size_t nrfx_twis_rx_amount(nrfx_twis_t const * p_instance)

void nrfx_twis_0_irq_handler(void);
void nrfx_twis_1_irq_handler(void);
void nrfx_twis_2_irq_handler(void);
void nrfx_twis_3_irq_handler(void);


/** @} */
Expand Down
8 changes: 8 additions & 0 deletions ext/hal/nordic/nrfx/drivers/include/nrfx_uarte.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ enum {
#endif
#if NRFX_CHECK(NRFX_UARTE1_ENABLED)
NRFX_UARTE1_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_UARTE2_ENABLED)
NRFX_UARTE2_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_UARTE3_ENABLED)
NRFX_UARTE3_INST_IDX,
#endif
NRFX_UARTE_ENABLED_COUNT
};
Expand Down Expand Up @@ -344,6 +350,8 @@ __STATIC_INLINE uint32_t nrfx_uarte_event_address_get(nrfx_uarte_t const * p_ins

void nrfx_uarte_0_irq_handler(void);
void nrfx_uarte_1_irq_handler(void);
void nrfx_uarte_2_irq_handler(void);
void nrfx_uarte_3_irq_handler(void);

/** @} */

Expand Down
Loading

0 comments on commit d315476

Please sign in to comment.