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

CONFIG_KERNEL_BIN_NAME="rmiot_is_lte"

# Enable the UART driver
# CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_NRFX_UARTE1=y
# CONFIG_SERIAL=y

CONFIG_UART_1_INTERRUPT_DRIVEN=y
CONFIG_UART_1_NRF_TX_BUFFER_SIZE=4096

# CONFIG_UART_1_ASYNC=y
# CONFIG_UART_1_INTERRUPT_DRIVEN=n
# CONFIG_UART_1_NRF_HW_ASYNC=y
# CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
# CONFIG_NRFX_TIMER2=y

CONFIG_GPIO=y

# Make sure printk is printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_HEAP_MEM_POOL_SIZE=32768
CONFIG_MAIN_STACK_SIZE=8192

CONFIG_BT=y
CONFIG_BT_SMP=y
CONFIG_BT_SMP_SC_ONLY=y
CONFIG_BT_BONDABLE=n
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="RMIoT"
CONFIG_BT_DEVICE_APPEARANCE=1366
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_RX_STACK_SIZE=4096
CONFIG_BT_CONN_CTX=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME_MAX=11

# CONFIG_LOG_BACKEND_UART_BUFFER_SIZE=1024

# Enable the NUS service
CONFIG_BT_NUS=y
# CONFIG_BT_NUS_UART_BUFFER_SIZE=1024
CONFIG_SHELL_BT_NUS=y
CONFIG_BT_L2CAP_TX_MTU=251
CONFIG_SHELL_BT_NUS_TX_RING_BUFFER_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

CONFIG_MPSL_WORK_STACK_SIZE=4096
 
# Enable bonding
# CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=n

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Config logger
CONFIG_LOG=y
# CONFIG_USE_SEGGER_RTT=n
# CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_BACKEND_UART=y
# CONFIG_LOG_MAX_LEVEL=3
# CONFIG_LOG_BUFFER_SIZE=8192
# CONFIG_LOG_MODE_IMMEDIATE=y
# CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_DEFAULT_LEVEL=3

CONFIG_ASSERT=y

# Do not invert the LEDs for the BL654 dvk
# CONFIG_DK_LIBRARY_INVERT_LEDS=n
# CONFIG_BT_NUS_SECURITY_ENABLED=n

CONFIG_SHELL=y
# CONFIG_SHELL_MINIMAL=y
# CONFIG_SHELL_BACKEND_SERIAL=y
# CONFIG_SHELL_HELP=y
# CONFIG_SHELL_CMDS=y
# CONFIG_SHELL_TAB=y
# CONFIG_SHELL_TAB_AUTOCOMPLETION=y
# CONFIG_SHELL_HISTORY=y
# CONFIG_SHELL_METAKEYS=y
# CONFIG_SHELL_CMDS_SELECT=y
CONFIG_SHELL_PROMPT_UART="rmiot:~$ "
# CONFIG_SHELL_WILDCARD is not set
CONFIG_SHELL_HISTORY_BUFFER=64
CONFIG_SHELL_LOG_BACKEND=n
# CONFIG_SHELL_START_OBSCURED=n
# CONFIG_SHELL_CMD_ROOT="riot:~$ "
# CONFIG_KERNEL_SHELL=y
CONFIG_I2C_SHELL=n
# CONFIG_CLOCK_CONTROL_NRF_SHELL=n
# CONFIG_SHELL_VT100_COLORS=y
# CONFIG_SHELL_STACK_SIZE=4096

# CONFIG_ADC_SHELL=n

CONFIG_NEWLIB_LIBC=y
CONFIG_CBPRINTF_COMPLETE=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_NFC_T2T_NRFXLIB=y

CONFIG_NFC_NDEF=y
CONFIG_NFC_NDEF_MSG=y
CONFIG_NFC_NDEF_RECORD=y
CONFIG_NFC_NDEF_TEXT_RECORD=y
CONFIG_NFC_NDEF_CH_MSG=y
CONFIG_NFC_NDEF_LE_OOB_REC=y

# CONFIG_BUILD_WITH_TFM=y

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192

# Crypto is failing when this is enabled in v2.4.1
# The nRF52840 Cryptocell accelerator only supports
# 128 bit AES-CBC whereas we are using 256-bit
# CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y

# allows software AES-256-CBC
CONFIG_PSA_CRYPTO_DRIVER_OBERON=y

CONFIG_I2C=y

CONFIG_RING_BUFFER=y

# CONFIG_COUNTER=y
# CONFIG_COUNTER_MICROCHIP_MCP7940N=y
# CONFIG_COUNTER_INIT_PRIORITY=65

CONFIG_PM=y
CONFIG_PM_DEVICE=y
# CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_POLICY_CUSTOM=y

CONFIG_NV_STORE_DEFAULT_LOG_LEVEL=3

CONFIG_ADC=y
CONFIG_ADC_SHELL=n

CONFIG_SENSOR=y
CONFIG_SPI=y
CONFIG_LIS2DH=y
CONFIG_LIS2DH_MEASURE_TEMPERATURE=y
# CONFIG_LIS2DH_TRIGGER_OWN_THREAD=y

#Enable serial flash
# CONFIG_FLASH=y  -Already done
# CONFIG_SPI=y -Already done
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_IDLE_IN_DPD=y # enables deep-sleep and ultra-deep sleep in the spi flash
CONFIG_NORDIC_QSPI_NOR=n
CONFIG_NRFX_QSPI=n
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

CONFIG_EVENTS=y

CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_DEBUG_OPTIMIZATIONS=n
CONFIG_NO_OPTIMIZATIONS=n

# MCUBoot + DFU 
CONFIG_BOOTLOADER_MCUBOOT=y 

# Start - v2.2.0 and lower
# CONFIG_DFU_TARGET=y
# CONFIG_DFU_TARGET_MCUBOOT=y
# CONFIG_IMG_MANAGER=y
# CONFIG_MCUBOOT_IMG_MANAGER=y
# CONFIG_MCUMGR=y 
# CONFIG_MCUMGR_CMD_OS_MGMT=y 
# CONFIG_MCUMGR_CMD_IMG_MGMT=y 
# CONFIG_MCUMGR_SMP_BT=y 
# CONFIG_IMG_ERASE_PROGRESSIVELY=y 
# CONFIG_BT_BUF_EVT_RX_SIZE=255
# CONFIG_BT_BUF_ACL_RX_SIZE=256
# CONFIG_BT_L2CAP_TX_MTU=252
# CONFIG_MCUMGR_SMP_BT_AUTHEN=n
# End - v2.2.0 and lower


CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

# The next two config items are used in v2.30 and higher.
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
# CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
