esp_openthread_defaults.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2021 Espressif Systems (Shanghai) CO LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License
  13. #pragma once
  14. #include "esp_openthread_types.h"
  15. #define ESP_OPENTHREAD_DEFAULT_RADIO_UART_RCP_CONFIG(pin_rx, pin_tx) \
  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 = pin_rx, \
  31. .tx_pin = pin_tx, \
  32. }, \
  33. }
  34. #define ESP_OPENTHREAD_DEFAULT_UART_HOST_CONFIG() \
  35. { \
  36. .host_connection_mode = HOST_CONNECTION_MODE_UART, \
  37. .host_uart_config = { \
  38. .port = 0, \
  39. .uart_config = \
  40. { \
  41. .baud_rate = 115200, \
  42. .data_bits = UART_DATA_8_BITS, \
  43. .parity = UART_PARITY_DISABLE, \
  44. .stop_bits = UART_STOP_BITS_1, \
  45. .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
  46. .rx_flow_ctrl_thresh = 0, \
  47. .source_clk = UART_SCLK_APB, \
  48. }, \
  49. .rx_pin = UART_PIN_NO_CHANGE, \
  50. .tx_pin = UART_PIN_NO_CHANGE, \
  51. }, \
  52. }