/* Copy pixels from the screen to a pixel buffer. 
Use this function to copy pixels from the display to an internal SRAM buffer. Limits have to be set prior to calling this function, e.g.:  */
void hx8347a_copy_pixels_from_screen(hx8347a_color_t *pixels, uint32_t count)
/* Copy pixels from the screen to a pixel buffer. 
Use this function to copy pixels from the display to an internal SRAM buffer. Limits have to be set prior to calling this function, e.g.:  */
void hx8347a_copy_pixels_from_screen(hx8347a_color_t *pixels, uint32_t count)
{
	uint8_t red;
	uint8_t green;
	uint8_t blue;
	Assert(count > 0);
	hx8347a_select_register(HX8347A_SRAMWRITE);
	hx8347a_select_chip();
	hx8347a_send_byte(HX8347A_START_READREG);
	red = hx8347a_read_byte();
	while (count > 0) {
		red = hx8347a_read_byte();
		green = hx8347a_read_byte();
		blue = hx8347a_read_byte();
		*pixels = HX8347A_COLOR(red, green, blue);
		pixels++;
		count--;
	}
	hx8347a_deselect_chip();
}