forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepd_bw_spi_params.h
205 lines (180 loc) · 5.42 KB
/
epd_bw_spi_params.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
195
196
197
198
199
200
201
202
203
204
205
/*
* Copyright (C) 2019 Silke Hofstra
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup drivers_epd_bw_spi
*
* @{
* @file
* @brief Default configuration for epd_bw_spi
*
* @author Silke Hofstra <silke@slxh.eu>
*/
#ifndef EPD_BW_SPI_PARAMS_H
#define EPD_BW_SPI_PARAMS_H
#include "board.h"
#include "epd_bw_spi.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Waveform lookup table for a full display refresh for IL3829.
*/
static const uint8_t epd_bw_spi_il3829_lut_default_full[] = {
0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/**
* @brief Waveform lookup table for a partial display refresh for IL3829.
*/
static const uint8_t epd_bw_spi_il3829_lut_default_part[] = {
0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/**
* @brief Configuration for IL3829 e-paper display controller
*/
#define EPD_BW_SPI_CONTROLLER_IL3829 { \
.vcom = 0xA8, \
.size_x = 200, \
.size_y = 300, \
.lut_size = sizeof epd_bw_spi_il3829_lut_default_full, \
.lut_full = epd_bw_spi_il3829_lut_default_full, \
.lut_part = epd_bw_spi_il3829_lut_default_part, \
}
/**
* @brief Configuration for SSD1607 e-paper display controller
*/
#define EPD_BW_SPI_CONTROLLER_SSD1607 EPD_BW_SPI_CONTROLLER_IL3829
/**
* @brief Configuration for SSD1673 e-paper display controller
*/
#define EPD_BW_SPI_CONTROLLER_SSD1673 { \
.vcom = 0xA8, \
.size_x = 150, \
.size_y = 250, \
.lut_size = sizeof epd_bw_spi_il3829_lut_default_full, \
.lut_full = epd_bw_spi_il3829_lut_default_full, \
.lut_part = epd_bw_spi_il3829_lut_default_part, \
}
/**
* @brief Configuration for SSD1608 e-paper display controller
*/
#define EPD_BW_SPI_CONTROLLER_SSD1608 { \
.vcom = 0xA8, \
.size_x = 240, \
.size_y = 320, \
.lut_size = sizeof epd_bw_spi_il3829_lut_default_full, \
.lut_full = epd_bw_spi_il3829_lut_default_full, \
.lut_part = epd_bw_spi_il3829_lut_default_part, \
}
#ifndef EPD_BW_SPI_DISPLAY_X
/**
* @brief Width of the display in pixels.
*/
#define EPD_BW_SPI_DISPLAY_X (200)
#endif
#ifndef EPD_BW_SPI_DISPLAY_Y
/**
* @brief Height of the display in pixels.
*/
#define EPD_BW_SPI_DISPLAY_Y (200)
#endif
#ifndef EPD_BW_SPI_PARAM_SPI
/**
* @brief SPI device the display is connected to.
*/
#define EPD_BW_SPI_PARAM_SPI (SPI_DEV(0))
#endif
#ifndef EPD_BW_SPI_PARAM_SPI_CLK
/**
* @brief SPI device clock speed.
*/
#define EPD_BW_SPI_PARAM_SPI_CLK (SPI_CLK_5MHZ)
#endif
/**
* @brief SPI Chip select pin.
*/
#ifndef EPD_BW_SPI_PARAM_CS
#define EPD_BW_SPI_PARAM_CS (SPI_CS_UNDEF)
#endif
/**
* @brief Data/command pin of the display.
*/
#ifndef EPD_BW_SPI_PARAM_DC
#define EPD_BW_SPI_PARAM_DC (GPIO_UNDEF)
#endif
/**
* @brief Reset pin of the display.
*/
#ifndef EPD_BW_SPI_PARAM_RST
#define EPD_BW_SPI_PARAM_RST (GPIO_UNDEF)
#endif
#ifndef EPD_BW_SPI_PARAM_BUSY
/**
* @brief Busy pin of the display.
*/
#define EPD_BW_SPI_PARAM_BUSY (GPIO_UNDEF)
#endif
#ifndef EPD_BW_SPI_PARAM_BUSY_VAL
/**
* @brief Width of the display in pixels.
*/
#define EPD_BW_SPI_PARAM_BUSY_VAL (1)
#endif
#ifndef EPD_BW_SPI_CONTROLLER
/**
* @brief Display controller. See epd_bw_spi_controller_t.
*/
#define EPD_BW_SPI_CONTROLLER EPD_BW_SPI_CONTROLLER_IL3829
#endif
#ifndef EPD_BW_SPI_ENTRY_MODE
/**
* @brief Data entry mode. See epd_bw_spi_entry_mode_t.
*/
#define EPD_BW_SPI_ENTRY_MODE EPD_BW_SPI_Y_INC_X_INC
#endif
#ifndef EPD_BW_SPI_PARTIAL_REFRESH_MAX
/**
* @brief Maximum number of partial refreshes before a full refresh occurs.
*
* This is only used with epd_bw_spi_init_auto and @ref drivers_disp_dev.
*/
#define EPD_BW_SPI_PARTIAL_REFRESH_MAX (99)
#endif
#ifndef EPD_BW_SPI_PARAMS
/**
* @brief Parameters to initialize the display with.
*/
#define EPD_BW_SPI_PARAMS { .spi = EPD_BW_SPI_PARAM_SPI, \
.spi_clk = EPD_BW_SPI_PARAM_SPI_CLK, \
.cs_pin = EPD_BW_SPI_PARAM_CS, \
.dc_pin = EPD_BW_SPI_PARAM_DC, \
.rst_pin = EPD_BW_SPI_PARAM_RST, \
.busy_pin = EPD_BW_SPI_PARAM_BUSY, \
.busy_value = EPD_BW_SPI_PARAM_BUSY_VAL, \
.controller = EPD_BW_SPI_CONTROLLER, \
.entry_mode = EPD_BW_SPI_ENTRY_MODE, \
.size_x = EPD_BW_SPI_DISPLAY_X, \
.size_y = EPD_BW_SPI_DISPLAY_Y, \
.partial_refresh_max = \
EPD_BW_SPI_PARTIAL_REFRESH_MAX, \
}
#endif
/**
* @brief Display driver configuration.
*/
static const epd_bw_spi_params_t epd_bw_spi_params[] =
{
EPD_BW_SPI_PARAMS,
};
#ifdef __cplusplus
}
#endif
#endif /* EPD_BW_SPI_PARAMS_H */
/**@}*/