@@ -146,32 +146,33 @@ static int _set_vid(void) {
146
146
vid_setting = value ;
147
147
/*
148
148
Voltage Divider with 3.3V: (1241 * V)
149
- 10K/ 15K = 1.98V = 2458
150
- 15K/ 10K = 1.32V = 1638
151
- 15K/4.7K = 0.79V = 980
152
- 15K/ 2K = 1.32V = 482
153
- 15K/ 1K = 1.32V = 256
149
+ 10K/ 15K = 1.98V = 2458 GT 2000 = TBD
150
+ 15K/ 10K = 1.32V = 1638 GT 1200 = Explorer with SSD1681 BW
151
+ 15K/4.7K = 0.79V = 980 GT 600 = Explorer with SSD1681 BWR
152
+ 15K/ 2K = 0.39V = 482 GT 300 = Explorer with SSD1608 BW
153
+ 100K/ 10K = 0.30V = 372 ditto
154
+ 15K/ 1K = 0.21V = 256 GT 150 = DCNextGen with SSD1681 BWR
154
155
Note: extreme values (using 100K or greater) will not create a strong enough current for the ADC to read accurately
155
156
Note: we do not get a usable value when the voltage divider is missing
156
157
*/
157
158
158
159
// TODO change to min/max to tighten up the ranges (requires sampling of the initial boards)
159
160
if (value > 2800 ) {
160
- vid_setting = 9 ;
161
+ vid_setting = 9 ; // invalid
161
162
} else if (value > 2000 ) {
162
- vid_setting = 5 ;
163
+ vid_setting = 5 ; // future
163
164
} else if (value > 1200 ) {
164
- vid_setting = 4 ;
165
+ vid_setting = 4 ; // Explorer SSD1681 BW
165
166
} else if (value > 600 ) {
166
- vid_setting = 3 ;
167
+ vid_setting = 3 ; // Explorer SSD1681 BWR
167
168
} else if (value > 300 ) {
168
- vid_setting = 2 ;
169
+ vid_setting = 2 ; // Explorer SSD1608 BW
169
170
} else if (value > 150 ) {
170
- vid_setting = 1 ;
171
+ vid_setting = 1 ; // DCNextGen SSD1681 BWR
171
172
} else {
172
- vid_setting = 0 ;
173
- }
173
+ vid_setting = 0 ; // invalid
174
174
175
+ }
175
176
return vid_setting ;
176
177
}
177
178
@@ -227,8 +228,29 @@ void board_init(void) {
227
228
display = & allocate_display ()-> epaper_display ;
228
229
display -> base .type = & epaperdisplay_epaperdisplay_type ;
229
230
230
- // VID codes: 1 = tricolor ePaper (BWR), 2 = monochrome ePaper (BW), other codes are TBD
231
+ // default to no rotation
232
+ int rotation = 0 ;
231
233
if (vid_setting == 1 ) {
234
+ // DCNextGen SSD1681 BWR rotated 270
235
+ rotation = 270 ;
236
+ }
237
+
238
+ // default to BWR refresh rates
239
+ float refresh_time = 15.0 ;
240
+ float seconds_per_frame = 20.0 ;
241
+ if ((vid_setting == 2 ) || (vid_setting == 4 )) {
242
+ // BW displays have faster refresh rates
243
+ refresh_time = 1.0 ;
244
+ seconds_per_frame = 5.0 ;
245
+ }
246
+
247
+ // VID 1, 3, and 4 = SSD1681 display driver
248
+ // VID 2 = SSD1608 display driver
249
+
250
+ // VID codes: see above
251
+ if ((vid_setting == 1 ) || // DCNextGen SSD1681 BWR rotated 270
252
+ (vid_setting == 3 ) || // Explorer SSD1681 BW rotated 0
253
+ (vid_setting == 4 )) { // Explorer SSD1681 BWR rotated 0
232
254
common_hal_epaperdisplay_epaperdisplay_construct (
233
255
display ,
234
256
bus ,
@@ -241,7 +263,7 @@ void board_init(void) {
241
263
HEIGHT + 0x60 , // ram_height RAM is actually only 200 bits high but we use 296 to match the 9 bits
242
264
0 , // colstart
243
265
0 , // rowstart
244
- 270 , // rotation
266
+ rotation , // rotation
245
267
SSD_SET_RAMXPOS , // set_column_window_command
246
268
SSD_SET_RAMYPOS , // set_row_window_command
247
269
SSD_SET_RAMXCOUNT , // set_current_column_command
@@ -252,16 +274,16 @@ void board_init(void) {
252
274
false, // color_bits_inverted
253
275
0xFF0000 , // highlight_color (RED for tri-color display)
254
276
_refresh_sequence_ssd1681 , sizeof (_refresh_sequence_ssd1681 ), // refresh_display_command
255
- 15.0 , // refresh_time
277
+ refresh_time , // refresh_time
256
278
& pin_GPIO9 , // DEFAULT_SPI_BUS_BUSY, // busy_pin
257
279
true, // busy_state
258
- 20.0 , // seconds_per_frame (does not seem the user can change this)
280
+ seconds_per_frame , // seconds_per_frame (does not seem the user can change this)
259
281
true, // always_toggle_chip_select
260
282
false, // not grayscale
261
283
false, // not acep
262
284
false, // not two_byte_sequence_length
263
285
true); // address_little_endian
264
- } else if (vid_setting == 2 ) {
286
+ } else if (vid_setting == 2 ) { // Explorer SSD1608 BW
265
287
common_hal_epaperdisplay_epaperdisplay_construct (
266
288
display ,
267
289
bus ,
@@ -274,7 +296,7 @@ void board_init(void) {
274
296
HEIGHT /* + 0x60 */ , // ram_height RAM is actually only 200 bits high but we use 296 to match the 9 bits
275
297
0 , // colstart
276
298
0 , // rowstart
277
- 0 , // rotation
299
+ rotation , // rotation
278
300
SSD_SET_RAMXPOS , // set_column_window_command
279
301
SSD_SET_RAMYPOS , // set_row_window_command
280
302
SSD_SET_RAMXCOUNT , // set_current_column_command
@@ -285,10 +307,10 @@ void board_init(void) {
285
307
false, // color_bits_inverted
286
308
0x000000 , // highlight_color (RED for tri-color display)
287
309
_refresh_sequence_ssd1608 , sizeof (_refresh_sequence_ssd1608 ), // refresh_display_command
288
- 1.0 , // refresh_time
310
+ refresh_time , // refresh_time
289
311
& pin_GPIO9 , // DEFAULT_SPI_BUS_BUSY, // busy_pin
290
312
true, // busy_state
291
- 5.0 , // seconds_per_frame (does not seem the user can change this)
313
+ seconds_per_frame , // seconds_per_frame (does not seem the user can change this)
292
314
true, // always_toggle_chip_select
293
315
false, // not grayscale
294
316
false, // not acep
0 commit comments