Skip to content

Commit 9969b9c

Browse files
committed
feat(openthread): support bus_latency for dual-chip BR solution
1 parent 918e182 commit 9969b9c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

components/openthread/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,12 @@ menu "OpenThread"
379379
help
380380
The device's XTAL accuracy, in ppm.
381381

382+
config OPENTHREAD_BUS_LATENCY
383+
int "The bus latency between host and radio chip"
384+
default 4000
385+
help
386+
The device's bus latency, in us.
387+
382388
config OPENTHREAD_MLE_MAX_CHILDREN
383389
int "The size of max MLE children entries"
384390
default 10

components/openthread/src/port/esp_openthread_radio_spinel.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,27 @@ uint32_t otPlatRadioGetSupportedChannelMask(otInstance *aInstance)
516516
// Refer to `GetRadioChannelMask(bool aPreferred)`: FALSE to get supported channel mask
517517
return s_radio.GetRadioChannelMask(false);
518518
}
519+
520+
uint32_t otPlatRadioGetBusSpeed(otInstance *aInstance)
521+
{
522+
OT_UNUSED_VARIABLE(aInstance);
523+
524+
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART
525+
return s_esp_openthread_radio_config->radio_uart_config.uart_config.baud_rate;
526+
#elif CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
527+
return s_esp_openthread_radio_config->radio_spi_config.spi_device.clock_speed_hz;
528+
#else
529+
return 0;
530+
#endif
531+
}
532+
533+
uint32_t otPlatRadioGetBusLatency(otInstance *aInstance)
534+
{
535+
OT_UNUSED_VARIABLE(aInstance);
536+
537+
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART || CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
538+
return CONFIG_OPENTHREAD_BUS_LATENCY;
539+
#else
540+
return 0;
541+
#endif
542+
}

0 commit comments

Comments
 (0)