diff --git a/ext/hal/nordic/CMakeLists.txt b/ext/hal/nordic/CMakeLists.txt index aa0a92ebeae..a65656a696c 100644 --- a/ext/hal/nordic/CMakeLists.txt +++ b/ext/hal/nordic/CMakeLists.txt @@ -28,6 +28,7 @@ if(CONFIG_HAS_NRFX) zephyr_sources_ifdef(CONFIG_NRFX_SPI nrfx/drivers/src/nrfx_spi.c) zephyr_sources_ifdef(CONFIG_NRFX_SPIM nrfx/drivers/src/nrfx_spim.c) zephyr_sources_ifdef(CONFIG_NRFX_SPIS nrfx/drivers/src/nrfx_spis.c) + zephyr_sources_ifdef(CONFIG_NRFX_TIMER nrfx/drivers/src/nrfx_timer.c) zephyr_sources_ifdef(CONFIG_NRFX_TWI nrfx/drivers/src/nrfx_twi.c) zephyr_sources_ifdef(CONFIG_NRFX_TWIM nrfx/drivers/src/nrfx_twim.c) zephyr_sources_ifdef(CONFIG_NRFX_UART nrfx/drivers/src/nrfx_uart.c) diff --git a/ext/hal/nordic/Kconfig b/ext/hal/nordic/Kconfig index 11d13ffdabf..ec3a41882f3 100644 --- a/ext/hal/nordic/Kconfig +++ b/ext/hal/nordic/Kconfig @@ -31,6 +31,29 @@ config NRFX_SPIM config NRFX_SPIS bool +config NRFX_TIMER + bool + +config NRFX_TIMER0 + bool + select NRFX_TIMER + +config NRFX_TIMER1 + bool + select NRFX_TIMER + +config NRFX_TIMER2 + bool + select NRFX_TIMER + +config NRFX_TIMER3 + bool + select NRFX_TIMER + +config NRFX_TIMER4 + bool + select NRFX_TIMER + config NRFX_TWI bool diff --git a/ext/hal/nordic/nrfx_config_nrf51.h b/ext/hal/nordic/nrfx_config_nrf51.h index 27cd7530314..dd7b8c35e34 100644 --- a/ext/hal/nordic/nrfx_config_nrf51.h +++ b/ext/hal/nordic/nrfx_config_nrf51.h @@ -1160,28 +1160,28 @@ // NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver //========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER +#define NRFX_TIMER_ENABLED 1 #endif // NRFX_TIMER0_ENABLED - Enable TIMER0 instance -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER0 +#define NRFX_TIMER0_ENABLED 1 #endif // NRFX_TIMER1_ENABLED - Enable TIMER1 instance -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER1 +#define NRFX_TIMER1_ENABLED 1 #endif // NRFX_TIMER2_ENABLED - Enable TIMER2 instance -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER2 +#define NRFX_TIMER2_ENABLED 1 #endif // NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode diff --git a/ext/hal/nordic/nrfx_config_nrf52810.h b/ext/hal/nordic/nrfx_config_nrf52810.h index 9450b692f2e..f13f5959e7f 100644 --- a/ext/hal/nordic/nrfx_config_nrf52810.h +++ b/ext/hal/nordic/nrfx_config_nrf52810.h @@ -1530,28 +1530,28 @@ // NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver //========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER +#define NRFX_TIMER_ENABLED 1 #endif // NRFX_TIMER0_ENABLED - Enable TIMER0 instance -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER0 +#define NRFX_TIMER0_ENABLED 1 #endif // NRFX_TIMER1_ENABLED - Enable TIMER1 instance -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER1 +#define NRFX_TIMER1_ENABLED 1 #endif // NRFX_TIMER2_ENABLED - Enable TIMER2 instance -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER2 +#define NRFX_TIMER2_ENABLED 1 #endif // NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode diff --git a/ext/hal/nordic/nrfx_config_nrf52832.h b/ext/hal/nordic/nrfx_config_nrf52832.h index 874bc523695..ab2074b0fe5 100644 --- a/ext/hal/nordic/nrfx_config_nrf52832.h +++ b/ext/hal/nordic/nrfx_config_nrf52832.h @@ -2138,42 +2138,42 @@ // NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver //========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER +#define NRFX_TIMER_ENABLED 1 #endif // NRFX_TIMER0_ENABLED - Enable TIMER0 instance -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER0 +#define NRFX_TIMER0_ENABLED 1 #endif // NRFX_TIMER1_ENABLED - Enable TIMER1 instance -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER1 +#define NRFX_TIMER1_ENABLED 1 #endif // NRFX_TIMER2_ENABLED - Enable TIMER2 instance -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER2 +#define NRFX_TIMER2_ENABLED 1 #endif // NRFX_TIMER3_ENABLED - Enable TIMER3 instance -#ifndef NRFX_TIMER3_ENABLED -#define NRFX_TIMER3_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER3 +#define NRFX_TIMER3_ENABLED 1 #endif // NRFX_TIMER4_ENABLED - Enable TIMER4 instance -#ifndef NRFX_TIMER4_ENABLED -#define NRFX_TIMER4_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER4 +#define NRFX_TIMER4_ENABLED 1 #endif // NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode diff --git a/ext/hal/nordic/nrfx_config_nrf52840.h b/ext/hal/nordic/nrfx_config_nrf52840.h index c01bd4092fc..a0f28ab7294 100644 --- a/ext/hal/nordic/nrfx_config_nrf52840.h +++ b/ext/hal/nordic/nrfx_config_nrf52840.h @@ -2241,42 +2241,42 @@ // NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver //========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER +#define NRFX_TIMER_ENABLED 1 #endif // NRFX_TIMER0_ENABLED - Enable TIMER0 instance -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER0 +#define NRFX_TIMER0_ENABLED 1 #endif // NRFX_TIMER1_ENABLED - Enable TIMER1 instance -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER1 +#define NRFX_TIMER1_ENABLED 1 #endif // NRFX_TIMER2_ENABLED - Enable TIMER2 instance -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER2 +#define NRFX_TIMER2_ENABLED 1 #endif // NRFX_TIMER3_ENABLED - Enable TIMER3 instance -#ifndef NRFX_TIMER3_ENABLED -#define NRFX_TIMER3_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER3 +#define NRFX_TIMER3_ENABLED 1 #endif // NRFX_TIMER4_ENABLED - Enable TIMER4 instance -#ifndef NRFX_TIMER4_ENABLED -#define NRFX_TIMER4_ENABLED 0 +#ifdef CONFIG_NRFX_TIMER4 +#define NRFX_TIMER4_ENABLED 1 #endif // NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode