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

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_SERIAL=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=65536

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="BrainTouch10_04"
CONFIG_BT_DEVICE_APPEARANCE=833
#CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

CONFIG_BT_NUS_UART_BUFFER_SIZE=300
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=300
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
# CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=60000
CONFIG_BT_CTLR_SDC_CONN_EVENT_EXTEND_DEFAULT=y
CONFIG_BT_LL_SOFTDEVICE=y
CONFIG_BT_CTLR_SDC_CENTRAL_ACL_EVENT_SPACING_DEFAULT=60000

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

CONFIG_NVS=y
CONFIG_SETTINGS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
# Config logger
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_PRINTK=n

CONFIG_RTT_CONSOLE=y

CONFIG_ASSERT=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_PERIOD=4000
CONFIG_SYSTEM_CLOCK_NO_WAIT=y
CONFIG_CLOCK_CONTROL=y
CONFIG_BT_HCI=y
CONFIG_BT_HCI_VS_EVT_USER=y

CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

CONFIG_TICKLESS_KERNEL=y
CONFIG_NUM_COOP_PRIORITIES=18
CONFIG_MAIN_THREAD_PRIORITY=0
CONFIG_BT_GATT_DYNAMIC_DB=y

CONFIG_BT_GATT_AUTO_UPDATE_MTU=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM_MAX_ATTRS=247
CONFIG_BT_GATT_DM=y

CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_CTLR_PHY_CODED=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_MAX_CONN=20
CONFIG_BT_CTLR_RX_BUFFERS=18
#CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_CTLR_ISO_RX_BUFFERS=30
CONFIG_BT_CTLR_ISO_TX_BUFFERS=18

CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_BUF_ACL_TX_SIZE=502
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_ATT_TX_COUNT=18

CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_TICKLESS_KERNEL=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

CONFIG_BT_ATT_PREPARE_COUNT=64
CONFIG_BT_L2CAP_TX_BUF_COUNT=64

CONFIG_BT_CONN_TX_MAX=251
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y

CONFIG_BT_BUF_ACL_TX_COUNT=39
CONFIG_BT_BUF_ACL_RX_COUNT=256
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=y

CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=30

CONFIG_BT_CTLR_CONN_PARAM_REQ=y

#CONFIG_BT_THROUGHPUT=y
#CONFIG_BT_SCAN=y
#CONFIG_BT_SCAN_FILTER_ENABLE=y
#CONFIG_BT_SCAN_UUID_CNT=1
#CONFIG_BT_BONDABLE=n
#CONFIG_BT_CENTRAL=y
#CONFIG_BT_SMP=y
#CONFIG_SHELL=y
#CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_BT_BUF_EVT_RX_COUNT=40
CONFIG_BT_BUF_EVT_RX_SIZE=128

CONFIG_PM=y
CONFIG_REGULATOR=y

CONFIG_NRFX_NVMC=y

CONFIG_FLASH=y

CONFIG_SPI_NRFX=y
CONFIG_NRFX_SPIM3=y
CONFIG_NRFX_SPIM2=y

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_SPI=y

#CONFIG_SPI_SLAVE=y
#CONFIG_NRFX_SPIS2=y

CONFIG_PINCTRL=y
CONFIG_PINCTRL_NRF=y
#CONFIG_NORDIC_QSPI_NOR=n

CONFIG_NFCT_PINS_AS_GPIOS=y

CONFIG_GPIO_NRFX=y


CONFIG_MAIN_STACK_SIZE=4096
CONFIG_INIT_STACKS=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_STACK_SENTINEL=y

CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=64

CONFIG_I2C=y
CONFIG_TFM_SECURE_UART=n

CONFIG_TFM_LOG_LEVEL_SILENCE=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
