diff --git a/cpu/nrf51/cpu.c b/cpu/nrf51/cpu.c index 54b42952d4..a4e595632c 100644 --- a/cpu/nrf51/cpu.c +++ b/cpu/nrf51/cpu.c @@ -19,7 +19,7 @@ #include "cpu.h" #include "nrf_clock.h" -#include "nrfx.h" +#include "nrfx_riot.h" #include "periph_conf.h" #include "periph/init.h" #include "stdio_base.h" diff --git a/cpu/nrf51/include/cpu_conf.h b/cpu/nrf51/include/cpu_conf.h index ac874fe40d..76acd7b1dc 100644 --- a/cpu/nrf51/include/cpu_conf.h +++ b/cpu/nrf51/include/cpu_conf.h @@ -24,6 +24,7 @@ #include "cpu_conf_common.h" #include "vendor/nrf51.h" #include "vendor/nrf51_bitfields.h" +#include "vendor/nrf51822_peripherals.h" #ifdef __cplusplus extern "C" { @@ -57,11 +58,6 @@ extern "C" { #define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4U) /** @} */ -/** - * @brief nRF51 only has one GPIO block - */ -#define GPIO_COUNT (1U) - /** * @brief Due to RAM restrictions, we need to limit the default GNRC packet * buffer size on these CPUs diff --git a/cpu/nrf51/include/vendor/nrf51822_peripherals.h b/cpu/nrf51/include/vendor/nrf51822_peripherals.h new file mode 100644 index 0000000000..6b4cc8e23f --- /dev/null +++ b/cpu/nrf51/include/vendor/nrf51822_peripherals.h @@ -0,0 +1,171 @@ +/* + +Copyright (c) 2010 - 2021, Nordic Semiconductor ASA All rights reserved. + +SPDX-License-Identifier: BSD-3-Clause + +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 Nordic Semiconductor ASA 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 NORDIC SEMICONDUCTOR ASA 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. + +*/ + + +/* This file is deprecated */ +#ifndef _NRF51822_PERIPHERALS_H +#define _NRF51822_PERIPHERALS_H + + +/* Clock Peripheral */ +#define CLOCK_PRESENT +#define CLOCK_COUNT 1 + +/* Power Peripheral */ +#define POWER_PRESENT +#define POWER_COUNT 1 + +#define POWER_FEATURE_RAMON_REGISTERS_PRESENT + +/* Non-Volatile Memory Controller */ +#define NVMC_PRESENT +#define NVMC_COUNT 1 + +/* Software Interrupts */ +#define SWI_PRESENT +#define SWI_COUNT 6 + +/* GPIO */ +#define GPIO_PRESENT +#define GPIO_COUNT 1 + +#define P0_PIN_NUM 32 + +#define P0_FEATURE_PINS_PRESENT 0xFFFFFFFFUL + +/* MPU and BPROT */ +#define BPROT_PRESENT + +#define BPROT_REGIONS_SIZE 4096 +#define BPROT_REGIONS_NUM 64 + +/* Radio */ +#define RADIO_PRESENT +#define RADIO_COUNT 1 + +#define RADIO_TXPOWER_TXPOWER_Max RADIO_TXPOWER_TXPOWER_Pos4dBm + +/* Accelerated Address Resolver */ +#define AAR_PRESENT +#define AAR_COUNT 1 + +#define AAR_MAX_IRK_NUM 8 + +/* AES Electronic CodeBook mode encryption */ +#define ECB_PRESENT +#define ECB_COUNT 1 + +/* AES CCM mode encryption */ +#define CCM_PRESENT +#define CCM_COUNT 1 + +/* Peripheral to Peripheral Interconnect */ +#define PPI_PRESENT +#define PPI_COUNT 1 + +#define PPI_CH_NUM 16 +#define PPI_FIXED_CH_NUM 12 +#define PPI_GROUP_NUM 4 + +/* Timer/Counter */ +#define TIMER_PRESENT +#define TIMER_COUNT 3 + +#define TIMER0_MAX_SIZE 32 +#define TIMER1_MAX_SIZE 16 +#define TIMER2_MAX_SIZE 16 + +#define TIMER0_CC_NUM 4 +#define TIMER1_CC_NUM 4 +#define TIMER2_CC_NUM 4 + +/* Real Time Counter */ +#define RTC_PRESENT +#define RTC_COUNT 2 + +#define RTC0_CC_NUM 3 +#define RTC1_CC_NUM 4 + +/* RNG */ +#define RNG_PRESENT +#define RNG_COUNT 1 + +/* Watchdog Timer */ +#define WDT_PRESENT +#define WDT_COUNT 1 + +/* Temperature Sensor */ +#define TEMP_PRESENT +#define TEMP_COUNT 1 + +/* Serial Peripheral Interface Master */ +#define SPI_PRESENT +#define SPI_COUNT 2 + +/* Serial Peripheral Interface Slave with DMA */ +#define SPIS_PRESENT +#define SPIS_COUNT 1 + +#define SPIS1_EASYDMA_MAXCNT_SIZE 8 + +/* Two Wire Interface Master */ +#define TWI_PRESENT +#define TWI_COUNT 2 + +/* Universal Asynchronous Receiver-Transmitter */ +#define UART_PRESENT +#define UART_COUNT 1 + +/* Quadrature Decoder */ +#define QDEC_PRESENT +#define QDEC_COUNT 1 + +/* Analog to Digital Converter */ +#define ADC_PRESENT +#define ADC_COUNT 1 + +/* GPIO Tasks and Events */ +#define GPIOTE_PRESENT +#define GPIOTE_COUNT 1 + +#define GPIOTE_CH_NUM 4 + +/* Low Power Comparator */ +#define LPCOMP_PRESENT +#define LPCOMP_COUNT 1 + +#define LPCOMP_REFSEL_RESOLUTION 8 + + +#endif // _NRF51822_PERIPHERALS_H diff --git a/cpu/nrf52/cpu.c b/cpu/nrf52/cpu.c index ca604b9aa8..c0273fadf9 100644 --- a/cpu/nrf52/cpu.c +++ b/cpu/nrf52/cpu.c @@ -23,7 +23,7 @@ #define DONT_OVERRIDE_NVIC #include "cpu.h" -#include "nrfx.h" +#include "nrfx_riot.h" #include "nrf_clock.h" #include "periph_conf.h" #include "periph/init.h" diff --git a/cpu/nrf5x_common/include/nrfx.h b/cpu/nrf5x_common/include/nrfx_riot.h similarity index 96% rename from cpu/nrf5x_common/include/nrfx.h rename to cpu/nrf5x_common/include/nrfx_riot.h index fcd137d9e8..f5889aafa1 100644 --- a/cpu/nrf5x_common/include/nrfx.h +++ b/cpu/nrf5x_common/include/nrfx_riot.h @@ -19,8 +19,8 @@ * @author Koen Zandberg */ -#ifndef NRFX_H -#define NRFX_H +#ifndef NRFX_RIOT_H +#define NRFX_RIOT_H #include "kernel_defines.h" #include "cpu_conf.h" @@ -63,5 +63,5 @@ static inline void nrfx_dcdc_init(void) } #endif -#endif /* NRFX_H */ +#endif /* NRFX_RIOT_H */ /** @} */ diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 2d23c1b592..e9cb40136c 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -168,6 +168,7 @@ PSEUDOMODULES += nimble_phy_2mbit PSEUDOMODULES += nimble_rpble_ext PSEUDOMODULES += nimble_statconn_ext PSEUDOMODULES += nimble_autoadv_shell +PSEUDOMODULES += nrfx PSEUDOMODULES += newlib PSEUDOMODULES += newlib_gnu_source PSEUDOMODULES += newlib_nano diff --git a/pkg/Kconfig b/pkg/Kconfig index f6bd78aad4..8c0a894325 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -54,6 +54,7 @@ rsource "mynewt-core/Kconfig" rsource "nanocbor/Kconfig" rsource "nanopb/Kconfig" rsource "nanors/Kconfig" +rsource "nrfx/Kconfig" rsource "qcbor/Kconfig" rsource "qdsa/Kconfig" rsource "qr-code-generator/Kconfig" diff --git a/pkg/mynewt-core/Kconfig b/pkg/mynewt-core/Kconfig index 11fc88a87c..53e822bca2 100644 --- a/pkg/mynewt-core/Kconfig +++ b/pkg/mynewt-core/Kconfig @@ -37,5 +37,6 @@ config MODULE_MYNEWT-CORE_UTIL config MODULE_MYNEWT-CORE_NRF5X_HAL bool "mynewt-core nrf52 and nrf51 timer hal" + select PACKAGE_NRFX endif # PACKAGE_MYNEWT-CORE diff --git a/pkg/mynewt-core/Makefile.dep b/pkg/mynewt-core/Makefile.dep index 8131c03595..9555b3d619 100644 --- a/pkg/mynewt-core/Makefile.dep +++ b/pkg/mynewt-core/Makefile.dep @@ -5,5 +5,9 @@ USEMODULE += mynewt-core DEFAULT_MODULE += auto_init_mynewt-core +ifneq (,$(filter mynewt-core_nrf5x_hal,$(USEMODULE))) + USEPKG += nrfx +endif + # esp frequency is not pow2 so is incompatible with os_cputime FEATURES_BLACKLIST += arch_esp diff --git a/pkg/nimble/Makefile b/pkg/nimble/Makefile index d27cecc397..a08ef41fb5 100644 --- a/pkg/nimble/Makefile +++ b/pkg/nimble/Makefile @@ -1,6 +1,6 @@ PKG_NAME = nimble PKG_URL = https://github.com/apache/mynewt-nimble.git -PKG_VERSION = bc142016bdef082ba7997aea09aec1c1e4db0104 +PKG_VERSION = 719bd3c435b728f07ce7aaffaf6cebbd9c659a46 PKG_LICENSE = Apache-2.0 include $(RIOTBASE)/pkg/pkg.mk @@ -40,6 +40,10 @@ nimble_porting_nimble: nimble_npl_riot: $(QQ)"$(MAKE)" -C $(PDIR)/porting/npl/riot/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ +# generic modules +nimble_transport: + $(QQ)"$(MAKE)" -C $(PDIR)/nimble/transport/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ + # host modules nimble_host: $(QQ)"$(MAKE)" -C $(PDIR)/nimble/host/src/ -f $(TDIR)/nimble.host.mk @@ -61,9 +65,6 @@ nimble_svc_ipss: $(QQ)"$(MAKE)" -C $(PDIR)/nimble/host/services/ipss/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ # controller specific modules -nimble_transport_ram: - $(QQ)"$(MAKE)" -C $(PDIR)/nimble/transport/ram/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ - nimble_controller: $(QQ)"$(MAKE)" -C $(PDIR)/nimble/controller/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ diff --git a/pkg/nimble/Makefile.dep b/pkg/nimble/Makefile.dep index b199681339..ace868e962 100644 --- a/pkg/nimble/Makefile.dep +++ b/pkg/nimble/Makefile.dep @@ -3,6 +3,8 @@ USEMODULE += sema USEMODULE += event_callback USEMODULE += ztimer_msec +USEPKG += nrfx + # Requires nimble feature FEATURES_REQUIRED += ble_nimble @@ -12,6 +14,9 @@ USEMODULE += nimble_riot_contrib # RIOT port USEMODULE += nimble_porting_nimble +# Generic modules used by host and controller +USEMODULE += nimble_transport + # Pull in dependencies based on used features ifneq (,$(filter ble_phy_coded,$(FEATURES_USED))) USEMODULE += nimble_phy_coded @@ -50,7 +55,6 @@ endif # nimble controller dependencies ifneq (,$(filter nimble_controller,$(USEMODULE))) - USEMODULE += nimble_transport_ram ifneq (,$(filter nrf5%,$(CPU_FAM))) USEMODULE += nimble_drivers_nrf5x endif diff --git a/pkg/nimble/Makefile.include b/pkg/nimble/Makefile.include index c192b432e0..5efaa78946 100644 --- a/pkg/nimble/Makefile.include +++ b/pkg/nimble/Makefile.include @@ -48,9 +48,7 @@ ifneq (,$(filter nimble_host_util,$(USEMODULE))) endif # include transport headers -ifneq (,$(filter nimble_transport_ram,$(USEMODULE))) - INCLUDES += $(NIMIBASE)/nimble/transport/ram/include -endif +INCLUDES += $(NIMIBASE)/nimble/transport/include # include services ifneq (,$(filter nimble_svc_ans,$(USEMODULE))) @@ -96,6 +94,8 @@ ifneq (,$(filter nimble_autoconn,$(USEMODULE))) endif ifneq (,$(filter nimble_adv_ext,$(USEMODULE))) + # extended advertising HCI events can be up to 257 bytes + CFLAGS += -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=257 CFLAGS += -DMYNEWT_VAL_BLE_EXT_ADV=1 CFLAGS += -DMYNEWT_VAL_BLE_LL_EXT_ADV_AUX_PTR_CNT=2 CFLAGS += -DMYNEWT_VAL_BLE_LL_SCAN_AUX_SEGMENT_CNT=1 @@ -112,6 +112,10 @@ ifneq (,$(filter nimble_adv_ext,$(USEMODULE))) ifneq (-1,$(BLE_MULTI_ADV_INSTANCES)) CFLAGS += -DMYNEWT_VAL_BLE_MULTI_ADV_INSTANCES=$(BLE_MULTI_ADV_INSTANCES) endif +else + # when only using non-extended advertisements the maximum HCI event size is + # 45 bytes + CFLAGS += -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=45 endif ifneq (,$(filter nimble_netif,$(USEMODULE))) diff --git a/pkg/nimble/patches/0001-porting-nimble-silence-Wcast-align.patch b/pkg/nimble/patches/0001-porting-nimble-silence-Wcast-align.patch deleted file mode 100644 index 6cae3621a2..0000000000 Binary files a/pkg/nimble/patches/0001-porting-nimble-silence-Wcast-align.patch and /dev/null differ diff --git a/pkg/nrfx/Kconfig b/pkg/nrfx/Kconfig new file mode 100644 index 0000000000..0e43ee4acf --- /dev/null +++ b/pkg/nrfx/Kconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config PACKAGE_NRFX + bool "Nordic nrfx HAL" + depends on TEST_KCONFIG diff --git a/pkg/nrfx/Makefile b/pkg/nrfx/Makefile new file mode 100644 index 0000000000..e86c05a064 --- /dev/null +++ b/pkg/nrfx/Makefile @@ -0,0 +1,8 @@ +PKG_NAME=nrfx +PKG_URL=https://github.com/NordicSemiconductor/nrfx +PKG_VERSION=3521c97df0b9549daecf867fb588f62819c317b4 # Release 2.7.0 +PKG_LICENSE=BSD-3-Clause + +include $(RIOTBASE)/pkg/pkg.mk + +all: diff --git a/pkg/nrfx/Makefile.include b/pkg/nrfx/Makefile.include new file mode 100644 index 0000000000..0c084cb195 --- /dev/null +++ b/pkg/nrfx/Makefile.include @@ -0,0 +1,28 @@ +ifneq (,$(filter nrf51,$(CPU_FAM))) + CFLAGS += -DNRF51 +endif +ifneq (,$(filter nrf52805xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52805_XXAA +endif +ifneq (,$(filter nrf52810xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52810_XXAA +endif +ifneq (,$(filter nrf52811xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52811_XXAA +endif +ifneq (,$(filter nrf52820xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52820_XXAA +endif +ifneq (,$(filter nrf52832xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52832_XXAA +endif +ifneq (,$(filter nrf52833xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52833_XXAA +endif +ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL))) + CFLAGS += -DNRF52840_XXAA +endif + +INCLUDES += -I$(PKGDIRBASE)/nrfx +INCLUDES += -I$(PKGDIRBASE)/nrfx/mdk +INCLUDES += -I$(RIOTPKG)/nrfx/include diff --git a/pkg/nrfx/doc.txt b/pkg/nrfx/doc.txt new file mode 100644 index 0000000000..7a16e32a77 --- /dev/null +++ b/pkg/nrfx/doc.txt @@ -0,0 +1,20 @@ +/** + * @defgroup pkg_nrfx Nordic nrfx HAL + * @ingroup pkg + * @brief Provides the Nordic nrfx HAL + * + * # Introduction + * + * "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." + * + * # License + * + * Licensed under BSD-3-Clause. + * + * @see https://github.com/NordicSemiconductor/nrfx + */ diff --git a/pkg/nrfx/include/nrfx_config.h b/pkg/nrfx/include/nrfx_config.h new file mode 100644 index 0000000000..e78a506cc8 --- /dev/null +++ b/pkg/nrfx/include/nrfx_config.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2019 - 2021, Nordic Semiconductor ASA + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * 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. + */ + +/** + * @ingroup pkg_nrfx + * @{ + * + * @file + * @brief Config header for the nrfx BSP package + * + * @author Hauke Petersen + */ + +#ifndef NRFX_CONFIG_H +#define NRFX_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* as of now we are only using the plain headers of the nrfx package and there + * is nothing to configure for this */ + +#ifdef __cplusplus +} +#endif + +#endif /* NRFX_CONFIG_H */ +/** @} **/ diff --git a/pkg/nrfx/include/nrfx_glue.h b/pkg/nrfx/include/nrfx_glue.h new file mode 100644 index 0000000000..824f95c796 --- /dev/null +++ b/pkg/nrfx/include/nrfx_glue.h @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2017 - 2021, Nordic Semiconductor ASA + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * 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. + */ + +/** + * @ingroup pkg_nrfx + * @{ + * + * @file + * @brief This file contains macros that should be implemented according + * to the needs of the host environment into which nrfx is + * integrated. + * + * @author Nordic Semiconductor ASA + */ + +#ifndef NRFX_GLUE_H +#define NRFX_GLUE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Macro for placing a runtime assertion. + * + * @param expression Expression to be evaluated. + */ +#define NRFX_ASSERT(expression) + +/** + * @brief Macro for placing a compile time assertion. + * + * @param expression Expression to be evaluated. + */ +#define NRFX_STATIC_ASSERT(expression) + +/** + * @brief Macro for setting the priority of a specific IRQ. + * + * @param irq_number IRQ number. + * @param priority Priority to be set. + */ +#define NRFX_IRQ_PRIORITY_SET(irq_number, priority) + +/** + * @brief Macro for enabling a specific IRQ. + * + * @param irq_number IRQ number. + */ +#define NRFX_IRQ_ENABLE(irq_number) + +/** + * @brief Macro for checking if a specific IRQ is enabled. + * + * @param irq_number IRQ number. + * + * @retval true If the IRQ is enabled. + * @retval false Otherwise. + */ +#define NRFX_IRQ_IS_ENABLED(irq_number) + +/** + * @brief Macro for disabling a specific IRQ. + * + * @param irq_number IRQ number. + */ +#define NRFX_IRQ_DISABLE(irq_number) + +/** + * @brief Macro for setting a specific IRQ as pending. + * + * @param irq_number IRQ number. + */ +#define NRFX_IRQ_PENDING_SET(irq_number) + +/** + * @brief Macro for clearing the pending status of a specific IRQ. + * + * @param irq_number IRQ number. + */ +#define NRFX_IRQ_PENDING_CLEAR(irq_number) + +/** + * @brief Macro for checking the pending status of a specific IRQ. + * + * @retval true If the IRQ is pending. + * @retval false Otherwise. + */ +#define NRFX_IRQ_IS_PENDING(irq_number) + +/** @brief Macro for entering into a critical section. */ +#define NRFX_CRITICAL_SECTION_ENTER() + +/** @brief Macro for exiting from a critical section. */ +#define NRFX_CRITICAL_SECTION_EXIT() + +/** + * @brief When set to a non-zero value, this macro specifies that + * nrfx_coredep_delay_us uses a precise DWT-based solution. + * A compilation error is generated if the DWT unit is not present + * in the SoC used. + */ +#define NRFX_DELAY_DWT_BASED 0 + +/** + * @brief Macro for delaying the code execution for at least the specified time. + * + * @param us_time Number of microseconds to wait. + */ +#define NRFX_DELAY_US(us_time) + +/** @brief Atomic 32-bit unsigned type. */ +#define nrfx_atomic_t + +/** + * @brief Macro for storing a value to an atomic object and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value to store. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_STORE(p_data, value) + +/** + * @brief Macro for running a bitwise OR operation on an atomic object and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value of the second operand in the OR operation. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_OR(p_data, value) + +/** + * @brief Macro for running a bitwise AND operation on an atomic object + * and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value of the second operand in the AND operation. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_AND(p_data, value) + +/** + * @brief Macro for running a bitwise XOR operation on an atomic object + * and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value of the second operand in the XOR operation. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_XOR(p_data, value) + +/** + * @brief Macro for running an addition operation on an atomic object + * and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value of the second operand in the ADD operation. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_ADD(p_data, value) + +/** + * @brief Macro for running a subtraction operation on an atomic object + * and returning its previous value. + * + * @param[in] p_data Atomic memory pointer. + * @param[in] value Value of the second operand in the SUB operation. + * + * @return Previous value of the atomic object. + */ +#define NRFX_ATOMIC_FETCH_SUB(p_data, value) + +/** + * @brief Macro for running compare and swap on an atomic object. + * + * Value is updated to the new value only if it previously equaled old value. + * + * @param[in,out] p_data Atomic memory pointer. + * @param[in] old_value Expected old value. + * @param[in] new_value New value. + * + * @retval true If value was updated. + * @retval false If value was not updated because location was not equal to @p old_value. + */ +#define NRFX_ATOMIC_CAS(p_data, old_value, new_value) + +/** + * @brief Macro for counting leading zeros. + * + * @param[in] value A word value. + * + * @return Number of leading 0-bits in @p value, starting at the most significant bit position. + * If x is 0, the result is undefined. + */ +#define NRFX_CLZ(value) + +/** + * @brief Macro for counting trailing zeros. + * + * @param[in] value A word value. + * + * @return Number of trailing 0-bits in @p value, starting at the least significant bit position. + * If x is 0, the result is undefined. + */ +#define NRFX_CTZ(value) + +/** + * @brief When set to a non-zero value, this macro specifies that the + * nrfx_error_codes and the nrfx_err_t type itself are defined + * in a customized way and the default definitions from @c + * should not be used. + */ +#define NRFX_CUSTOM_ERROR_CODES 0 + +/** + * @brief When set to a non-zero value, this macro specifies that inside HALs + * the event registers are read back after clearing, on devices that + * otherwise could defer the actual register modification. + */ +#define NRFX_EVENT_READBACK_ENABLED 1 + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library. */ +#define NRFX_DPPI_CHANNELS_USED 0 + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside of the nrfx library. */ +#define NRFX_DPPI_GROUPS_USED 0 + +/** @brief Bitmask that defines PPI channels that are reserved for use outside of the nrfx library. */ +#define NRFX_PPI_CHANNELS_USED 0 + +/** @brief Bitmask that defines PPI groups that are reserved for use outside of the nrfx library. */ +#define NRFX_PPI_GROUPS_USED 0 + +/** @brief Bitmask that defines GPIOTE channels that are reserved for use outside of the nrfx library. */ +#define NRFX_GPIOTE_CHANNELS_USED 0 + +/** @brief Bitmask that defines EGU instances that are reserved for use outside of the nrfx library. */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside of the nrfx library. */ +#define NRFX_TIMERS_USED 0 + + +#ifdef __cplusplus +} +#endif + +#endif /* NRFX_GLUE_H */ +/** @} */ diff --git a/tests/nimble_ext_adv/Makefile.ci b/tests/nimble_ext_adv/Makefile.ci new file mode 100644 index 0000000000..b0a9d107df --- /dev/null +++ b/tests/nimble_ext_adv/Makefile.ci @@ -0,0 +1,8 @@ +BOARD_INSUFFICIENT_MEMORY := \ + airfy-beacon \ + calliope-mini \ + microbit \ + nrf51dongle \ + nrf6310 \ + yunjia-nrf51822 \ + #