# Copyright (c) 2016 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config HAS_NRFX
	bool

menu "nrfx drivers"
	depends on HAS_NRFX

config NRF_DONT_USE_STABLE_BSP
	bool

rsource "Kconfig.logging"

config NRFX_ADC
	bool "ADC driver"
	depends on $(dt_nodelabel_exists,adc) && SOC_SERIES_NRF51

config NRFX_BELLBOARD
	bool "BELLBOARD driver"

config NRFX_CLOCK
	bool "CLOCK driver"
	depends on $(dt_nodelabel_exists,clock) || \
		$(dt_nodelabel_exists,hfclk) || \
		$(dt_nodelabel_exists,hfclk192m) || \
		$(dt_nodelabel_exists,hfclkaudio) || \
		$(dt_nodelabel_exists,lfclk) || \
		$(dt_nodelabel_exists,xo) || \
		$(dt_nodelabel_exists,xo24m)

config NRFX_CLOCK_HFCLK
	bool "HFCLK driver"
	depends on $(dt_nodelabel_exists,hfclk) || CLOCK_CONTROL_NRF

config NRFX_CLOCK_HFCLK192M
	bool "HFCLK192M driver"
	depends on $(dt_nodelabel_exists,hfclk192m) || CLOCK_CONTROL_NRF

config NRFX_CLOCK_HFCLKAUDIO
	bool "HFCLKAUDIO driver"
	depends on $(dt_nodelabel_exists,hfclkaudio) || CLOCK_CONTROL_NRF

config NRFX_CLOCK_LFCLK
	bool "LFCLK driver"
	depends on $(dt_nodelabel_exists,lfclk) || CLOCK_CONTROL_NRF

if NRFX_CLOCK_LFCLK

if CLOCK_CONTROL_NRF

config NRFX_CLOCK_USE_LFRC_CALIBRATION
	bool "Extend NRFX_CLOCK to use LFRC peripheral"
	select DEPRECATED

config NRFX_CLOCK_LF_CAL_ENABLED
	bool "LFRC Calibration enabled"
	select DEPRECATED

config NRFX_CLOCK_LF_SRC_RC
	bool "RC Oscillator"
	select DEPRECATED

config NRFX_CLOCK_LF_SRC_XTAL
	bool "Crystal Oscillator"
	select DEPRECATED

config NRFX_CLOCK_LF_SRC_SYNTH
	depends on !SOC_SERIES_NRF91X
	bool "Synthesized from HFCLK"
	select DEPRECATED

config NRFX_CLOCK_LF_SRC_LOW_SWING
	depends on SOC_SERIES_NRF52X
	bool "External low swing"
	select DEPRECATED

config NRFX_CLOCK_LF_SRC_FULL_SWING
	depends on SOC_SERIES_NRF52X
	bool "External full swing"
	select DEPRECATED

config NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED
	bool "Two stage start sequence of the low frequency clock"
	select DEPRECATED

endif # CLOCK_CONTROL_NRF

if !CLOCK_CONTROL_NRF

config NRFX_CLOCK_LFCLK_USE_LFRC_CALIBRATION
	bool "Extend NRFX_CLOCK to use LFRC peripheral"

endif # !CLOCK_CONTROL_NRF

endif # NRFX_CLOCK_LFCLK

config NRFX_CLOCK_XO
	bool "XO driver"
	depends on $(dt_nodelabel_exists,xo) || CLOCK_CONTROL_NRF

config NRFX_CLOCK_XO24M
	bool "XO24M driver"
	depends on $(dt_nodelabel_exists,xo24m) || CLOCK_CONTROL_NRF

config NRFX_COMP
	bool "COMP driver"
	depends on $(dt_nodelabel_exists,comp)

config NRFX_CRACEN
	bool "CRACEN drivers"
	depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF71
	select NRFX_CRACEN_BSIM_SUPPORT if SOC_SERIES_BSIM_NRFXX

config NRFX_CRACEN_BSIM_SUPPORT
	bool

config NRFX_EGU
	bool "EGU driver"

config NRFX_GPIOTE
	bool "GPIOTE driver"

config NRFX_GPIOTE_NONUNIFORM_INSTANCES
	def_bool $(dt_nodelabel_enabled,gpiote0)
	depends on $(dt_nodelabel_bool_prop,gpiote0,fixed-channels-supported)

config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS
	int "Number of event handlers"
	depends on NRFX_GPIOTE
	range 1 15
	help
	  Specifies number of handlers that can be registered to nrfx_gpiote driver
	  by the user.

config NRFX_GPPI
	bool "Generic PPI layer"
	help
	   Enable the nrfx_gppi utilities providing unified API for creating PPI
	   connections across SoC families.

config NRFX_GPPI_V1
	bool "GPPI layer legacy"
	depends on NRFX_GPPI
	help
	  When enabled then legacy version of Generic PPI layer is used.

config NRFX_GPPI_SD2PPI_GLOBAL
	bool
	depends on NRFX_GPPI && !NRFX_GPPI_V1
	help
	  Indicates GPPI implementation for SD^2PPI (Secure multi-Domain DPPI) architecture.
	  SD^2PPI architecture is using multiple instances of DPPI controllers and Ironside service
	  to configure the security and ownership of the PPI resources.

config NRFX_GRTC
	bool "GRTC driver"
	depends on $(dt_nodelabel_exists,grtc)

config NRFX_I2S
	bool "I2S driver"

config NRFX_IPC
	bool "IPC driver"
	depends on $(dt_nodelabel_exists,ipc)

config NRFX_KMU
	bool "Key Management Unit driver"
	help
	   Enable the nrfx_kmu driver.

config NRFX_LPCOMP
	bool "LPCOMP driver"
	depends on $(dt_nodelabel_exists,comp) && !SOC_NRF52810 && !SOC_NRF52811 && !SOC_NRF52820

config NRFX_MRAMC
	bool "MRAMC driver"
	depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_MRAMC)) || $(dt_has_compat,$(DT_COMPAT_NORDIC_MRAM))

config NRFX_NFCT
	bool "NFCT driver"
	depends on $(dt_nodelabel_exists,nfct)
	select NRFX_TIMER

config NRFX_NVMC
	bool "NVMC driver"
	depends on $(dt_nodelabel_exists,flash_controller)

config NRFX_PDM
	bool "PDM driver"

config NRFX_POWER
	bool "POWER driver"
	depends on $(dt_nodelabel_exists,power)
	# On SoCs featuring the USBREG peripheral, the POWER driver uses
	# internally the USBREG driver.
	select NRFX_USBREG if $(dt_nodelabel_exists,usbreg)

config NRFX_PWM
	bool "PWM driver"

config NRFX_QDEC
	bool "QDEC driver"

config NRFX_QSPI
	bool "QSPI driver"
	depends on $(dt_nodelabel_exists,qspi)

config NRFX_RNG
	bool "RNG driver"
	depends on $(dt_nodelabel_exists,rng)

config NRFX_RRAMC
	bool "RRAMC driver"
	depends on $(dt_nodelabel_exists,rram_controller)

config NRFX_RTC
	bool "RTC driver"

config NRFX_SAADC
	bool "SAADC driver"
	depends on $(dt_nodelabel_exists,adc) && !SOC_SERIES_NRF51

config NRFX_SPI
	bool "SPI driver"

config NRFX_SPIM
	bool "SPIM driver"
	depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIM))

config NRFX_SPIS
	bool "SPIS driver"
	depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIS))

config NRFX_SYSTICK
	bool "SYSTICK driver"
	depends on CPU_CORTEX_M_HAS_SYSTICK

config NRFX_TBM
	bool "TBM driver"
	depends on $(dt_nodelabel_exists,tbm)

config NRFX_TDM
	bool "TDM driver"

config NRFX_TEMP
	bool "TEMP driver"
	depends on $(dt_nodelabel_exists,temp)

config NRFX_TIMER
	bool "TIMER driver"

config NRFX_TWI
	bool "NRFX driver for TWI peripheral"

config NRFX_TWIM
	bool "NRFX driver for TWIM peripheral"

config NRFX_TWIS
	bool "NRFX driver for TWIS peripheral"

config NRFX_UART
	bool "UART driver"

config NRFX_UARTE
	bool "UARTE driver"

config NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG
	bool "UARTE GPIO configuration support"
	depends on NRFX_UARTE

config NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG
	bool "UARTE PSEL configuration support"
	depends on NRFX_UARTE

config NRFX_UARTE_CONFIG_TX_LINK
	bool "UARTE TX transfer linking support"
	depends on NRFX_UARTE

config NRFX_UARTE_CONFIG_RX_CACHE_ENABLED
	bool "UARTE RX caching support"
	depends on NRFX_UARTE
	help
	  Feature might be enabled on platforms which has limitations regarding addresses
	  to which receiver can write data. If enabled then internal driver buffers
	  (cache buffers) are used for DMA transfers and data is copied to the user buffer.

config NRFX_USBREG
	bool "USBREG driver"
	depends on $(dt_nodelabel_exists,usbreg)

config NRFX_WDT
	bool "WDT driver"

menu "Peripheral Resource Sharing module"

config NRFX_PRS
	bool

config NRFX_PRS_BOX_0
	bool "PRS box 0"
	select NRFX_PRS

config NRFX_PRS_BOX_1
	bool "PRS box 1"
	select NRFX_PRS

config NRFX_PRS_BOX_2
	bool "PRS box 2"
	select NRFX_PRS

config NRFX_PRS_BOX_3
	bool "PRS box 3"
	select NRFX_PRS

config NRFX_PRS_BOX_4
	bool "PRS box 4"
	select NRFX_PRS

config NRFX_PRS_BOX_5
	bool "PRS box 5"
	select NRFX_PRS

config NRFX_PRS_BOX_6
	bool "PRS box 6"
	select NRFX_PRS

config NRFX_PRS_BOX_7
	bool "PRS box 7"
	select NRFX_PRS

config NRFX_PRS_BOX_8
	bool "PRS box 8"
	select NRFX_PRS

config NRFX_PRS_BOX_9
	bool "PRS box 9"
	select NRFX_PRS

endmenu

config NRFX_RESERVED_RESOURCES_HEADER
	string
	default "nrfx_reserved_resources.h"

endmenu # "nrfx drivers"
