1 // Copyright 2020 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 #ifndef ESP_APP_TRACE_PORT_H_
15 #define ESP_APP_TRACE_PORT_H_
16 
17 #include "esp_app_trace_util.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /** Apptrace HW interface. */
24 typedef struct {
25     esp_err_t (*init)(void *hw_data);
26     uint8_t *(*get_up_buffer)(void *hw_data, uint32_t, esp_apptrace_tmo_t *);
27     esp_err_t (*put_up_buffer)(void *hw_data, uint8_t *, esp_apptrace_tmo_t *);
28     esp_err_t (*flush_up_buffer_nolock)(void *hw_data, uint32_t, esp_apptrace_tmo_t *);
29     esp_err_t (*flush_up_buffer)(void *hw_data, esp_apptrace_tmo_t *);
30     void (*down_buffer_config)(void *hw_data, uint8_t *buf, uint32_t size);
31     uint8_t *(*get_down_buffer)(void *hw_data, uint32_t *, esp_apptrace_tmo_t *);
32     esp_err_t (*put_down_buffer)(void *hw_data, uint8_t *, esp_apptrace_tmo_t *);
33     bool (*host_is_connected)(void *hw_data);
34 } esp_apptrace_hw_t;
35 
36 esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data);
37 esp_apptrace_hw_t *esp_apptrace_uart_hw_get(int num, void **data);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif
44