esp_ot_config.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* OpenThread Command Line Example
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #pragma once
  8. #include "esp_openthread_types.h"
  9. #if CONFIG_IDF_TARGET_ESP32H2
  10. #define ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG() \
  11. { \
  12. .radio_mode = RADIO_MODE_NATIVE, \
  13. }
  14. #else
  15. #define ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG() \
  16. { \
  17. .radio_mode = RADIO_MODE_UART_RCP, \
  18. .radio_uart_config = { \
  19. .port = 1, \
  20. .uart_config = \
  21. { \
  22. .baud_rate = 115200, \
  23. .data_bits = UART_DATA_8_BITS, \
  24. .parity = UART_PARITY_DISABLE, \
  25. .stop_bits = UART_STOP_BITS_1, \
  26. .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
  27. .rx_flow_ctrl_thresh = 0, \
  28. .source_clk = UART_SCLK_APB, \
  29. }, \
  30. .rx_pin = 4, \
  31. .tx_pin = 5, \
  32. }, \
  33. }
  34. #endif
  35. #define ESP_OPENTHREAD_DEFAULT_HOST_CONFIG() \
  36. { \
  37. .host_connection_mode = HOST_CONNECTION_MODE_CLI_UART, \
  38. .host_uart_config = { \
  39. .port = 0, \
  40. .uart_config = \
  41. { \
  42. .baud_rate = 115200, \
  43. .data_bits = UART_DATA_8_BITS, \
  44. .parity = UART_PARITY_DISABLE, \
  45. .stop_bits = UART_STOP_BITS_1, \
  46. .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
  47. .rx_flow_ctrl_thresh = 0, \
  48. .source_clk = UART_SCLK_APB, \
  49. }, \
  50. .rx_pin = UART_PIN_NO_CHANGE, \
  51. .tx_pin = UART_PIN_NO_CHANGE, \
  52. }, \
  53. }
  54. #define ESP_OPENTHREAD_DEFAULT_PORT_CONFIG() \
  55. { \
  56. .storage_partition_name = "ot_storage", \
  57. .netif_queue_size = 10, \
  58. .task_queue_size = 10, \
  59. }