/* Sets the orientation of the display data. 
Configures the display for a given orientation, including mirroring and/or screen rotation. */
void ili9488_set_orientation(uint8_t flags)
/* Sets the orientation of the display data. 
Configures the display for a given orientation, including mirroring and/or screen rotation. */
void ili9488_set_orientation(uint8_t flags)
{
	ili9488_color_t madctl = 0x68;
	if (flags & ILI9488_FLIP_X) {
		madctl &= ~(1 << 6);
	}
	if (flags & ILI9488_FLIP_Y) {
		madctl |= 1 << 7;
	}
	if (flags & ILI9488_SWITCH_XY) {
		madctl &= ~(1 << 5);
	}
	ili9488_write_register(ILI9488_CMD_MEMORY_ACCESS_CONTROL, &madctl, 1);
}