/* Set horizontal and vertical flip mode of display controller.  */
EMSTATUS DMD_flipDisplay(int horizontal, int vertical)
/* Set horizontal and vertical flip mode of display controller.  */
EMSTATUS DMD_flipDisplay(int horizontal, int vertical)
{
  uint16_t reg;
  reg = rcDriverOutputControl;
  if (horizontal) reg &= ~DMD_SSD2119_DRIVER_OUTPUT_CONTROL_RL;
  else reg |= DMD_SSD2119_DRIVER_OUTPUT_CONTROL_RL;
  if (vertical) reg &= ~DMD_SSD2119_DRIVER_OUTPUT_CONTROL_TB;
  else reg |= DMD_SSD2119_DRIVER_OUTPUT_CONTROL_TB;
  rcDriverOutputControl = reg;
  DMDIF_writeReg(DMD_SSD2119_DRIVER_OUTPUT_CONTROL, rcDriverOutputControl);
  return DMD_OK;
}