Ejemplo n.º 1
0
// Initialization common to both shield & breakout configs
void Adafruit_TFTLCD::init(void) {
//
//#ifdef USE_ADAFRUIT_SHIELD_PINOUT
//  CS_IDLE; // Set all control bits to idle state
//  WR_IDLE;
//  RD_IDLE;
//  CD_DATA;
//  digitalWrite(5, HIGH); // Reset line
//  pinMode(A3, OUTPUT);   // Enable outputs
//  pinMode(A2, OUTPUT);
//  pinMode(A1, OUTPUT);
//  pinMode(A0, OUTPUT);
//  pinMode( 5, OUTPUT);
//#endif
//
//  setWriteDir(); // Set up LCD data port(s) for WRITE operations
  LCD_negateWr();
  LCD_negateRd();
  LCD_setDataMode();
  LCD_setWriteDataDirection();
  rotation  = 0;
  cursor_y  = cursor_x = 0;
  textsize  = 1;
  textcolor = 0xFFFF;
  _width    = TFTWIDTH;
  _height   = TFTHEIGHT;
}
Ejemplo n.º 2
0
// Reset pin is not connected so only the software writes occur. BLH
void Adafruit_TFTLCD::reset(void) {

//  CS_IDLE;
////  CD_DATA;
//  WR_IDLE;
//  RD_IDLE;
	LCD_setDataMode();
	LCD_negateWr();
	LCD_negateRd();
//
//#ifdef USE_ADAFRUIT_SHIELD_PINOUT
//  digitalWrite(5, LOW);
//  delay(2);
//  digitalWrite(5, HIGH);
//#else
//  if(_reset) {
//    digitalWrite(_reset, LOW);
//    delay(2);
//    digitalWrite(_reset, HIGH);
//  }
//#endif
//
//  // Data transfer sync
//  CS_ACTIVE;
//  CD_COMMAND;
  LCD_setCommandMode();
  LCD_write8(0x00);
  for(uint8_t i=0; i<3; i++)
	  //WR_STROBE; // Three extra 0x00s
	  LCD_strobeWriteLine();
//  CS_IDLE;
}
Ejemplo n.º 3
0
// This init intializes all of the hardware that talks to the LCD panel.
void LCD_init() {
//  printf("LCD_init called.\n\r");
  if (initFlag)  // Check to see if init has already been called.
    return;      // Already initialized, just return.
  int status;    // First call, continue...
  status = XGpio_Initialize(&gpioTftControl, LCD_CONTROL_DEVICE_ID);  // Xilinx GPIO init call.
  if (status != XST_SUCCESS) {
    printf("XGPIO_Initialize (TFT) failed\n\r.");
  }
  status = XGpio_Initialize(&gpioTftDataBus, LCD_DATA_BUS_DEVICE_ID); // Xilinx GPIO init call.
  if (status != XST_SUCCESS) {
    printf("XGPIO_Initialize (TFT Data Bus) failed\n\r.");
  }
  // Set the direction for all signals to be outputs (0 = output, 1 = input).
  XGpio_SetDataDirection(&gpioTftControl, 1, 0);  // Control bits are always outputs.
  XGpio_SetDataDirection(&gpioTftDataBus, 1, 0);  // Set up data-bus direction as output (write).
  mio_init(true);
  LCD_negateRd();  // negate the RD control signal.
  LCD_negateWr();  // negate the WR control signal.
  initFlag = true; // Note that init has been invoked.
}
Ejemplo n.º 4
0
// Set the GPIO pins on the LCD data bus for write operations.
void LCD_setWriteDataDirection() {
  LCD_negateRd();  // Take care to make sure that two drivers are not enabled at the same time.
  XGpio_SetDataDirection(&gpioTftDataBus, 1, 0);  // LCD data bus is output from ZYNQ perspective.
}