feat(openthread): support vendor hook for rcp spi

This commit is contained in:
Xu Si Yu
2024-09-24 10:35:54 +08:00
committed by BOT
parent d3e0764232
commit ca9caf1fee
17 changed files with 62 additions and 45 deletions

View File

@@ -4,12 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "esp_ieee802154.h"
#include "esp_openthread_ncp.h"
#include "ncp_base.hpp"
#if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
#if CONFIG_OPENTHREAD_RCP_UART
#include "utils/uart.h"
#endif
@@ -107,5 +106,3 @@ otError NcpBase::VendorSetPropertyHandler(spinel_prop_key_t aPropKey)
} // namespace Ncp
} // namespace ot
#endif // #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -7,8 +7,6 @@
#include "common/new.hpp"
#include "ncp_hdlc.hpp"
#if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
namespace ot {
namespace Ncp {
@@ -29,5 +27,3 @@ extern "C" void otNcpHdlcInit(otInstance *aInstance, otNcpHdlcSendCallback aSend
} // namespace Ncp
} // namespace ot
#endif // #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK

View File

@@ -0,0 +1,29 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "common/new.hpp"
#include "ncp_spi.hpp"
namespace ot {
namespace Ncp {
static OT_DEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpSpi), uint64_t);
extern "C" void otNcpSpiInit(otInstance *aInstance)
{
NcpSpi *ncpSpi = nullptr;
Instance *instance = static_cast<Instance *>(aInstance);
ncpSpi = new (&sNcpRaw) NcpSpi(instance);
if (ncpSpi == nullptr || ncpSpi != NcpBase::GetNcpInstance())
{
OT_ASSERT(false);
}
}
} // namespace Ncp
} // namespace ot