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

menuconfig MODEM_ANTENNA
	bool "Modem antenna configuration"
	depends on NRF_MODEM_LIB
	default y if BOARD_NRF9160DK_NRF9160_NS
	default y if BOARD_NRF9161DK_NRF9161_NS
	default y if BOARD_NRF9151DK_NRF9151_NS
	default y if BOARD_THINGY91_NRF9160_NS

if MODEM_ANTENNA

choice
	default MODEM_ANTENNA_GNSS_ONBOARD
	prompt "Select which antenna to use for GNSS"

config MODEM_ANTENNA_GNSS_ONBOARD
	bool "Use onboard antenna"

config MODEM_ANTENNA_GNSS_EXTERNAL
	bool "Use external antenna"

endchoice

config MODEM_ANTENNA_AT_MAGPIO
	string "AT%XMAGPIO command"
	default "AT\%XMAGPIO=1,0,0,1,1,1574,1577" if BOARD_NRF9160DK_NRF9160_NS
	default "AT\%XMAGPIO=1,1,1,7,1,746,803,2,698,748,2,1710,2200,3,824,894,4,880,960,5,791,849,7,1565,1586" if BOARD_THINGY91_NRF9160_NS
	help
	  Defines the AT%XMAGPIO command to be sent to the modem. Leave
	  empty if this command should not be sent.

config MODEM_ANTENNA_AT_COEX0
	string "AT%XCOEX0 command"
	default "AT\%XCOEX0=1,1,1565,1586" if MODEM_ANTENNA_GNSS_ONBOARD
	default "AT\%XCOEX0" if MODEM_ANTENNA_GNSS_EXTERNAL
	help
	  Defines the AT%XCOEX0 command to be sent to the modem. Leave
	  empty if this command should not be sent.

config MODEM_ANTENNA_AT_MIPIRFFEDEV
	string "AT%XMIPIRFFEDEV command"
	help
	  Defines the AT%XMIPIRFFEDEV command to be sent to the modem. Leave
	  empty if this command should not be sent.

config MODEM_ANTENNA_AT_MIPIRFFECTRL_INIT
	string "AT%XMIPIRFFECTRL command (INIT)"
	help
	  Defines the AT%XMIPIRFFECTRL command to be sent to the modem for INIT phase.
	  Leave empty if this command should not be sent.

config MODEM_ANTENNA_AT_MIPIRFFECTRL_ON
	string "AT%XMIPIRFFECTRL command (ON)"
	help
	  Defines the AT%XMIPIRFFECTRL command to be sent to the modem for ON phase.
	  Leave empty if this command should not be sent.

config MODEM_ANTENNA_AT_MIPIRFFECTRL_OFF
	string "AT%XMIPIRFFECTRL command (OFF)"
	help
	  Defines the AT%XMIPIRFFECTRL command to be sent to the modem for OFF phase.
	  Leave empty if this command should not be sent.

config MODEM_ANTENNA_AT_MIPIRFFECTRL_PWROFF
	string "AT%XMIPIRFFECTRL command (PWROFF)"
	help
	  Defines the AT%XMIPIRFFECTRL command to be sent to the modem for PWROFF phase.
	  Leave empty if this command should not be sent.

module=MODEM_ANTENNA
module-dep=LOG
module-str=Modem antenna
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

endif # MODEM_ANTENNA
