esp_ot_config.h 3.2 KB

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