#
# Copyright (c) 2019 - 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config MPSL_THREAD_COOP_PRIO
	int
	default 0 if NET_L2_OPENTHREAD
	default BT_CTLR_SDC_RX_PRIO if BT_LL_SOFTDEVICE
	default 8

config NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE
	int
	depends on NRF52_ANOMALY_109_WORKAROUND
	default 4
	help
	  Update default EGU instance used by the nRF52 Anomaly 109 workaround
	  for PWM. The EGU instance 5 is used by the MPSL.

config MPSL_WORK_STACK_SIZE
	int "Size of the work handler thread stack"
	default 1024
	help
	  Size of the work handler thread stack, used to process work in MPSL
	  low priority context.

config MPSL_TIMESLOT_SESSION_COUNT
	int "Number of timeslot sessions"
	default 0
	help
	  Maximum number of timeslot sessions.

config MPSL_ASSERT_HANDLER
	bool "Application defined assertion handler"
	help
	  This option enables an application-defined sink for the
	  MPSL assertion mechanism. This must be defined in
	  application code and will be invoked whenever the
	  MPSL code encounters an unrecoverable error.

config MPSL_DYNAMIC_INTERRUPTS
	bool "Use direct dynamic interrupts for MPSL IRQ handlers"
	depends on DYNAMIC_DIRECT_INTERRUPTS
	help
	  This option configures MPSL IRQ handlers using direct dynamic
	  interrupts. This allows reconfiguring TIMER0_IRQn, RTC0_IRQn,
	  and RADIO_IRQn handlers during runtime when MPSL is uninitialized.

config MPSL_TRIGGER_IPC_TASK_ON_RTC_START
	bool "Trigger an IPC task when the RTC starts"
	depends on SOC_NRF5340_CPUNET
	help
	  This option configures MPSL to trigger an IPC task at the time the
	  RTC starts. This can be used for synchronizing time betwen the
	  application and network core.

config MPSL_TRIGGER_IPC_TASK_ON_RTC_START_CHANNEL
	int "IPC channel to trigger on IPC start"
	depends on MPSL_TRIGGER_IPC_TASK_ON_RTC_START
	default 4
	help
	  The channel that will be triggered when the RTC starts.
	  The application core part of the code needs to be aware of
	  which channel is used.

config MPSL_LOW_PRIO_IRQN
	int
	default 25 if SOC_COMPATIBLE_NRF52X # SWI5
	default 26 if SOC_COMPATIBLE_NRF53X # SWI0
	default 404 if SOC_SERIES_NRF54HX # QDEC130
	default 28 if SOC_SERIES_NRF54LX # SWI00
	help
	  This option sets the low priority interrupt that MPSL will use.
	  Check the interrupt number in the MDK

module=MPSL
module-str=MPSL
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
