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

# General config
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_FPU=y

# UART config
CONFIG_UART_ASYNC_API=y
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_RESET_ON_FATAL_ERROR=n

# UART2
CONFIG_UART_2_ASYNC=y
CONFIG_UART_2_INTERRUPT_DRIVEN=n
CONFIG_UART_2_NRF_HW_ASYNC=y
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

# BLE config
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_SCAN=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=47250
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_HW_STACK_PROTECTION=y

# Flash 
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=y

# Application Event Manager
CONFIG_APP_EVENT_MANAGER=y
CONFIG_APP_EVENT_MANAGER_LOG_EVENT_TYPE=n


# CAF - Common Application Framework
CONFIG_CAF=y
CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n

# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y

CONFIG_LOG_MAX_LEVEL=4

# Increase log buffer size to prevent logs being dropped.
CONFIG_LOG_BUFFER_SIZE=2048

# Disable routing of printk() through the logging subsystem.
# This is a workaround to ensure that long strings are printed properly.
CONFIG_LOG_PRINTK=n

# Module debug configurations.
CONFIG_APPLICATION_MODULE_LOG_LEVEL_DBG=y
CONFIG_UART_MODULE_LOG_LEVEL_DBG=y
CONFIG_DATA_MODULE_LOG_LEVEL_DBG=y
CONFIG_BLE_SCAN_MODULE_LOG_LEVEL_DBG=y
CONFIG_WIFI_SCAN_MODULE_LOG_LEVEL_DBG=y
CONFIG_UTIL_MODULE_LOG_LEVEL_DBG=y


# Flash
CONFIG_STREAM_FLASH_LOG_LEVEL_DBG=y

# WIFI
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_NET_L2_WIFI_MGMT=y

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# Memory configurations
CONFIG_NET_BUF_RX_COUNT=8
CONFIG_NET_BUF_TX_COUNT=8

CONFIG_NET_PKT_RX_COUNT=1
CONFIG_NET_PKT_TX_COUNT=1
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

CONFIG_NET_TC_TX_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y

CONFIG_INIT_STACKS=y

CONFIG_NORDIC_QSPI_NOR=n


CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=32 

CONFIG_NORDIC_QSPI_NOR=n
CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_PRINTK=y