]> granicus.if.org Git - esp-idf/blob - components/esp32/phy.h
deep sleep: fix regression due to moving ets_update_cpu_frequency into IRAM
[esp-idf] / components / esp32 / phy.h
1 // Copyright 2015-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
15 #pragma once
16 #include "esp_phy_init.h"
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 /**
23  * @file phy.h
24  * @brief Declarations for functions provided by libphy.a
25  */
26
27 /**
28  * @brief Initialize function pointer table in PHY library.
29  * @note This function should be called before register_chipv7_phy.
30  */
31 void phy_get_romfunc_addr(void);
32
33 /**
34  * @brief Initialize PHY module and do RF calibration
35  * @param[in] init_data Initialization parameters to be used by the PHY
36  * @param[inout] cal_data As input, calibration data previously obtained. As output, will contain new calibration data.
37  * @param[in] cal_mode  RF calibration mode
38  * @return reserved for future use
39  */
40 int register_chipv7_phy(const esp_phy_init_data_t* init_data, esp_phy_calibration_data_t *cal_data, esp_phy_calibration_mode_t cal_mode);
41
42 /**
43  * @brief Get the format version of calibration data used by PHY library.
44  * @return Format version number, OR'ed with BIT(16) if PHY is in WIFI only mode.
45  */
46 uint32_t phy_get_rf_cal_version();
47
48 /**
49  * @brief Set RF/BB for only WIFI mode or coexist(WIFI & BT) mode
50  * @param[in] true is for only WIFI mode, false is for coexist mode. default is 0.
51  * @return NULL
52  */
53 void phy_set_wifi_mode_only(bool wifi_only);
54
55 /**
56  * @brief Set BT the highest priority in coexist mode.
57  * @return NULL
58  */
59 void coex_bt_high_prio(void);
60
61 #ifdef __cplusplus
62 }
63 #endif
64