@@ -73,9 +73,9 @@ static uint8_t il3820_lut_initial[] = {
7373 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
7474};
7575static uint8_t il3820_lut_default [] = {
76- 0x10 , 0x18 , 0x18 , 0x08 , 0x18 , 0x18 ,
77- 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
78- 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
76+ 0x10 , 0x18 , 0x18 , 0x08 , 0x18 , 0x18 ,
77+ 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
78+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
7979 0x00 , 0x00 , 0x13 , 0x14 , 0x44 , 0x12 ,
8080 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
8181};
@@ -113,7 +113,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
113113 uint8_t * buffer = (uint8_t * ) color_map ;
114114 uint16_t x_addr_counter = 0 ;
115115 uint16_t y_addr_counter = 0 ;
116-
116+
117117 /* Configure entry mode */
118118 il3820_write_cmd (IL3820_CMD_ENTRY_MODE , & il3820_scan_mode , 1 );
119119
@@ -131,15 +131,15 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
131131 il3820_set_cursor (x_addr_counter , y_addr_counter );
132132
133133 il3820_send_cmd (IL3820_CMD_WRITE_RAM );
134-
134+
135135 /* Write the pixel data to graphic RAM, linelen bytes at the time. */
136136 for (size_t row = 0 ; row <= (EPD_PANEL_HEIGHT - 1 ); row ++ ){
137137 il3820_send_data (buffer , linelen );
138138 buffer += IL3820_COLUMNS ;
139139 }
140140
141141 il3820_set_window (0 , EPD_PANEL_WIDTH - 1 , 0 , EPD_PANEL_HEIGHT - 1 );
142-
142+
143143 il3820_update_display ();
144144
145145 /* IMPORTANT!!!
@@ -152,7 +152,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
152152 * BIT_SET(byte_index, bit_index) clears the bit_index pixel at byte_index of
153153 * the display buffer.
154154 * BIT_CLEAR(byte_index, bit_index) sets the bit_index pixel at the byte_index
155- * of the display buffer. */
155+ * of the display buffer. */
156156void il3820_set_px_cb (lv_disp_drv_t * disp_drv , uint8_t * buf ,
157157 lv_coord_t buf_w , lv_coord_t x , lv_coord_t y ,
158158 lv_color_t color , lv_opa_t opa )
@@ -217,7 +217,7 @@ void il3820_init(void)
217217
218218 /* Software reset */
219219 il3820_write_cmd (IL3820_CMD_SW_RESET , NULL , 0 );
220-
220+
221221 /* Busy wait for the BUSY signal to go low */
222222 il3820_waitbusy (IL3820_WAIT );
223223
@@ -245,10 +245,10 @@ void il3820_init(void)
245245
246246 // allow partial updates now
247247 il3820_partial = true;
248-
248+
249249 /* Update LUT */
250250 il3820_write_cmd (IL3820_CMD_UPDATE_LUT , il3820_lut_default , sizeof (il3820_lut_default ));
251-
251+
252252 /* Clear control memory and update */
253253 il3820_clear_cntlr_mem (IL3820_CMD_WRITE_RAM , true);
254254}
@@ -257,10 +257,10 @@ void il3820_init(void)
257257void il3820_sleep_in (void )
258258{
259259 uint8_t data [] = {0x01 };
260-
260+
261261 /* Wait for the BUSY signal to go low */
262262 il3820_waitbusy (IL3820_WAIT );
263-
263+
264264 il3820_write_cmd (IL3820_CMD_SLEEP_MODE , data , 1 );
265265}
266266
@@ -270,15 +270,15 @@ static void il3820_waitbusy(int wait_ms)
270270 int i = 0 ;
271271
272272 vTaskDelay (10 / portTICK_RATE_MS ); // 10ms delay
273-
273+
274274 for (i = 0 ; i < (wait_ms * 10 ); i ++ ) {
275275 if (gpio_get_level (IL3820_BUSY_PIN ) != IL3820_BUSY_LEVEL ) {
276276 return ;
277277 }
278-
278+
279279 vTaskDelay (10 / portTICK_RATE_MS );
280280 }
281-
281+
282282 ESP_LOGE ( TAG , "busy exceeded %dms" , i * 10 );
283283}
284284
@@ -294,10 +294,10 @@ static inline void il3820_data_mode(void)
294294 gpio_set_level (IL3820_DC_PIN , 1 );
295295}
296296
297- static inline void il3820_write_cmd (uint8_t cmd , uint8_t * data , size_t len )
297+ static inline void il3820_write_cmd (uint8_t cmd , uint8_t * data , size_t len )
298298{
299299 disp_wait_for_pending_transactions ();
300-
300+
301301 il3820_command_mode ();
302302 disp_spi_send_data (& cmd , 1 );
303303
@@ -308,10 +308,10 @@ static inline void il3820_write_cmd(uint8_t cmd, uint8_t *data, size_t len)
308308}
309309
310310/* Send cmd to the display */
311- static inline void il3820_send_cmd (uint8_t cmd )
311+ static inline void il3820_send_cmd (uint8_t cmd )
312312{
313313 disp_wait_for_pending_transactions ();
314-
314+
315315 il3820_command_mode ();
316316 disp_spi_send_data (& cmd , 1 );
317317}
@@ -320,14 +320,14 @@ static inline void il3820_send_cmd(uint8_t cmd)
320320static void il3820_send_data (uint8_t * data , uint16_t length )
321321{
322322 disp_wait_for_pending_transactions ();
323-
323+
324324 il3820_data_mode ();
325325 disp_spi_send_colors (data , length );
326326}
327327
328328/* Specify the start/end positions of the window address in the X and Y
329329 * directions by an address unit.
330- *
330+ *
331331 * @param sx: X Start position.
332332 * @param ex: X End position.
333333 * @param ys: Y Start position.
@@ -336,7 +336,7 @@ static void il3820_send_data(uint8_t *data, uint16_t length)
336336static inline void il3820_set_window ( uint16_t sx , uint16_t ex , uint16_t ys , uint16_t ye )
337337{
338338 uint8_t tmp [4 ] = {0 };
339-
339+
340340 tmp [0 ] = sx / 8 ;
341341 tmp [1 ] = ex / 8 ;
342342
@@ -384,7 +384,7 @@ static void il3820_update_display(void)
384384 } else {
385385 tmp = (IL3820_CTRL2_ENABLE_CLK | IL3820_CTRL2_ENABLE_ANALOG | IL3820_CTRL2_TO_PATTERN );
386386 }
387-
387+
388388 il3820_write_cmd (IL3820_CMD_UPDATE_CTRL2 , & tmp , 1 );
389389
390390 il3820_write_cmd (IL3820_CMD_MASTER_ACTIVATION , NULL , 0 );
@@ -400,10 +400,10 @@ static void il3820_clear_cntlr_mem(uint8_t ram_cmd, bool update)
400400 /* Arrays used by SPI must be word alligned */
401401 WORD_ALIGNED_ATTR uint8_t clear_page [IL3820_COLUMNS ];
402402 memset (clear_page , 0xff , sizeof clear_page );
403-
403+
404404 /* Configure entry mode */
405405 il3820_write_cmd (IL3820_CMD_ENTRY_MODE , & il3820_scan_mode , 1 );
406-
406+
407407 /* Configure the window */
408408 il3820_set_window (0 , EPD_PANEL_WIDTH - 1 , 0 , EPD_PANEL_HEIGHT - 1 );
409409
0 commit comments