# OS Services & Kernel Features
CONFIG_PIPES=y
CONFIG_POLL=y
CONFIG_RING_BUFFER=y
CONFIG_TIMESLICING=n
CONFIG_SCHED_MULTIQ=y
CONFIG_DYNAMIC_INTERRUPTS=n

# Drivers and peripherals
CONFIG_WATCHDOG=n
CONFIG_UART_ASYNC_API=y

# Power management
CONFIG_PM=n
CONFIG_PM_DEVICE=y
CONFIG_POWEROFF=y
CONFIG_REBOOT=y

# FPU
CONFIG_FPU=y
CONFIG_FPU_SHARING=y
CONFIG_FP_HARDABI=n
CONFIG_FP_SOFTABI=y

# Boot
CONFIG_BOOT_BANNER=n
CONFIG_BOOT_DELAY=0

# Display
CONFIG_DISPLAY=y
CONFIG_TN0XXX_DIRTY_BUFFER=y
CONFIG_HOPP_DISPLAY_DEBUG_LOGGING=n
# 45 * 11 = 495 (45 bytes x 11 lines per paint call)
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=495

# LVGL
CONFIG_LVGL=y
CONFIG_LV_CONF_MINIMAL=y
CONFIG_LV_USE_LABEL=y
CONFIG_LV_USE_IMG=y
CONFIG_LV_USE_CANVAS=y
CONFIG_LV_USE_QRCODE=y
CONFIG_LV_DRAW_COMPLEX=n # saves 20kB flash
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_MEM_CUSTOM=y
# this is critical - without this, lvgl heap management would be used
# and that would require additional ~ 32kB RAM allocation
CONFIG_LV_Z_MEM_POOL_HEAP_LIB_C=y 
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=14336
# This cannot be reduced below 100 because of a bug in the lvgl zephyr port specific to this screen
# see the lvgl_display_mono.c file
CONFIG_LV_Z_VDB_SIZE=100
CONFIG_LV_Z_DOUBLE_VDB=n
CONFIG_LV_Z_FULL_REFRESH=y
CONFIG_LV_Z_USE_FILESYSTEM=n
CONFIG_APP_LINK_WITH_LVGL=y

# BT
CONFIG_BT_LL_SW_SPLIT=n
CONFIG_BT=y
CONFIG_BT_ID_MAX=1
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_BAS=y
CONFIG_BT_HRS=n
CONFIG_BT_DEVICE_NAME="Pulse Oximeter Sensor"
CONFIG_BT_DEVICE_APPEARANCE=31368
CONFIG_BT_LIM_ADV_TIMEOUT=32 
# seconds

# BT Pairing
# CONFIG_BT_MAX_CONN Has to be 2 when calling "bt_le_adv_start" from disconnected() callback
CONFIG_BT_SMP=y
CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y
CONFIG_BT_MAX_CONN=2 
CONFIG_BT_MAX_PAIRED=2
CONFIG_BT_FIXED_PASSKEY=y
CONFIG_BT_FILTER_ACCEPT_LIST=y
# The use of RPA is not enabled
CONFIG_BT_PRIVACY=n

# Below is setup to let DIS information be read from settings
# CONFIG_SETTINGS_NONE=y

# Enable BT Bonding and DIS info read from settings
CONFIG_BT_SETTINGS=y
CONFIG_SETTINGS=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_SETTINGS_RUNTIME=y
CONFIG_BT_BONDABLE=y
CONFIG_BT_ID_UNPAIR_MATCHING_BONDS=y

# BT size settings
#CONFIG_BT_L2CAP_TX_MTU=247
#CONFIG_BT_BUF_ACL_RX_SIZE=251
#CONFIG_BT_BUF_ACL_TX_SIZE=251
#CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

# Stacks & threads
CONFIG_MPU_STACK_GUARD=y
CONFIG_BT_RX_STACK_SIZE=2048
# Note: This stack must be 2K or higher to avoid stack overflow when pairing to Android Devices
CONFIG_MPSL_WORK_STACK_SIZE=2048
CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
CONFIG_BT_HCI_TX_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_IDLE_STACK_SIZE=1024
CONFIG_MAIN_STACK_SIZE=2048
# We set the main thread priority low to ensure all other threads have a chance to run first and block on their
# semaphores. Doing this is better since we do not have to wait for the other threads to run first
CONFIG_MAIN_THREAD_PRIORITY=10
CONFIG_THREAD_CUSTOM_DATA=n

# Build
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_DEBUG=y
CONFIG_ASSERT=y

# Logging & Console
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_SENSOR=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_EARLY_CONSOLE=n

# Log levels
CONFIG_DISPLAY_LOG_LEVEL_INF=y

# App Event Manager
CONFIG_APP_EVENT_MANAGER=y
CONFIG_HEAP_MEM_POOL_SIZE=2048

# NFC Pairing settings
CONFIG_NFC_T4T_NRFXLIB=y

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

CONFIG_NFC_NDEF_TNEP_RECORD=y
CONFIG_NFC_TNEP_TAG=y
CONFIG_NFC_NDEF_PARSER=y
CONFIG_NFC_NDEF_CH_PARSER=y
CONFIG_NFC_NDEF_LE_OOB_REC_PARSER=y
CONFIG_NFC_TNEP_CH=y
# NFC Example uses Polling API for its state machine

# LittleFS
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_FS_LITTLEFS_NUM_FILES=6

# Hopparoo project settings
CONFIG_HOPP_RAW_SHIP_COMMS=y
CONFIG_HOPP_RAW_ACTIVITY_DATA=y
CONFIG_HOPP_DATA_OFFLOAD_STATUS_FOR_ACTIVITY_DATA=n 

# 12.5ms to 15ms
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=10 
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=12

# EMC FW CONFIG Flags
CONFIG_HOPP_EMC_TEST_MODE=n
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_THREAD_NAME=y
CONFIG_HOPP_STORAGE_LIST_FILES=n

# NFC
CONFIG_HOPP_NFC_ENABLED=n

# Uncomment this setting to test how the device behaves when the POX data stops coming in
#CONFIG_HOPP_SIMULATE_NO_POX_DATA=y