2021-09-23 05:23:38 -04:00
|
|
|
/*
|
2022-03-03 02:09:52 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
2021-09-23 05:23:38 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2021-04-02 02:49:49 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
|
|
|
|
*
|
|
|
|
* The platform-specific string to insert into the OpenThread version string.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_IDF_TARGET
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
|
|
|
|
*
|
|
|
|
* The assert is managed by platform defined logic when this flag is set.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable otPlatFlash* APIs to support non-volatile storage.
|
|
|
|
*
|
|
|
|
* When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
|
|
|
|
*
|
|
|
|
* The ESP-IDF platform provides an otPlatLog() function.
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_LOG_LEVEL
|
|
|
|
*
|
|
|
|
* The log level (used at compile time). If `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE` is set, this defines the most
|
|
|
|
* verbose log level possible. See `OPENTHREAD_CONFIG_LOG_LEVEL_INIT` to set the initial log level.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef OPENTHREAD_CONFIG_LOG_LEVEL
|
|
|
|
#if CONFIG_LOG_DEFAULT_LEVEL_NONE
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_NONE
|
|
|
|
#elif CONFIG_LOG_DEFAULT_LEVEL_ERROR
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_CRIT
|
|
|
|
#elif CONFIG_LOG_DEFAULT_LEVEL_WARN
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_WARN
|
|
|
|
#elif CONFIG_LOG_DEFAULT_LEVEL_INFO
|
2021-09-23 05:23:38 -04:00
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_WARN
|
2021-04-02 02:49:49 -04:00
|
|
|
#elif CONFIG_LOG_DEFAULT_LEVEL_DEBUG
|
2021-09-23 05:23:38 -04:00
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_INFO
|
2021-04-02 02:49:49 -04:00
|
|
|
#elif CONFIG_LOG_DEFAULT_LEVEL_VERBOSE
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2021-07-28 03:32:59 -04:00
|
|
|
#define OPENTHREAD_CONFIG_LOG_CLI 1
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1
|
|
|
|
#define OPENTHREAD_CONFIG_LOG_PLATFORM 1
|
2021-04-02 02:49:49 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
|
|
|
|
*
|
|
|
|
* The number of message buffers in buffer pool
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 50
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable Thread Test Harness reference device support.
|
|
|
|
*
|
|
|
|
*/
|
2021-07-28 03:32:59 -04:00
|
|
|
#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0
|
2021-04-02 02:49:49 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable NCP SPI support.
|
|
|
|
*
|
|
|
|
*/
|
2022-11-16 03:59:57 -05:00
|
|
|
#define OPENTHREAD_CONFIG_NCP_SPI_ENABLE CONFIG_OPENTHREAD_RCP_SPI
|
2021-04-02 02:49:49 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
|
|
|
|
*
|
|
|
|
* Define to 1 to enable NCP Spinel Encrypter.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER 0
|
|
|
|
|
|
|
|
/**
|
2021-04-16 02:39:21 -04:00
|
|
|
* @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
|
2021-04-02 02:49:49 -04:00
|
|
|
*
|
2021-04-16 02:39:21 -04:00
|
|
|
* Define to 1 to enable NCP HDLC support.
|
2021-04-02 02:49:49 -04:00
|
|
|
*
|
|
|
|
*/
|
2022-11-16 03:59:57 -05:00
|
|
|
#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE CONFIG_OPENTHREAD_RCP_UART
|
2021-04-02 02:49:49 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def PACKAGE_NAME
|
|
|
|
*
|
|
|
|
* Define to the full name of this package.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define PACKAGE_NAME "openthread-esp32"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def PACKAGE_STRING
|
|
|
|
*
|
|
|
|
* Define to the full name and version of this package.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define PACKAGE_STRING (PACKAGE_NAME " - " PACKAGE_VERSION)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
|
|
|
|
*
|
|
|
|
* Define as 1 to enable bultin-mbedtls.
|
|
|
|
*
|
|
|
|
* Note that the OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS determines whether to use bultin-mbedtls as well as
|
|
|
|
* whether to manage mbedTLS internally, such as memory allocation and debug.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
|
|
|
|
*
|
|
|
|
* The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`).
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
|
|
|
|
*
|
|
|
|
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
|
|
|
|
* `RadioSpinel` platform is used.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 1024
|
|
|
|
|
2021-04-26 04:25:15 -04:00
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
|
|
|
*
|
|
|
|
* Define as 1 to enable microsecond timer.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1
|
|
|
|
|
2021-08-25 06:05:04 -04:00
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable software CSMA-CA backoff logic.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable software retransmission logic.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable software transmission security logic.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
|
|
|
|
*
|
|
|
|
* Define to 1 to enable software transmission target time logic.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1
|
|
|
|
|
2021-04-02 02:49:49 -04:00
|
|
|
/**
|
|
|
|
* The configurable definitions via Kconfig
|
|
|
|
*/
|
|
|
|
#if CONFIG_OPENTHREAD_COMMISSIONER
|
2021-07-28 03:32:59 -04:00
|
|
|
#error "Commissioner shouldn't be enabled for RCP"
|
2021-04-02 02:49:49 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_OPENTHREAD_JOINER
|
2021-07-28 03:32:59 -04:00
|
|
|
#error "Joiner shouldn't be enabled for RCP"
|
2021-04-02 02:49:49 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_OPENTHREAD_DIAG
|
|
|
|
#define OPENTHREAD_CONFIG_DIAG_ENABLE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define OPENTHREAD_RADIO 1
|