/* Sets the orientation of the display data. 
Configures the display for a given orientation, including mirroring and/or screen rotation. */
void ili9325_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 ili9325_set_orientation(uint8_t flags)
{
	uint16_t setting = 0;
	setting |= (flags & ILI9325_FLIP_X ? ILI9325_ENTRY_MODE_ID(0x01) : 0);
	setting |= (flags & ILI9325_FLIP_Y ? ILI9325_ENTRY_MODE_ID(0x10) : 0);
	setting |= (flags & ILI9325_SWITCH_XY ? ILI9325_ENTRY_MODE_AM : 0);
	ili9325_write_register(ILI9325_ENTRY_MODE, ILI9325_ENTRY_MODE_TRI |
			ILI9325_ENTRY_MODE_DFM |setting |ILI9325_ENTRY_MODE_BGR);
}