/* Sets the LCD orientation to horizontal and vertical.  */
void lcdSetOrientation(lcdOrientation_t orientation)
/* Sets the LCD orientation to horizontal and vertical.  */
void lcdSetOrientation(lcdOrientation_t orientation)
{
  uint16_t entryMode = 0x1030;
  uint16_t outputControl = 0x0100;
  switch (orientation)
  {
    case LCD_ORIENTATION_PORTRAIT:
      entryMode = 0x1030;
      outputControl = 0x0100;
      break;
    case LCD_ORIENTATION_LANDSCAPE:
      entryMode = 0x1028;
      outputControl = 0x0000;
      break;
  }
  ili9328Command(ILI9328_COMMANDS_ENTRYMODE, entryMode);
  ili9328Command(ILI9328_COMMANDS_DRIVEROUTPUTCONTROL1, outputControl);
  lcdOrientation = orientation;
  ili9328SetCursor(0, 0);
}