# Project configuration
CONFIG_SERIAL=y
CONFIG_GPIO=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_PINCTRL=y

CONFIG_PRINTK=y
CONFIG_CONSOLE_HANDLER=n
CONFIG_SHELL=n

CONFIG_DYNAMIC_INTERRUPTS=y

CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_TIMER3=y
CONFIG_NRFX_TIMER4=y

CONFIG_I2C=y
CONFIG_CBPRINTF_FP_SUPPORT=y        # Floating point support for printk

CONFIG_SPI=y
CONFIG_SPI_NRFX=y

# Bluetooth host
CONFIG_BT=n
CONFIG_BT_PERIPHERAL=n
CONFIG_BT_CTLR=n
CONFIG_BT_LL_SOFTDEVICE=n
CONFIG_BT_HCI=n

#GDM New stuff to make it work like the old build
# 802.15.4 radio driver (nrfxlib SL variant with multiprotocol)
CONFIG_NRF_802154_RADIO_DRIVER=y
CONFIG_NRF_802154_USE_RAW_API=y
CONFIG_NRF_802154_CARRIER_FUNCTIONS=y
CONFIG_NRF_802154_ENCRYPTION=n

CONFIG_NRF_802154_TEMPERATURE_UPDATE=n
CONFIG_TEMP_NRF5_MPSL=n
CONFIG_TEMP_NRF5=y

# Make sure we aren't pulling in unused Zephyr's 802.15.4 layers
#CONFIG_IEEE802154=n
#CONFIG_NET_L2_IEEE802154=n
#CONFIG_OPENTHREAD=n

# Enable nordic security backend and PSA APIs for the wireless comm security
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_WANT_KEY_TYPE_AES=y
CONFIG_PSA_WANT_ALG_CTR=y
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y

# Turn on the analog to digital converter
CONFIG_ADC=y

# Watchdog
CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=n

# Nonvolatile storage
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=n

# Multi Protocol Service layer and other things needed to control the Skyworks FEM/amplifier
CONFIG_MPSL=y
CONFIG_MPSL_FEM=y
CONFIG_MPSL_FEM_SIMPLE_GPIO=y


# Used to turn on the thread analyzer to check stack usage and processor utilization. These are for debug purposes only
#CONFIG_QEMU_ICOUNT=n
#CONFIG_THREAD_ANALYZER=y
#CONFIG_THREAD_ANALYZER_USE_PRINTK=y
#CONFIG_THREAD_ANALYZER_AUTO=y
#CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
#CONFIG_THREAD_NAME=y

# Power manager, used to help put things to sleep
#CONFIG_PM=y
#CONFIG_PM_DEVICE=y

# GPIOTE is being used (instead of the zephyr driver) for GPIO control, MPSL FEM uses it already
# and I'm using it for interrupts (especially button) because it can do lower power level triggered
# mode instead of higher power edge triggered
CONFIG_NRFX_GPIOTE0=y
CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=3

CONFIG_ENTROPY_GENERATOR=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096

CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=n
CONFIG_UART_1_NRF_TX_BUFFER_SIZE=256

# SD card protocol stack
CONFIG_SDMMC_STACK=y

#####################################################
# Bootloader configuration
#####################################################
# Enable mcumgr.
#CONFIG_MCUMGR=y
#CONFIG_ZCBOR=y

# Ensure an MCUboot-compatible binary is generated.
#CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations.
CONFIG_FLASH=y

# Enable logging
CONFIG_LOG=y

# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

# Disable shell commands that are not needed
CONFIG_CLOCK_CONTROL_NRF_SHELL=n
CONFIG_DEVICE_SHELL=n
CONFIG_DEVMEM_SHELL=n
CONFIG_FLASH_SHELL=n

##################################################### 
# End bootloader configuration
##################################################### 

CONFIG_UART_USE_RUNTIME_CONFIGURE=y

#CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_FAULT_DUMP=2
CONFIG_THREAD_NAME=y
#CONFIG_THREAD_STACK_INFO=y

CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048
CONFIG_LOG_BUFFER_SIZE=8192
