Files
esp-idf/components/openthread/private_include/esp_openthread_common_macro.h
Soh Kam Yung 8c87790e47 feat(openthread) Add custom transport to OpenThread
- add a custom transport with Tx() and Rx() callbacks in OpenThread config
  - OpenThread calls Tx() to transmit, Rx() to receive data
  - external driver provides the transport for sending data between OT RCP and Host
- add an OpenThread call used by external driver to send a signal to OpenThread when there is incoming data
2026-06-16 13:28:20 +08:00

46 lines
1.1 KiB
C

/*
* SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "sdkconfig.h"
#define OT_PLAT_LOG_TAG "OPENTHREAD"
#ifndef MS_PER_S
#define MS_PER_S 1000
#endif
#ifndef US_PER_MS
#define US_PER_MS 1000
#endif
#ifndef US_PER_S
#define US_PER_S (MS_PER_S * US_PER_MS)
#endif
#define ESP_OPENTHREAD_UART_BUFFER_SIZE CONFIG_OPENTHREAD_UART_BUFFER_SIZE
#define ESP_OPENTHREAD_TRANSPORT_BUFFER_SIZE CONFIG_OPENTHREAD_TRANSPORT_BUFFER_SIZE
#if CONFIG_OPENTHREAD_DEBUG
#if CONFIG_OPENTHREAD_DUMP_MAC_ON_ASSERT && CONFIG_IEEE802154_RECORD
#include "esp_ieee802154.h"
#define IEEE802154_RECORD_PRINT() esp_ieee802154_record_print()
#else
#define IEEE802154_RECORD_PRINT()
#endif
#define ESP_OPENTHREAD_ASSERT(a) do { \
if(unlikely(!(a))) { \
IEEE802154_RECORD_PRINT(); \
assert(a); \
} \
} while (0)
#else
#define ESP_OPENTHREAD_ASSERT(a) assert(a)
#endif