phy_init_data.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Copyright 2016 Espressif Systems (Shanghai) PTE 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. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "esp_phy_init.h"
  16. #include "sdkconfig.h"
  17. // constrain a value between 'low' and 'high', inclusive
  18. #define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val)
  19. #define PHY_INIT_MAGIC "PHYINIT"
  20. static const char phy_init_magic_pre[] = PHY_INIT_MAGIC;
  21. /**
  22. * @brief Structure containing default recommended PHY initialization parameters.
  23. */
  24. static const esp_phy_init_data_t phy_init_data= { {
  25. 3,
  26. 3,
  27. 0x05,
  28. 0x09,
  29. 0x06,
  30. 0x05,
  31. 0x03,
  32. 0x06,
  33. 0x05,
  34. 0x04,
  35. 0x06,
  36. 0x04,
  37. 0x05,
  38. 0x00,
  39. 0x00,
  40. 0x00,
  41. 0x00,
  42. 0x05,
  43. 0x09,
  44. 0x06,
  45. 0x05,
  46. 0x03,
  47. 0x06,
  48. 0x05,
  49. 0x00,
  50. 0x00,
  51. 0x00,
  52. 0x00,
  53. 0x00,
  54. 0x00,
  55. 0x00,
  56. 0x00,
  57. 0xfc,
  58. 0xfc,
  59. 0xfe,
  60. 0xf0,
  61. 0xf0,
  62. 0xf0,
  63. 0xe0,
  64. 0xe0,
  65. 0xe0,
  66. 0x18,
  67. 0x18,
  68. 0x18,
  69. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 78),
  70. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 72),
  71. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 66),
  72. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 60),
  73. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 56),
  74. LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52),
  75. 0,
  76. 1,
  77. 1,
  78. 2,
  79. 2,
  80. 3,
  81. 4,
  82. 5,
  83. 0,
  84. 0,
  85. 0,
  86. 0,
  87. 0,
  88. 0,
  89. 0,
  90. 0,
  91. 0,
  92. 0,
  93. 0,
  94. 0,
  95. 0,
  96. 0,
  97. 0,
  98. 0,
  99. 0,
  100. 0,
  101. 0,
  102. 0,
  103. 0,
  104. 0,
  105. 0,
  106. 0,
  107. 0,
  108. 0,
  109. 0,
  110. 0,
  111. 0,
  112. 0,
  113. 0,
  114. 0,
  115. 0,
  116. 0,
  117. 0,
  118. 0,
  119. 0,
  120. 0,
  121. 0,
  122. 0,
  123. 0,
  124. 0,
  125. 0,
  126. 0,
  127. 0,
  128. 0,
  129. 0,
  130. 0,
  131. 0,
  132. } };
  133. static const char phy_init_magic_post[] = PHY_INIT_MAGIC;