| 
									
										
										
										
											2016-11-15 18:36:18 +08:00
										 |  |  | // Copyright 2016 Espressif Systems (Shanghai) PTE LTD
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Licensed under the Apache License, Version 2.0 (the "License");
 | 
					
						
							|  |  |  | // you may not use this file except in compliance with the License.
 | 
					
						
							|  |  |  | // You may obtain a copy of the License at
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //     http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Unless required by applicable law or agreed to in writing, software
 | 
					
						
							|  |  |  | // distributed under the License is distributed on an "AS IS" BASIS,
 | 
					
						
							|  |  |  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					
						
							|  |  |  | // See the License for the specific language governing permissions and
 | 
					
						
							|  |  |  | // limitations under the License.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-01 17:45:41 +08:00
										 |  |  | #ifndef PHY_INIT_DATA_H
 | 
					
						
							|  |  |  | #define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
 | 
					
						
							| 
									
										
										
										
											2016-11-15 18:36:18 +08:00
										 |  |  | #include "esp_phy_init.h"
 | 
					
						
							|  |  |  | #include "sdkconfig.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // constrain a value between 'low' and 'high', inclusive
 | 
					
						
							|  |  |  | #define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PHY_INIT_MAGIC "PHYINIT"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 17:28:56 +08:00
										 |  |  | // define the lowest tx power as LOWEST_PHY_TX_POWER
 | 
					
						
							|  |  |  | #define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52)
 | 
					
						
							|  |  |  | #define PHY_TX_POWER_OFFSET 44
 | 
					
						
							|  |  |  | #define PHY_TX_POWER_NUM    5
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-15 18:36:18 +08:00
										 |  |  | static const char phy_init_magic_pre[] = PHY_INIT_MAGIC; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Structure containing default recommended PHY initialization parameters. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  | static const esp_phy_init_data_t phy_init_data= { { | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         3, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         3, | 
					
						
							|  |  |  |         0x05, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0x09, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         0x06, | 
					
						
							|  |  |  |         0x05, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0x03, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         0x06, | 
					
						
							|  |  |  |         0x05, | 
					
						
							|  |  |  |         0x04, | 
					
						
							|  |  |  |         0x06, | 
					
						
							|  |  |  |         0x04, | 
					
						
							|  |  |  |         0x05, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x05, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0x09, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         0x06, | 
					
						
							|  |  |  |         0x05, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0x03, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         0x06, | 
					
						
							|  |  |  |         0x05, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							|  |  |  |         0x00, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0xfc, | 
					
						
							|  |  |  |         0xfc, | 
					
						
							|  |  |  |         0xfe, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         0xf0, | 
					
						
							|  |  |  |         0xf0, | 
					
						
							|  |  |  |         0xf0, | 
					
						
							|  |  |  |         0xe0, | 
					
						
							|  |  |  |         0xe0, | 
					
						
							|  |  |  |         0xe0, | 
					
						
							|  |  |  |         0x18, | 
					
						
							|  |  |  |         0x18, | 
					
						
							|  |  |  |         0x18, | 
					
						
							|  |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 78), | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 72), | 
					
						
							|  |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 66), | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 60), | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 56), | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52), | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         1, | 
					
						
							|  |  |  |         1, | 
					
						
							|  |  |  |         2, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         2, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  |         3, | 
					
						
							|  |  |  |         4, | 
					
						
							|  |  |  |         5, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							| 
									
										
										
										
											2017-10-17 11:22:46 +08:00
										 |  |  |         0, | 
					
						
							|  |  |  |         0, | 
					
						
							| 
									
										
										
										
											2017-10-09 14:37:42 +08:00
										 |  |  | } }; | 
					
						
							| 
									
										
										
										
											2016-11-15 18:36:18 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | static const char phy_init_magic_post[] = PHY_INIT_MAGIC; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-01 17:45:41 +08:00
										 |  |  | #endif /* PHY_INIT_DATA_H */
 | 
					
						
							|  |  |  | 
 |