openthread: add SPI support in Radio Co-Processor

This commit is contained in:
xieqinan
2022-11-16 16:59:57 +08:00
parent 6cac537791
commit 5a1578e692
20 changed files with 812 additions and 57 deletions

View File

@@ -45,12 +45,15 @@ UartSpinelInterface::~UartSpinelInterface(void)
esp_err_t UartSpinelInterface::Init(const esp_openthread_uart_config_t &radio_uart_config)
{
esp_err_t error = ESP_OK;
m_uart_rx_buffer = static_cast<uint8_t *>(heap_caps_malloc(kMaxFrameSize, MALLOC_CAP_8BIT));
if (m_uart_rx_buffer == NULL) {
return ESP_ERR_NO_MEM;
}
return InitUart(radio_uart_config);
error = InitUart(radio_uart_config);
ESP_LOGI(OT_PLAT_LOG_TAG, "spinel UART interface initialization completed");
return error;
}
esp_err_t UartSpinelInterface::Deinit(void)
@@ -282,5 +285,13 @@ esp_err_t UartSpinelInterface::TryRecoverUart(void)
return ESP_OK;
}
void UartSpinelInterface::OnRcpReset(void)
{
if (mRcpFailureHandler) {
mRcpFailureHandler();
TryRecoverUart();
}
}
} // namespace openthread
} // namespace esp