1
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
25
31
32
39
40
43
48
49
50
51
52
53
71
72
73
76
81
82
85
90
91
94
99
100
101
107
108
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
134
135
136
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
201
202
203
210
211
212
213
214
215
220
221
222
223
229
230
231
232
233
234
235
236
/* ... */
#ifndef __ESP_COEXIST_H__
#define __ESP_COEXIST_H__
#include <stdbool.h>
#include "esp_err.h"
#include "hal/gpio_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define EXTERNAL_COEXIST_WIRE_1 0
#define EXTERNAL_COEXIST_WIRE_2 1
#define EXTERNAL_COEXIST_WIRE_3 2
#define EXTERNAL_COEXIST_WIRE_4 3
/* ... */
typedef enum {
ESP_COEX_PREFER_WIFI = 0,
ESP_COEX_PREFER_BT,
ESP_COEX_PREFER_BALANCE,
ESP_COEX_PREFER_NUM,
}{ ... } esp_coex_prefer_t;
typedef enum {
EXTERN_COEX_WIRE_1 = EXTERNAL_COEXIST_WIRE_1,
EXTERN_COEX_WIRE_2 = EXTERNAL_COEXIST_WIRE_2,
EXTERN_COEX_WIRE_3 = EXTERNAL_COEXIST_WIRE_3,
EXTERN_COEX_WIRE_4 = EXTERNAL_COEXIST_WIRE_4,
EXTERN_COEX_WIRE_NUM,
}{ ... } external_coex_wire_t;
/* ... */
typedef enum {
ESP_COEX_ST_TYPE_WIFI = 0,
ESP_COEX_ST_TYPE_BLE,
ESP_COEX_ST_TYPE_BT,
}{ ... } esp_coex_status_type_t;
#if CONFIG_EXTERNAL_COEX_ENABLE
/* ... */
typedef struct {
union {
uint32_t in_pin0 __attribute__((deprecated("Use 'request' instead")));
gpio_num_t request;
}{...};
union {
uint32_t in_pin1 __attribute__((deprecated("Use 'priority' instead")));
gpio_num_t priority;
}{...};
union {
uint32_t out_pin0 __attribute__((deprecated("Use 'grant' instead")));
gpio_num_t grant;
}{...};
union {
uint32_t out_pin1 __attribute__((deprecated("Use 'tx_line' instead")));
gpio_num_t tx_line;
}{...};
}{...} esp_external_coex_gpio_set_t;
/* ... */
typedef enum {
EXTERN_COEX_PTI_MID = 0,
EXTERN_COEX_PTI_HIGH,
EXTERN_COEX_PTI_NUM,
}{...} esp_coex_pti_level_t;
/* ... */
typedef enum {
EXTERNAL_COEX_LEADER_ROLE = 0,
EXTERNAL_COEX_FOLLOWER_ROLE = 2,
EXTERNAL_COEX_UNKNOWN_ROLE,
}{...} esp_extern_coex_work_mode_t;
/* ... */
typedef struct {
esp_extern_coex_work_mode_t work_mode;
uint8_t delay_us;
bool is_high_valid;
}{...} esp_external_coex_advance_t;/* ... */
#endif
#define ESP_COEX_BLE_ST_MESH_CONFIG 0x08
#define ESP_COEX_BLE_ST_MESH_TRAFFIC 0x10
#define ESP_COEX_BLE_ST_MESH_STANDBY 0x20
#define ESP_COEX_BT_ST_A2DP_STREAMING 0x10
#define ESP_COEX_BT_ST_A2DP_PAUSED 0x205 defines
/* ... */
const char *esp_coex_version_get(void);
/* ... */
esp_err_t esp_coex_preference_set(esp_coex_prefer_t prefer);
/* ... */
esp_err_t esp_coex_status_bit_set(esp_coex_status_type_t type, uint32_t status);
/* ... */
esp_err_t esp_coex_status_bit_clear(esp_coex_status_type_t type, uint32_t status);
#if CONFIG_EXTERNAL_COEX_ENABLE
/* ... */
esp_err_t esp_external_coex_set_work_mode(esp_extern_coex_work_mode_t work_mode);
/* ... */
esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type,
esp_external_coex_gpio_set_t gpio_pin);
/* ... */
esp_err_t esp_disable_extern_coex_gpio_pin(void);
#if SOC_EXTERNAL_COEX_ADVANCE
/* ... */
esp_err_t esp_external_coex_leader_role_set_gpio_pin(external_coex_wire_t wire_type, uint32_t request, uint32_t priority,
uint32_t grant) __attribute__((deprecated("Please use esp_external_coex_set_work_mode and esp_enable_extern_coex_gpio_pin instead")));
/* ... */
esp_err_t esp_external_coex_follower_role_set_gpio_pin(external_coex_wire_t wire_type, uint32_t request, uint32_t priority,
uint32_t grant) __attribute__((deprecated("Please use esp_external_coex_set_work_mode and esp_enable_extern_coex_gpio_pin instead")));
/* ... */
esp_err_t esp_external_coex_set_grant_delay(uint8_t delay_us);
/* ... */
esp_err_t esp_external_coex_set_validate_high(bool is_high_valid);/* ... */
#endif /* ... */
#endif
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_SOC_IEEE802154_SUPPORTED
/* ... */
esp_err_t esp_coex_wifi_i154_enable(void);/* ... */
#endif
#if CONFIG_ESP_COEX_GPIO_DEBUG
/* ... */
esp_err_t esp_coexist_debug_init(void);/* ... */
#endif
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif