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

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_MCUMGR=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_ZCBOR=y

CONFIG_GPIO=y

CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
# QSPI drivers are enabled by defualt for some chips.
# Disable it explicitly to be sure QSPI is disabled.
CONFIG_NORDIC_QSPI_NOR=n 


CONFIG_EVENTS=y

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_DK_LIBRARY=y

CONFIG_BT=y
#CONFIG_BT_DEBUG_LOG=n
CONFIG_BT_PERIPHERAL=y

CONFIG_BT_CTLR_PHY_CODED=y
CONFIG_BT_CTLR_ADV_EXT=y

CONFIG_BT_EXT_ADV=y
CONFIG_BT_USER_PHY_UPDATE=y

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_CIPHER=y
CONFIG_MBEDTLS_CIPHER_AES_ENABLED=y

# enable uart driver
CONFIG_SERIAL=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

#CONFIG_BT_CTLR_TX_PWR_ANTENNA=127
#CONFIG_BOOTLOADER_MCUBOOT=y

#CONFIG_PM=n

CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y
CONFIG_CONSOLE_GETCHAR_BUFSIZE=64
CONFIG_CONSOLE_PUTCHAR_BUFSIZE=512

CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_FLASH=y
#CONFIG_SPI=y
#
CONFIG_FLASH_MAP=y
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
#

CONFIG_HWINFO=y
#WDT
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=n

#FATAL HANDLER
CONFIG_BT_HCI_VS_FATAL_ERROR=n

CONFIG_MBEDTLS=y

CONFIG_COUNTER=y

CONFIG_NEWLIB_LIBC=y
CONFIG_MINIMAL_LIBC_MALLOC=n
CONFIG_HEAP_MEM_POOL_SIZE=24576
CONFIG_SYS_HEAP_RUNTIME_STATS=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y

# Device power management
CONFIG_PM_DEVICE=y

CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# ADC
CONFIG_ADC=y
CONFIG_ADC_NRFX_SAADC=y

# PWM
CONFIG_NRFX_PWM0=y

# MTU
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251