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

# General config
CONFIG_FPU=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_BSD_LIBRARY=y
CONFIG_NET_IPV4=y

# for Spectral|Impact DSP
CONFIG_CMSIS_DSP=y

# Console
# ?!? CONFIG_CONSOLE_SUBSYS=y
# ?!? CONFIG_CONSOLE_HANDLER=y
# ?!? CONFIG_CONSOLE_GETCHAR=n

# ?!? CONFIG_STDOUT_CONSOLE=y
# ?!? CONFIG_PRINTK=y
# ?!? CONFIG_RTT_CONSOLE=y
# ?!? CONFIG_USE_SEGGER_RTT=y

# UART
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y # Enable Async API

# Enable UART console, for printk()
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Async
CONFIG_UART_0_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
CONFIG_NRFX_TIMER=y
CONFIG_NRFX_TIMER1=y

# Allows the use of the deprecated Zephyr integer typedefs defined in
# Zephyr 2.3 and previous versions.  These types are:
# u8_t, u16_t, u32_t, u64_t, s8_t, s16_t, s32_t, and s64_t.
CONFIG_DEPRECATED_ZEPHYR_INT_TYPES=y

# Library that maintains the current date time UTC.
CONFIG_DATE_TIME=y
#CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=10

# Network
CONFIG_NETWORKING=y
CONFIG_NET_BUF_USER_DATA_SIZE=1
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
#CONFIG_NET_RAW_MODE=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=n
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

CONFIG_LTE_LEGACY_PCO_MODE=n
CONFIG_LTE_PSM_REQ_RPTAU="00000110"
CONFIG_LTE_PSM_REQ_RAT="00000010"

# Modem info
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_DATE_TIME=n

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Settings
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Fatal error
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_WATCHDOG=y

## PSM
CONFIG_LTE_PSM_REQ_RPTAU="00100001"
CONFIG_LTE_PSM_REQ_RAT="00000000"
CONFIG_PM_DEVICE=n

## eDRX
CONFIG_AMI_EDRX_ENABLE=n
CONFIG_LTE_EDRX_REQ_VALUE="1001"

## RAI
CONFIG_AMI_RAI_ENABLE=n
CONFIG_LTE_RAI_REQ_VALUE="4"

# GPS
CONFIG_NRF9160_GPS=y
CONFIG_NRF9160_GPS_NMEA_GGA=y
CONFIG_NRF9160_GPS_NMEA_GSV=n
CONFIG_NRF9160_GPS_NMEA_GSA=n
CONFIG_NRF9160_GPS_NMEA_GLL=n
CONFIG_NRF9160_GPS_NMEA_RMC=n
# CONFIG_GPS_USE_SIM=y
# CONFIG_NRF9160_GPS_LOG_LEVEL_DBG=y
CONFIG_GPS_USE_EXTERNAL=y
CONFIG_GPS_DEV_NAME="NRF9160_GPS"
CONFIG_GPS_CONTROL_PSM_ENABLE_ON_START=y
CONFIG_GPS_CONTROL_FIRST_FIX_CHECK_DELAY=10
CONFIG_GPS_CONTROL_FIX_CHECK_INTERVAL=30
CONFIG_GPS_CONTROL_FIX_TRY_TIME=360
CONFIG_GPS_CONTROL_PSM_DISABLE_ON_STOP=n
CONFIG_AGPS=n

# GPIO
CONFIG_GPIO=y

# I2c for 24LC512 & SI7050
CONFIG_I2C=y

# PWM for Breathing Led
CONFIG_PWM=y
#CONFIG_PWM_LOG_LEVEL_DBG=y

# SPI for LSM6DSL & MX25R6435
#CONFIG_SPI_3=y
#CONFIG_SPI_3_NRF_SPIM=y
#CONFIG_SPI_3=y 
#CONFIG_SPI_NRFX=y
#CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SPI=y
CONFIG_SPI_NOR=y


#CONFIG_CBPRINTF_FP_SUPPORT=y

#CONFIG_EXTERNAL_SENSORS=y

# Library for buttons and LEDs
CONFIG_DK_LIBRARY=y
CONFIG_DK_LIBRARY_INVERT_LEDS=n

# Leds
#CONFIG_UI_MODULE=y

# Modem AppServer connect code
#CONFIG_AMI_CONNECT_MODULE=y

# ADC
CONFIG_ADC=y
CONFIG_ADC_ASYNC=y
#CONFIG_ADC_NRFX_SAADC=y
#CONFIG_COMPILER_OPT="-DNRFX_SAADC_ENABLED=1"

# Trusted execution
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

# EEPROM
#CONFIG_EEPROM=y 
#CONFIG_EEPROM_AT24=y

# LSM6DSL
CONFIG_SENSOR=y
#CONFIG_LSM6DSL=y
#CONFIG_LSM6DSL_ACCEL_FS=2
#CONFIG_LSM6DSL_ACCEL_ODR=0

# SI7055
#CONFIG_SI7055=y
#CONFIG_SI7055_ENABLE_CHECKSUM=y

# Logging
#CONFIG_LOG=y
#CONFIG_LOG_IMMEDIATE=y
#CONFIG_LOG_MAX_LEVEL=4
#CONFIG_LOG_MINIMAL=n
#CONFIG_LOG_LEVEL_INF=1
#CONFIG_LOG_LEVEL=3

#CONFIG_SENSOR_LOG_LEVEL_DBG=y
#CONFIG_CONFIG_SPI_LOG_LEVEL_DBG=y
#CONFIG_CONFIG_I2C_LOG_LEVEL_DBG=y
