libs/epaper/src/epaper.c
/**
 *  @brief: clear the frame memory with the specified color.
 *          this won't update the display.
 */
@brief: clear the frame memory with the specified color.
this won't update the display.
@brief : clear the frame memory with the specified color . this won ' t update the display .
void mgos_epd_clear_frame_memory(const uint8_t color)
{
	int i;
	mgos_epd_set_memory_area(0, 0, _width - 1, _height - 1);
	mgos_epd_set_memory_pointer(0, 0);
	mgos_epd_send_command(WRITE_RAM);
	#if 0
	for (i=0; i < ((_width / 8) * _height); i++) {
		mgos_epd_send_data(color);
	}
	#else
	uint8_t *tmp_buffer = (uint8_t *)calloc(1, _height);
	memset(tmp_buffer, color, _height);
	for (i=0; i < (_width / 8); i++) {
		mgos_epd_send_data_n(tmp_buffer, _height);
	}
	free(tmp_buffer);
	#endif
	mgos_epd_wait_idle();
}
void mgos_epd_clear_frame_memory ( const uint8_t color ) { int i ; mgos_epd_set_memory_area ( 0 , 0 , _width - 1 , _height - 1 ) ; mgos_epd_set_memory_pointer ( 0 , 0 ) ; mgos_epd_send_command ( WRITE_RAM ) ; #if 0 for ( i = 0 ; i < ( ( _width / 8 ) * _height ) ; i ++ ) { mgos_epd_send_data ( color ) ; } #else uint8_t * tmp_buffer = ( uint8_t * ) calloc ( 1 , _height ) ; memset ( tmp_buffer , color , _height ) ; for ( i = 0 ; i < ( _width / 8 ) ; i ++ ) { mgos_epd_send_data_n ( tmp_buffer , _height ) ; } free ( tmp_buffer ) ; #endif mgos_epd_wait_idle ( ) ; }
@brief: clear the frame memory with the specified color.
@brief : clear the frame memory with the specified color .
// send the color data