#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="Trezor BLE Gateway"

CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_PERIOD=4000

CONFIG_MINIMAL_LIBC=y

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

# Enable the SPI driver
CONFIG_SPI=y
CONFIG_NRFX_SPIM0=y
CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y

CONFIG_GPIO=y



CONFIG_HEAP_MEM_POOL_SIZE=19000

# Enable system-wide Power Management
CONFIG_PM=y
CONFIG_PM_DEVICE=y
# (Optional) Enable device power management at runtime
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_POWEROFF=y

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Trezor BLE"
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_APPEARANCE=128
CONFIG_BT_COMPANY_ID=0x0F29
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=8
CONFIG_BT_SMP=y
CONFIG_BT_SMP_ENFORCE_MITM=y
CONFIG_BT_SMP_SC_ONLY=y
CONFIG_BT_FILTER_ACCEPT_LIST=y
CONFIG_BT_BONDING_REQUIRED=y
CONFIG_BT_PRIVACY=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_LL_SOFTDEVICE=y
CONFIG_BT_CTLR_TX_PWR_PLUS_4=y
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=y
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=24
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=36
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_BAS=y

CONFIG_BT_DIS=y
CONFIG_BT_DIS_MANUF="Trezor Company s.r.o"
CONFIG_BT_DIS_MODEL="Trezor Safe 7"
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_FW_REV_STR="0.0.0.0"
CONFIG_BT_DIS_SW_REV=y
CONFIG_BT_DIS_SW_REV_STR="0.0.0.0"
CONFIG_BT_DIS_PNP=n
CONFIG_BT_DIS_SETTINGS=y
CONFIG_BT_DIS_STR_MAX=21


#PHY update needed for updating PHY request
CONFIG_BT_PHY_UPDATE=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

# HCI ACL buffers size
CONFIG_BT_BUF_ACL_RX_SIZE=251

# L2CAP SDU/PDU TX MTU
CONFIG_BT_L2CAP_TX_MTU=247


# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_RUNTIME=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more stack
CONFIG_MAIN_STACK_SIZE=1152
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# NFC
CONFIG_NFCT_PINS_AS_GPIOS=y

CONFIG_POLL=y


# Config logger
CONFIG_LOG=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_PRINTK=n

CONFIG_NANOPB=n


# bootloader
#CONFIG_SECURE_BOOT=y
CONFIG_BOOTLOADER_MCUBOOT=y
