1
6
7
8
9
10
11
12
13
14
15
16
17
18
19
23
24
25
26
27
28
29
30
31
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
90
91
92
93
94
95
96
97
98
99
100
101
102
106
107
108
109
110
111
112
113
114
115
116
117
118
121
122
/* ... */
#pragma once
#include <stdbool.h>
#include "esp_err.h"
#include "esp_lcd_types.h"
#include "driver/i2c_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint32_t esp_lcd_i2c_bus_handle_t;
/* ... */
typedef struct {
uint32_t dev_addr;
esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done;
void *user_ctx;
size_t control_phase_bytes;
unsigned int dc_bit_offset;
int lcd_cmd_bits;
int lcd_param_bits;
struct {
unsigned int dc_low_on_data: 1;
unsigned int disable_control_phase: 1;
}{ ... } flags;
uint32_t scl_speed_hz;
}{ ... } esp_lcd_panel_io_i2c_config_t;
/* ... */
esp_err_t esp_lcd_new_panel_io_i2c_v1(uint32_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io);
/* ... */
esp_err_t esp_lcd_new_panel_io_i2c_v2(i2c_master_bus_handle_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io);
#ifdef __cplusplus
}{...}
#endif
#ifdef __cplusplus
/* ... */
static inline esp_err_t esp_lcd_new_panel_io_i2c(uint32_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io)
{
return esp_lcd_new_panel_io_i2c_v1(bus, io_config, ret_io);
}{...}
/* ... */
static inline esp_err_t esp_lcd_new_panel_io_i2c(i2c_master_bus_handle_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io)
{
return esp_lcd_new_panel_io_i2c_v2(bus, io_config, ret_io);
}{...}
/* ... */#else
/* ... */
#define esp_lcd_new_panel_io_i2c(bus, io_config, ret_io) _Generic((bus), \
i2c_master_bus_handle_t : esp_lcd_new_panel_io_i2c_v2, \
default : esp_lcd_new_panel_io_i2c_v1) (bus, io_config, ret_io)...
/* ... */
#endif