@@ -217,75 +217,54 @@ void board_init(void) {
217217 display -> base .type = & epaperdisplay_epaperdisplay_type ;
218218
219219 if (is_ssd1680 ) {
220- common_hal_epaperdisplay_epaperdisplay_construct (
221- display ,
222- bus ,
223- ssd1680_display_start_sequence , sizeof (ssd1680_display_start_sequence ),
224- 0 , // start up time
225- ssd1680_display_stop_sequence , sizeof (ssd1680_display_stop_sequence ),
226- 296 , // width
227- 128 , // height
228- 250 , // ram_width
229- 296 , // ram_height
230- 0 , // colstart
231- 0 , // rowstart
232- 270 , // rotation
233- 0x44 , // set_column_window_command
234- 0x45 , // set_row_window_command
235- 0x4e , // set_current_column_command
236- 0x4f , // set_current_row_command
237- 0x24 , // write_black_ram_command
238- false, // black_bits_inverted
239- 0x26 , // write_color_ram_command
240- false, // color_bits_inverted
241- 0x000000 , // highlight_color
242- 0x000000 , // highlight_color2
243- ssd1680_display_refresh_sequence , sizeof (ssd1680_display_refresh_sequence ),
244- 1.0 , // refresh_time
245- & pin_GPIO5 , // busy_pin
246- true, // busy_state
247- 5.0 , // seconds_per_frame
248- false, // always_toggle_chip_select
249- true, // grayscale
250- false, // acep
251- false, // spectra6
252- true, // two_byte_sequence_length
253- true); // address_little_endian
220+ epaperdisplay_construct_args_t args = EPAPERDISPLAY_CONSTRUCT_ARGS_DEFAULTS ;
221+ args .bus = bus ;
222+ args .start_sequence = ssd1680_display_start_sequence ;
223+ args .start_sequence_len = sizeof (ssd1680_display_start_sequence );
224+ args .stop_sequence = ssd1680_display_stop_sequence ;
225+ args .stop_sequence_len = sizeof (ssd1680_display_stop_sequence );
226+ args .width = 296 ;
227+ args .height = 128 ;
228+ args .ram_width = 250 ;
229+ args .ram_height = 296 ;
230+ args .rotation = 270 ;
231+ args .set_column_window_command = 0x44 ;
232+ args .set_row_window_command = 0x45 ;
233+ args .set_current_column_command = 0x4e ;
234+ args .set_current_row_command = 0x4f ;
235+ args .write_black_ram_command = 0x24 ;
236+ args .write_color_ram_command = 0x26 ;
237+ args .refresh_sequence = ssd1680_display_refresh_sequence ;
238+ args .refresh_sequence_len = sizeof (ssd1680_display_refresh_sequence );
239+ args .refresh_time = 1.0 ;
240+ args .busy_pin = & pin_GPIO5 ;
241+ args .busy_state = true;
242+ args .seconds_per_frame = 5.0 ;
243+ args .grayscale = true;
244+ args .two_byte_sequence_length = true;
245+ args .address_little_endian = true;
246+ common_hal_epaperdisplay_epaperdisplay_construct (display , & args );
254247 } else {
255- common_hal_epaperdisplay_epaperdisplay_construct (
256- display ,
257- bus ,
258- il0373_display_start_sequence , sizeof (il0373_display_start_sequence ),
259- 0 , // start up time
260- il0373_display_stop_sequence , sizeof (il0373_display_stop_sequence ),
261- 296 , // width
262- 128 , // height
263- 160 , // ram_width
264- 296 , // ram_height
265- 0 , // colstart
266- 0 , // rowstart
267- 270 , // rotation
268- NO_COMMAND , // set_column_window_command
269- NO_COMMAND , // set_row_window_command
270- NO_COMMAND , // set_current_column_command
271- NO_COMMAND , // set_current_row_command
272- 0x10 , // write_black_ram_command
273- false, // black_bits_inverted
274- 0x13 , // write_color_ram_command
275- false, // color_bits_inverted
276- 0x000000 , // highlight_color
277- 0x000000 , // highlight_color2
278- il0373_display_refresh_sequence , sizeof (il0373_display_refresh_sequence ),
279- 1.0 , // refresh_time
280- & pin_GPIO5 , // busy_pin
281- false, // busy_state
282- 5.0 , // seconds_per_frame
283- false, // always_toggle_chip_select
284- true, // grayscale
285- false, // acep
286- false, // spectra6
287- false, // two_byte_sequence_length
288- false); // address_little_endian
248+ epaperdisplay_construct_args_t args = EPAPERDISPLAY_CONSTRUCT_ARGS_DEFAULTS ;
249+ args .bus = bus ;
250+ args .start_sequence = il0373_display_start_sequence ;
251+ args .start_sequence_len = sizeof (il0373_display_start_sequence );
252+ args .stop_sequence = il0373_display_stop_sequence ;
253+ args .stop_sequence_len = sizeof (il0373_display_stop_sequence );
254+ args .width = 296 ;
255+ args .height = 128 ;
256+ args .ram_width = 160 ;
257+ args .ram_height = 296 ;
258+ args .rotation = 270 ;
259+ args .write_black_ram_command = 0x10 ;
260+ args .write_color_ram_command = 0x13 ;
261+ args .refresh_sequence = il0373_display_refresh_sequence ;
262+ args .refresh_sequence_len = sizeof (il0373_display_refresh_sequence );
263+ args .refresh_time = 1.0 ;
264+ args .busy_pin = & pin_GPIO5 ;
265+ args .seconds_per_frame = 5.0 ;
266+ args .grayscale = true;
267+ common_hal_epaperdisplay_epaperdisplay_construct (display , & args );
289268 }
290269}
291270
0 commit comments