Пример #1
0
//set coordinate for print or other function
void ILI9163::setAddress(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2) {
	writeCommand(ILI9163_CMD_SET_COLUMN_ADDRESS);
	writeData16(x1);
	writeData16(x2);

	writeCommand(ILI9163_CMD_SET_PAGE_ADDRESS);
	writeData16(y1);
	writeData16(y2);
	// memory write
	writeCommand(ILI9163_CMD_WRITE_MEMORY_START);
}
Пример #2
0
//set coordinate for print or other function
void ILI9341::setAddress(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2) {
	writeCommand(ILI9341_CMD_COLUMN_ADDRESS_SET);
	writeData16(x1);
	writeData16(x2);

	writeCommand(ILI9341_CMD_PAGE_ADDRESS_SET);
	writeData16(y1);
	writeData16(y2);
	// memory write
	writeCommand(ILI9341_CMD_MEMORY_WRITE);
}
Пример #3
0
// draw pixel
// pixels will always be counted from right side.x is representing LCD width which will always be less than 240.Y is representing LCD height which will always be less than 320
void ILI9341::drawPixel(uint16_t x, uint16_t y, uint16_t colour) {
	if ((x < 0) || (x >= width) || (y < 0) || (y >= height)) return;
	setAddress(x, y, x + 1, y + 1);
	writeData16(colour);
}
Пример #4
0
void GxIO_SPI::writeData16Transaction(uint16_t d, uint32_t num)
{
  if (_cs >= 0) digitalWrite(_cs, LOW);
  writeData16(d, num);
  if (_cs >= 0) digitalWrite(_cs, HIGH);
}