summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/nrf/nrfx_config.h53
1 files changed, 29 insertions, 24 deletions
diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h
index 71889c890..d8a7d521d 100644
--- a/ports/nrf/nrfx_config.h
+++ b/ports/nrf/nrfx_config.h
@@ -50,9 +50,9 @@
#define NRFX_GPIOTE_ENABLED 1
#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1
#if NRF51
-#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 3
+ #define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 3
#else
-#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6
+ #define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6
#endif
#define NRFX_UART_ENABLED 1
@@ -62,20 +62,20 @@
#define NRFX_TWI0_ENABLED 1
#define NRFX_TWI1_ENABLED 1
-#if defined(NRF51)
-
-#define NRFX_SPI_ENABLED (MICROPY_PY_MACHINE_HW_SPI)
-#define NRFX_SPI0_ENABLED 1
-#define NRFX_SPI1_ENABLED 1
-
-#else
-
-#define NRFX_SPIM_ENABLED (MICROPY_PY_MACHINE_HW_SPI)
-#define NRFX_SPIM0_ENABLED 1
-#define NRFX_SPIM1_ENABLED 1
-#define NRFX_SPIM2_ENABLED 1
-#define NRFX_SPIM3_ENABLED (NRF52840)
-
+#if defined(NRF51) || defined(NRF52832)
+ #define NRFX_SPI_ENABLED (MICROPY_PY_MACHINE_HW_SPI)
+ #define NRFX_SPI0_ENABLED 1
+ #define NRFX_SPI1_ENABLED 1
+
+ #if defined(NRF52832)
+ #define NRFX_SPI2_ENABLED 1
+ #endif
+#elif defined(NRF52840)
+ #define NRFX_SPIM_ENABLED (MICROPY_PY_MACHINE_HW_SPI)
+ #define NRFX_SPIM0_ENABLED 1
+ #define NRFX_SPIM1_ENABLED 1
+ #define NRFX_SPIM2_ENABLED 1
+ #define NRFX_SPIM3_ENABLED (NRF52840)
#endif // NRF51
// 0 NRF_GPIO_PIN_NOPULL
@@ -104,15 +104,20 @@
#define NRFX_PWM3_ENABLED (NRF52840)
// Peripheral Resource Sharing
-#if defined(NRF51)
-#define NRFX_PRS_BOX_0_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI0_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI0_ENABLED)
-#define NRFX_PRS_BOX_1_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI1_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI1_ENABLED)
-#else
-#define NRFX_PRS_BOX_0_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI0_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM0_ENABLED)
-#define NRFX_PRS_BOX_1_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI1_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM1_ENABLED)
-#define NRFX_PRS_BOX_2_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI2_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM2_ENABLED)
+#if defined(NRF51) || defined(NRF52832)
+ #define NRFX_PRS_BOX_0_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI0_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI0_ENABLED)
+ #define NRFX_PRS_BOX_1_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI1_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI1_ENABLED)
+
+ #if defined(NRF52832)
+ #define NRFX_PRS_BOX_2_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI1_ENABLED && NRFX_SPI_ENABLED && NRFX_SPI1_ENABLED)
+ #endif
+#elif defined(NRF52840)
+ #define NRFX_PRS_BOX_0_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI0_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM0_ENABLED)
+ #define NRFX_PRS_BOX_1_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI1_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM1_ENABLED)
+ #define NRFX_PRS_BOX_2_ENABLED (NRFX_TWI_ENABLED && NRFX_TWI2_ENABLED && NRFX_SPIM_ENABLED && NRFX_SPIM2_ENABLED)
#endif
-#define NRFX_PRS_ENABLED (NRFX_PRS_BOX_0_ENABLED || NRFX_PRS_BOX_1_ENABLED)
+
+#define NRFX_PRS_ENABLED (NRFX_PRS_BOX_0_ENABLED || NRFX_PRS_BOX_1_ENABLED || NRFX_PRS_BOX_2_ENABLED)
#define NRFX_SAADC_ENABLED !(NRF51) && (MICROPY_PY_MACHINE_ADC)
#define NRFX_ADC_ENABLED (NRF51) && (MICROPY_PY_MACHINE_ADC)