CONFIG_CPP_MAIN=y
CONFIG_CPLUSPLUS=y
CONFIG_LIB_CPLUSPLUS=y
CONFIG_EXCEPTIONS=n
CONFIG_STD_CPP17=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=4096

CONFIG_MAIN_STACK_SIZE=8196
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1280

# # XC9145 DCDC (boost) converter
# CONFIG_REGULATOR=y
# CONFIG_REGULATOR_FIXED=y
# CONFIG_REGULATOR_LOG_LEVEL_DBG=y
# CONFIG_REGULATOR_SHELL=y

# buses
CONFIG_I2C=y
CONFIG_I2C_LOG_LEVEL_INF=y

CONFIG_SPI=y

# sensors
# CONFIG_SI7055=y
CONFIG_SENSOR=y
# CONFIG_SENSOR_LOG_LEVEL_DBG=y

CONFIG_ADXL372=y
CONFIG_ADXL372_MEASUREMENT_MODE=y
CONFIG_ADXL372_PEAK_DETECT_MODE=n
CONFIG_ADXL372_ACTIVITY_THRESHOLD=2000
CONFIG_ADXL372_ACTIVITY_TIME=5
CONFIG_ADXL372_INACTIVITY_THRESHOLD=2500
CONFIG_ADXL372_INACTIVITY_TIME=50
CONFIG_ADXL372_THREAD_STACK_SIZE=2048
CONFIG_ADXL372_TRIGGER_OWN_THREAD=y
CONFIG_ADXL372_THREAD_PRIORITY=-9
# CONFIG_ADXL372_REFERENCED_ACTIVITY_DETECTION_MODE=y

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

# LittleFS
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_PM_PARTITION_SIZE_LITTLEFS=0x8000

# CJSON
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_CJSON_LIB=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
# CONFIG_LTE_NETWORK_MODE_LTE_M=y
# CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
# CONFIG_LTE_NETWORK_MODE_NBIOT=y
# CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_INF=y
# CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y

CONFIG_FPU=y
CONFIG_FP_HARDABI=y

# Modem
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=y
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_BUFFER_SIZE=512
CONFIG_AT_MONITOR=y
CONFIG_AT_MONITOR_HEAP_SIZE=320

# LTE
# CONFIG_LTE_NETWORK_TIMEOUT=600
# CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y

# PSM Periodic-TAU timer coding
# Note: the operator may ignore requested value, even change it on RRC updates
# Bits 5 to 1 represent the binary coded timer value .
# Bits 6 to 8 defines the timer value unit for the GPRS timer 3 as follows:
# Bits
# 8 7 6
# 0 0 0 value is incremented in multiples of 10 minutes
# 0 0 1 value is incremented in multiples of 1 hour
# 0 1 0 value is incremented in multiples of 10 hours
# 0 1 1 value is incremented in multiples of 2 seconds
# 1 0 0 value is incremented in multiples of 30 seconds
# 1 0 1 value is incremented in multiples of 1 minute
# 1 1 0 value is incremented in multiples of 320 hours
# 1 1 1 value indicates that the timer is deactivated

# set requested TAU period to 24h
CONFIG_LTE_PSM_REQ_RPTAU="00111000"

# Requested_Active-Time coding
# Bits 5 to 1 represent the binary coded timer value.
# Bits 8 to 6 define the timer value unit for the GPRS timer 2 as follows:
# Bits
# 8 7 6
# 0 0 0 value is incremented in multiples of 2 seconds
# 0 0 1 value is incremented in multiples of 1 minute
# 0 1 0 value is incremented in multiples of 6 minutes
# 1 1 1 value indicates that the timer is deactivated

# set requested active time to 1m
CONFIG_LTE_PSM_REQ_RAT="00100001"

CONFIG_LTE_LC_MODEM_SLEEP_NOTIFICATIONS=y
CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS=y
CONFIG_LTE_LC_TAU_PRE_WARNING_THRESHOLD_MS=120000
CONFIG_LTE_LC_TAU_PRE_WARNING_TIME_MS=5000
CONFIG_LTE_LC_MODEM_SLEEP_NOTIFICATIONS_THRESHOLD_MS=10240
CONFIG_LTE_LC_MODEM_SLEEP_PRE_WARNING_TIME_MS=5000

# eDRX
CONFIG_LTE_EDRX_REQ=n

# E-UTRAN eDRX cycle length duration, up to 43 minutes
# modem asleep and cannot be reached by the network
# 0000 – 5.12 seconds
# 0001 – 10.24 seconds
# 0010 – 20.48 seconds
# 0011 – 40.96 seconds
# 0100 – 61.44 seconds
CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="0000"

# Paging_time_window length
# 0000 – 1.28 seconds
# 0001 – 2.56 seconds
# 0010 – 3.84 seconds
# 0011 – 5.12 seconds
# 0100 – 6.4 seconds
# 0101 – 7.68 seconds
# 0110 – 8.96 seconds
# 0111 – 10.24 seconds
# 1000 – 11.52 seconds
# 1001 – 12.8 seconds
# 1010 – 14.08 seconds
# 1011 – 15.36 seconds
# 1100 – 16.64 seconds
# 1101 – 17.92 seconds
# 1110 – 19.20 seconds
# 1111 – 20.48 seconds
CONFIG_LTE_PTW_VALUE_LTE_M="0111"

# RAI
# 0 – Undefined, default
# 3 – Control plane one response (see 3GPP TS 24.301, subclause 9.9.4.25)
# 4 – Control plane no response (see 3GPP TS 24.301, subclause 9.9.4.25)
CONFIG_LTE_RAI_REQ_VALUE="3"

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
# CONFIG_NET_LOG=y
# CONFIG_NET_CONN_LOG_LEVEL_DBG=y
# CONFIG_NET_HTTP_LOG_LEVEL_DBG=y

CONFIG_PDN=y
CONFIG_PDN_ESM_STRERROR=y
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y
CONFIG_DK_LIBRARY=y
# CONFIG_NRF_MODEM_LOG=y

# Power Management
CONFIG_STATS=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_STATS=y
# CONFIG_PM_DEVICE_LOG_LEVEL_DBG=y

# MQTT
CONFIG_MQTT_HELPER=y
CONFIG_HW_ID_LIBRARY=y
CONFIG_MQTT_CLEAN_SESSION=y
# CONFIG_MQTT_HELPER_LOG_LEVEL_DBG=y
# CONFIG_MQTT_LOG_LEVEL_DBG=y

CONFIG_MQTT_HELPER_PORT=8883
CONFIG_MQTT_HELPER_SEND_TIMEOUT_SEC=30

# set keepalive to 18h -> server disconnects after 18+18/2 h
CONFIG_MQTT_KEEPALIVE=64800
# CONFIG_MQTT_KEEPALIVE=3600

CONFIG_MQTT_LIB_TLS=y
CONFIG_MQTT_HELPER_SEC_TAG=955

CONFIG_ADC=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_MODEM=y
CONFIG_DATE_TIME_AUTO_UPDATE=y

# CONFIG_LZ4=y
CONFIG_HEAP_MEM_POOL_SIZE=16384

# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=4096
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1152

# serial out
CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_ASSERT=y
# CONFIG_ASSERT_LEVEL=2
CONFIG_SPIN_VALIDATE=n
CONFIG_NUM_COOP_PRIORITIES=10
CONFIG_NUM_PREEMPT_PRIORITIES=10
CONFIG_SCHED_SCALABLE=y

# Enable thread awareness for debugging tools supporting it
CONFIG_INIT_STACKS=y
CONFIG_THREAD_NAME=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_THREAD_RUNTIME_STATS=y
CONFIG_THREAD_MONITOR=y
CONFIG_DEBUG_THREAD_INFO=y

# # thread runtime statistics, comment in for stack analysis
# CONFIG_THREAD_ANALYZER=y
# CONFIG_THREAD_ANALYZER_USE_LOG=y
# CONFIG_THREAD_ANALYZER_AUTO=y		
# CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=90

# memory usage
CONFIG_MEM_SLAB_TRACE_MAX_UTILIZATION=y
CONFIG_SYS_HEAP_RUNTIME_STATS=y

# CONFIG_TIMING_FUNCTIONS=y

# CONFIG_ZTEST=y
# CONFIG_ZTEST_NEW_API=y
# CONFIG_DEBUG=y

# Shell configurations
CONFIG_SHELL=y
CONFIG_SHELL_WILDCARD=n
CONFIG_DEVMEM_SHELL=n
CONFIG_FLASH_SHELL=n
CONFIG_HWINFO_SHELL=n
CONFIG_I2C_SHELL=n
CONFIG_KERNEL_SHELL=n
CONFIG_LTE_SHELL=n
CONFIG_SENSOR_SHELL=n
CONFIG_STATS_SHELL=n
CONFIG_ADC_SHELL=n
CONFIG_DATE_SHELL=n
CONFIG_DEVICE_SHELL=n
CONFIG_PWM_SHELL=n
CONFIG_LOG_CMDS=n
CONFIG_SHELL_CMDS_RESIZE=n
CONFIG_CLOCK_CONTROL_NRF_SHELL=n

CONFIG_PWM=y
# CONFIG_PWM_LOG_LEVEL_DBG=y

CONFIG_BUILD_WITH_TFM=y

# firmware update
CONFIG_REBOOT=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# FOTA library
CONFIG_FOTA_DOWNLOAD=y
CONFIG_FOTA_SOCKET_RETRIES=0
# CONFIG_FOTA_DOWNLOAD_LOG_LEVEL_DBG=y

# Download client for DFU
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=128
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
# CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_DBG=y
# CONFIG_DOWNLOAD_CLIENT_LOG_HEADERS=y
# CONFIG_DOWNLOAD_CLIENT_SHELL=y

# DFU Target
CONFIG_DFU_TARGET=y
# CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS=y
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="priv_key.pem"
CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0"

# Modem key management
CONFIG_MODEM_KEY_MGMT=y

# Application Upgrade support
CONFIG_BOOTLOADER_MCUBOOT=y
# CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y

# gpio driver support
CONFIG_GPIO=y
CONFIG_GPIO_LOG_LEVEL_WRN=y
# crypto
# CONFIG_TINYCRYPT=y
# CONFIG_TINYCRYPT_ECC_DSA=y
# CONFIG_TINYCRYPT_ECC_DH=y
# CONFIG_TINYCRYPT_SHA256=y
# # CONFIG_TINYCRYPT_CTR_PRNG=y

# CONFIG_NORDIC_SECURITY_BACKEND=y
# CONFIG_NRF_SECURITY_ADVANCED=y

CONFIG_NRF_SECURITY=y

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"

CONFIG_MBEDTLS_CTR_DRBG_C=y
CONFIG_MBEDTLS_PK_C=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_PK_WRITE_C=y
# CONFIG_MBEDTLS_SHA1_C=y
CONFIG_MBEDTLS_SHA256_C=y

# CONFIG_MBEDTLS_ENABLE_HEAP=y
# CONFIG_MBEDTLS_HEAP_SIZE=16384

CONFIG_MBEDTLS_ENTROPY_ENABLED=y
CONFIG_MBEDTLS_ZEPHYR_ENTROPY=y
CONFIG_ENTROPY_GENERATOR=y
CONFIG_ENTROPY_LOG_LEVEL_WRN=y

CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
CONFIG_MBEDTLS_ENTROPY_C=y
CONFIG_MBEDTLS_PK_PARSE_C=y

# awe tttest reduce size
CONFIG_MBEDTLS_PKCS5_C=n

CONFIG_MBEDTLS_CIPHER_MODE_CFB=n
CONFIG_MBEDTLS_CIPHER_MODE_OFB=n

CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=n
CONFIG_MBEDTLS_ECDH_C=n
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECJPAKE_C=n

CONFIG_MBEDTLS_RSA_C=y
CONFIG_MBEDTLS_SHA512_C=n

CONFIG_MBEDTLS_LOG_LEVEL_INF=n
CONFIG_MBEDTLS_LOG_LEVEL_WRN=y
# CONFIG_MBEDTLS_LOG_LEVEL_DBG=n

CONFIG_MBEDTLS_HMAC_DRBG_C=n

CONFIG_MBEDTLS_HKDF_C=n

CONFIG_MBEDTLS_PKCS1_V15=y
CONFIG_MBEDTLS_PKCS1_V21=n

CONFIG_MBEDTLS_SHA224_C=n
# CONFIG_MBEDTLS_SHA256_C=n
CONFIG_MBEDTLS_SHA384_C=n

CONFIG_MBEDTLS_CIPHER_C=n
# CONFIG_MBEDTLS_MD_C=n

CONFIG_PSA_WANT_ALG_TLS12_PSK_TO_MS=n

