# Multithreading
CONFIG_MULTITHREADING=y

# ADC
CONFIG_ADC=y
CONFIG_ADC_NRFX_SAADC=y

# GPIO
CONFIG_GPIO=y
CONFIG_POLL=y

# I2C
CONFIG_I2C=y
CONFIG_I2C_LOG_LEVEL_OFF=y

# PWM
CONFIG_PWM=y

# SPI
CONFIG_SPI=y
CONFIG_SPI_NRFX=y
CONFIG_NRFX_SPIM=y

# SPI NOR
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

# Enable logging
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_PRINTK=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_MODE_OVERFLOW=n

# Don't log these subsystems to reduce code footprint
CONFIG_SOC_LOG_LEVEL_OFF=y
CONFIG_ARCH_LOG_LEVEL_OFF=y
CONFIG_KERNEL_LOG_LEVEL_OFF=y

# Settings for log_strdup function
CONFIG_LOG_STRDUP_BUF_COUNT=50
CONFIG_LOG_STRDUP_MAX_STRING=20

# Use SEGGER to print log
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_RTT_MODE_DROP=y
CONFIG_LOG_BACKEND_RTT_MESSAGE_SIZE=256
CONFIG_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE=32
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096

# Memory Config
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304

# Enable USB subsystem
CONFIG_USB=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Console"
CONFIG_USB_CDC_ACM=y
CONFIG_USB_COMPOSITE_DEVICE=y
CONFIG_USB_CDC_ACM_DEVICE_COUNT=1
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=512

# Setup UART conn
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_USB_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y

# Bluetooth
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=y

# Allow for large Bluetooth data packets.
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_RX_SIZE=252

# Bluetooth controller
CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

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

# Enable External Flash
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R32"
CONFIG_PM_EXTERNAL_FLASH_BASE=0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x200000

# Enable Non Volatile Storage module
CONFIG_NVS=y

# Enable software reboots
CONFIG_REBOOT=y

# Configuration required by Event Manager
CONFIG_EVENT_MANAGER=y
CONFIG_LINKER_ORPHAN_SECTION_PLACE=y

# Sensor Configuration
CONFIG_SENSOR=y

# Display Configuration
CONFIG_DISPLAY=y

# Vitalacy Configuration
CONFIG_DEVICE_ID=6

# Enable services
CONFIG_BT_CONFIG_SERVICE=y
CONFIG_BT_RECORD_SERVICE=y
CONFIG_BT_CTS_SERVICE=y

# Record Subsystem
CONFIG_RECORD=y

# Config Subsystem
CONFIG_CONFIG=y

# Time Subsystem
CONFIG_UTC=y

# NVS Storage Subsystem
CONFIG_NVS_STORAGE=y

# Shell
CONFIG_SHELL=y
CONFIG_UART_SHELL_ON_DEV_NAME="CDC_ACM_0"
CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=256
CONFIG_SHELL_STACK_SIZE=2048
CONFIG_SHELL_CMD_BUFF_SIZE=128
CONFIG_FILE_SYSTEM_SHELL=y

# Disabled sub-shells to reduce footprint
CONFIG_SHELL_WILDCARD=n
CONFIG_SHELL_VT100_COLORS=n
CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT=n
CONFIG_SHELL_STATS=n
CONFIG_SHELL_METAKEYS=n
CONFIG_SHELL_CMDS_RESIZE=n
CONFIG_SHELL_LOG_BACKEND=n
CONFIG_KERNEL_SHELL=n
CONFIG_DEVICE_SHELL=n
CONFIG_DATE_SHELL=n
CONFIG_SENSOR_SHELL=n
CONFIG_ADC_SHELL=n
CONFIG_FLASH_SHELL=n
CONFIG_HWINFO_SHELL=n
CONFIG_I2C_SHELL=n
CONFIG_MODEM_SHELL=n
CONFIG_OPENTHREAD_SHELL=n
CONFIG_PCIE_SHELL=n
CONFIG_PWM_SHELL=n

# LFS file system for images
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

# Meta-IRQ settings
CONFIG_NUM_METAIRQ_PRIORITIES=1