Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for nrfx_config cleanup #259

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions drivers/nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <nrfx.h>
#include "nrf_802154_config.h"
#include "nrf_802154_debug.h"
#include "hal/nrf_ppi.h"
#include "nrf_802154_sl_periphs.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -113,7 +112,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_RAMP_UP_TRIGG
#define NRF_802154_PPI_RADIO_RAMP_UP_TRIGG NRF_PPI_CHANNEL6
#define NRF_802154_PPI_RADIO_RAMP_UP_TRIGG 6U
#endif

/**
Expand All @@ -126,7 +125,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_DISABLED_TO_EGU
#define NRF_802154_PPI_RADIO_DISABLED_TO_EGU NRF_PPI_CHANNEL6
#define NRF_802154_PPI_RADIO_DISABLED_TO_EGU 6U
#endif

/**
Expand All @@ -138,7 +137,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP
#define NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP NRF_PPI_CHANNEL7
#define NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP 7U
#endif

/**
Expand All @@ -150,7 +149,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_EGU_TO_TIMER_START
#define NRF_802154_PPI_EGU_TO_TIMER_START NRF_PPI_CHANNEL8
#define NRF_802154_PPI_EGU_TO_TIMER_START 8U
#endif

/**
Expand All @@ -164,7 +163,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR
#define NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR NRF_PPI_CHANNEL9
#define NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR 9U
#endif

/**
Expand All @@ -178,7 +177,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE
#define NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE NRF_PPI_CHANNEL9
#define NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE 9U
#endif

/**
Expand All @@ -192,7 +191,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN
#define NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN NRF_PPI_CHANNEL9
#define NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN 9U
#endif

/**
Expand All @@ -205,7 +204,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_CCABUSY_TO_RADIO_CCASTART
#define NRF_802154_PPI_RADIO_CCABUSY_TO_RADIO_CCASTART NRF_PPI_CHANNEL10
#define NRF_802154_PPI_RADIO_CCABUSY_TO_RADIO_CCASTART 10U
#endif

/**
Expand All @@ -216,7 +215,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_RADIO_SYNC_TO_EGU_SYNC
#define NRF_802154_PPI_RADIO_SYNC_TO_EGU_SYNC NRF_PPI_CHANNEL11
#define NRF_802154_PPI_RADIO_SYNC_TO_EGU_SYNC 11U
#endif

#define NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK \
Expand All @@ -231,7 +230,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_CORE_GROUP
#define NRF_802154_PPI_CORE_GROUP NRF_PPI_CHANNEL_GROUP0
#define NRF_802154_PPI_CORE_GROUP 0U
#endif

/**
Expand All @@ -241,7 +240,7 @@ extern "C" {
*
*/
#ifndef NRF_802154_PPI_ABORT_GROUP
#define NRF_802154_PPI_ABORT_GROUP NRF_PPI_CHANNEL_GROUP1
#define NRF_802154_PPI_ABORT_GROUP 1U
#endif

/**
Expand Down
71 changes: 71 additions & 0 deletions nrfx/templates/nrfx_config_nrf5340_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,73 @@
* The following section provides configuration for the name translation.
* It must be modified to reflect the actual configuration set in NRF_SPU.
*/

#if defined(NRF_TRUSTZONE_NONSECURE)
#define NRF_CLOCK NRF_CLOCK_NS
#define NRF_COMP NRF_COMP_NS
#define NRF_DCNF NRF_DCNF_NS
#define NRF_DPPIC NRF_DPPIC_NS
#define NRF_EGU0 NRF_EGU0_NS
#define NRF_EGU1 NRF_EGU1_NS
#define NRF_EGU2 NRF_EGU2_NS
#define NRF_EGU3 NRF_EGU3_NS
#define NRF_EGU4 NRF_EGU4_NS
#define NRF_EGU5 NRF_EGU5_NS
#define NRF_FPU NRF_FPU_NS
#define NRF_I2S0 NRF_I2S0_NS
#define NRF_IPC NRF_IPC_NS
#define NRF_KMU NRF_KMU_NS
#define NRF_LPCOMP NRF_LPCOMP_NS
#define NRF_MUTEX NRF_MUTEX_NS
#define NRF_NFCT NRF_NFCT_NS
#define NRF_NVMC NRF_NVMC_NS
#define NRF_OSCILLATORS NRF_OSCILLATORS_NS
#define NRF_P0 NRF_P0_NS
#define NRF_P1 NRF_P1_NS
#define NRF_PDM0 NRF_PDM0_NS
#define NRF_POWER NRF_POWER_NS
#define NRF_PWM0 NRF_PWM0_NS
#define NRF_PWM1 NRF_PWM1_NS
#define NRF_PWM2 NRF_PWM2_NS
#define NRF_PWM3 NRF_PWM3_NS
#define NRF_QDEC0 NRF_QDEC0_NS
#define NRF_QDEC1 NRF_QDEC1_NS
#define NRF_QSPI NRF_QSPI_NS
#define NRF_REGULATORS NRF_REGULATORS_NS
#define NRF_RESET NRF_RESET_NS
#define NRF_RTC0 NRF_RTC0_NS
#define NRF_RTC1 NRF_RTC1_NS
#define NRF_SAADC NRF_SAADC_NS
#define NRF_SPIM0 NRF_SPIM0_NS
#define NRF_SPIM1 NRF_SPIM1_NS
#define NRF_SPIM2 NRF_SPIM2_NS
#define NRF_SPIM3 NRF_SPIM3_NS
#define NRF_SPIM4 NRF_SPIM4_NS
#define NRF_SPIS0 NRF_SPIS0_NS
#define NRF_SPIS1 NRF_SPIS1_NS
#define NRF_SPIS2 NRF_SPIS2_NS
#define NRF_SPIS3 NRF_SPIS3_NS
#define NRF_TIMER0 NRF_TIMER0_NS
#define NRF_TIMER1 NRF_TIMER1_NS
#define NRF_TIMER2 NRF_TIMER2_NS
#define NRF_TWIM0 NRF_TWIM0_NS
#define NRF_TWIM1 NRF_TWIM1_NS
#define NRF_TWIM2 NRF_TWIM2_NS
#define NRF_TWIM3 NRF_TWIM3_NS
#define NRF_TWIS0 NRF_TWIS0_NS
#define NRF_TWIS1 NRF_TWIS1_NS
#define NRF_TWIS2 NRF_TWIS2_NS
#define NRF_TWIS3 NRF_TWIS3_NS
#define NRF_UARTE0 NRF_UARTE0_NS
#define NRF_UARTE1 NRF_UARTE1_NS
#define NRF_UARTE2 NRF_UARTE2_NS
#define NRF_UARTE3 NRF_UARTE3_NS
#define NRF_USBD NRF_USBD_NS
#define NRF_USBREGULATOR NRF_USBREGULATOR_NS
#define NRF_VMC NRF_VMC_NS
#define NRF_WDT0 NRF_WDT0_NS
#define NRF_WDT1 NRF_WDT1_NS
#else
#define NRF_CLOCK NRF_CLOCK_S
#define NRF_COMP NRF_COMP_S
#define NRF_DCNF NRF_DCNF_S
Expand Down Expand Up @@ -110,6 +177,7 @@
#define NRF_VMC NRF_VMC_S
#define NRF_WDT0 NRF_WDT0_S
#define NRF_WDT1 NRF_WDT1_S
#endif

/*
* The following section provides the name translation for peripherals with
Expand All @@ -126,6 +194,9 @@
#define NRF_SPU NRF_SPU_S
#define NRF_TAD NRF_TAD_S
#define NRF_UICR NRF_UICR_S
#define NRF_GPIOTE NRF_GPIOTE0
#else
#define NRF_GPIOTE NRF_GPIOTE1
#endif

/* Fixups for the GPIOTE driver. */
Expand Down
56 changes: 56 additions & 0 deletions nrfx/templates/nrfx_config_nrf91.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,58 @@
* The following section provides configuration for the name translation.
* It must be modified to reflect the actual configuration set in NRF_SPU.
*/

#if defined(NRF_TRUSTZONE_NONSECURE)
#define NRF_CLOCK NRF_CLOCK_NS
#define NRF_DPPIC NRF_DPPIC_NS
#define NRF_EGU0 NRF_EGU0_NS
#define NRF_EGU1 NRF_EGU1_NS
#define NRF_EGU2 NRF_EGU2_NS
#define NRF_EGU3 NRF_EGU3_NS
#define NRF_EGU4 NRF_EGU4_NS
#define NRF_EGU5 NRF_EGU5_NS
#define NRF_FPU NRF_FPU_NS
#define NRF_I2S NRF_I2S_NS
#define NRF_IPC NRF_IPC_NS
#define NRF_KMU NRF_KMU_NS
#define NRF_NVMC NRF_NVMC_NS
#define NRF_P0 NRF_P0_NS
#define NRF_PDM NRF_PDM_NS
#define NRF_POWER NRF_POWER_NS
#define NRF_PWM0 NRF_PWM0_NS
#define NRF_PWM1 NRF_PWM1_NS
#define NRF_PWM2 NRF_PWM2_NS
#define NRF_PWM3 NRF_PWM3_NS
#define NRF_REGULATORS NRF_REGULATORS_NS
#define NRF_RTC0 NRF_RTC0_NS
#define NRF_RTC1 NRF_RTC1_NS
#define NRF_SAADC NRF_SAADC_NS
#define NRF_SPIM0 NRF_SPIM0_NS
#define NRF_SPIM1 NRF_SPIM1_NS
#define NRF_SPIM2 NRF_SPIM2_NS
#define NRF_SPIM3 NRF_SPIM3_NS
#define NRF_SPIS0 NRF_SPIS0_NS
#define NRF_SPIS1 NRF_SPIS1_NS
#define NRF_SPIS2 NRF_SPIS2_NS
#define NRF_SPIS3 NRF_SPIS3_NS
#define NRF_TIMER0 NRF_TIMER0_NS
#define NRF_TIMER1 NRF_TIMER1_NS
#define NRF_TIMER2 NRF_TIMER2_NS
#define NRF_TWIM0 NRF_TWIM0_NS
#define NRF_TWIM1 NRF_TWIM1_NS
#define NRF_TWIM2 NRF_TWIM2_NS
#define NRF_TWIM3 NRF_TWIM3_NS
#define NRF_TWIS0 NRF_TWIS0_NS
#define NRF_TWIS1 NRF_TWIS1_NS
#define NRF_TWIS2 NRF_TWIS2_NS
#define NRF_TWIS3 NRF_TWIS3_NS
#define NRF_UARTE0 NRF_UARTE0_NS
#define NRF_UARTE1 NRF_UARTE1_NS
#define NRF_UARTE2 NRF_UARTE2_NS
#define NRF_UARTE3 NRF_UARTE3_NS
#define NRF_VMC NRF_VMC_NS
#define NRF_WDT NRF_WDT_NS
#else
#define NRF_CLOCK NRF_CLOCK_S
#define NRF_DPPIC NRF_DPPIC_S
#define NRF_EGU0 NRF_EGU0_S
Expand Down Expand Up @@ -95,6 +147,7 @@
#define NRF_UARTE3 NRF_UARTE3_S
#define NRF_VMC NRF_VMC_S
#define NRF_WDT NRF_WDT_S
#endif

/*
* The following section provides the name translation for peripherals with
Expand All @@ -109,6 +162,9 @@
#define NRF_SPU NRF_SPU_S
#define NRF_TAD NRF_TAD_S
#define NRF_UICR NRF_UICR_S
#define NRF_GPIOTE NRF_GPIOTE0
#else
#define NRF_GPIOTE NRF_GPIOTE1
#endif

/* Fixups for the GPIOTE driver. */
Expand Down