ILI9327 commands

Does anybody know how to skip a line of pixels using ILI9327 library?
I mean not to do draw anythig until the end of current line of pixels then go to the next line and draw something. Something on the similarity of the alpha channel.

I'm trying to understand basing on the example that I have.

#include <SPI.h>              // We use this library, so it must be called here.
//
// GPA port - these show which wires from the LCD are connected to which pins on the I/O expander
//
#define LCD_RST  0b00001000	// reset                  0x08
#define LCD_RD   0b00010000	// not used               0x10
#define LCD_WR   0b00100000	// 1 = read; 0 = write    0x20
#define LCD_RS   0b01000000	// 1 = data; 0 = command  0x40
#define LCD_CS   0b10000000	// enable by toggling low 0x80

#define MCP23S17  B01000000       // MCP23017 SPI Address 

#define IODIRA    0x00            // MCP23017 address of I/O direction
#define IODIRB    0x01            // MCP23017 1=input
#define GPIOA     0x12            // MCP23017 address of GP Value
#define GPIOB     0x13            // MCP23017 address of GP Value

// SPI
#define SS        10               // Pin mapping to Arduino = SELECT
#define MOSI      11               // Pin mapping to Arduino = Master Out Slave In
#define SCLK      13               // Pin mapping to Arduino = Serial clock
#define MISO      12               // Pin mapping to Arduino = Master IN slave OUT

void setup()
{
  pinMode (SS, OUTPUT);
  SPI.begin();
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);
  SPI_portexpanderinit();
  initft();
  dis_color4(0xf800, 0x07e0, 0x001f, 0x07ff, 0xf81f, 0xffe0, 0x0000, 0xffff); //8色间隔画面
  SPI.end();
}

void loop(){}

void SPI_portexpanderinit()
{
  // --- Set I/O Direction
  SPI_TX(MCP23S17, IODIRB, B00000000);        // MCP23S17 port B = OUTPUT
  SPI_TX(MCP23S17, IODIRA, B00000000);        // MCP23S17 port A = OUTPUT
  //  --- Clear ALL Bits of GPIOA and GPIOB
  SPI_TX(MCP23S17, GPIOB, B00000000);         // MCP23S17 Clear port B
  SPI_TX(MCP23S17, GPIOA, B00000000);         // MCP23S17 Clear port A
}

void SPI_TX(int device, int regadd, int tx_data)
{
  PORTB &= 0b11111011;               // set CS low with direct write to digital pin 10
  SPI.transfer(device);              // device address write bit already 1ow
  SPI.transfer(regadd);
  SPI.transfer(tx_data);	
  PORTB |= 0b00000100;               // set CS high with direct write to digital pin 10
}

void cmd(int dat)
{ SPI_TX(MCP23S17, GPIOB, dat);
  SPI_TX(MCP23S17, GPIOA, B00011000);  //          10 08 toggle cs
  SPI_TX(MCP23S17, GPIOA, B10111000);  // 80    20 10 08
}
void writeData(int dat)
{ SPI_TX(MCP23S17, GPIOB, dat);
  SPI_TX(MCP23S17, GPIOA, B01011000);  //    40    10 08
  SPI_TX(MCP23S17, GPIOA, B11111000);  // 80 40 20 10 08 toggle cs, 
}

void initft()
{
  SPI_TX(MCP23S17, GPIOA, LCD_RST );
  delay(50);
  SPI_TX(MCP23S17, GPIOA, 0 );
  delay(10);
  SPI_TX(MCP23S17, GPIOA, B11111000);    // turn on all LCD control bits
  delay(50);
  cmd(0xE9);
  writeData (0x20);
  cmd(0x11); //Exit Sleep
  //delay(100);
  cmd(0xD1);
  writeData (0x00);
  writeData (0x71);
  writeData (0x19);
  cmd(0xD0);
  writeData (0x07);
  writeData (0x01);
  writeData (0x08);
  cmd(0x36);
  writeData (0x48);
  cmd(0x3A);
  writeData (0x05);
  cmd(0xC1);
  writeData (0x10);
  writeData (0x10);
  writeData (0x02);
  writeData (0x02);
  cmd(0xC0); //Set Default Gamma
  writeData (0x00);
  writeData (0x35);
  writeData (0x00);
  writeData (0x00);
  writeData (0x01);
  writeData (0x02);
  cmd(0xC5); //Set frame rate
  writeData (0x04);
  cmd(0xD2); //power setting
  writeData (0x01);
  writeData (0x44);
  cmd(0xC8); //Set Gamma
  writeData (0x04);
  writeData (0x67);
  writeData (0x35);
  writeData (0x04);
  writeData (0x08);
  writeData (0x06);
  writeData (0x24);
  writeData (0x01);
  writeData (0x37);
  writeData (0x40);
  writeData (0x03);
  writeData (0x10);
  writeData (0x08);
  writeData (0x80);
  writeData (0x00);
  cmd(0x2A);
  writeData (0x00);
  writeData (0x00);
  writeData (0x00);
  writeData (0xeF);
  cmd(0x2B);
  writeData (0x00);
  writeData (0x00);
  writeData (0x01);
  writeData (0x8F);
  cmd(0x29); //display on
  cmd(0x2C); //display on
  //delay(100);
}

//=============================8色彩间隔画面======================================//
void dis_color4(unsigned int a, unsigned int b, unsigned int c, unsigned int d, unsigned int e, unsigned int f, unsigned int g, unsigned int h)
{
  unsigned int i, m;
  cmd(0x002c);
  for (i = 0; i < 50; i++)
    for (m = 0; m < 240; m++)
    {
      SPI_TX(MCP23S17, GPIOA, 0x58); //LCD_RST|LCD_RD|LCD_RS
      SPI_TX(MCP23S17, GPIOB, a >> 8);
      SPI_TX(MCP23S17, GPIOA, 0x78 ); //LCD_RST|LCD_WR|LCD_RS|LCD_RD
      SPI_TX(MCP23S17, GPIOA, 0x58);
      SPI_TX(MCP23S17, GPIOB, a);
      SPI_TX(MCP23S17, GPIOA, 0x78 );
    }
   SPI_TX(MCP23S17, GPIOA, 0xf8 );
}

It seems that these commands are responsible for drawing :smiley:
SPI_TX(MCP23S17, GPIOA, 0x58); //LCD_RST|LCD_RD|LCD_RS
SPI_TX(MCP23S17, GPIOB, a >> 8 );
SPI_TX(MCP23S17, GPIOA, 0x78 ); //LCD_RST|LCD_WR|LCD_RS|LCD_RD
SPI_TX(MCP23S17, GPIOA, 0x58 );
SPI_TX(MCP23S17, GPIOB, a );
SPI_TX(MCP23S17, GPIOA, 0x78

How can I move the pointer to draw where I want on the screen?

You don't skip pixels, you simply address the pixel you want to write to.

You should download and study the Ili9327 datasheet, its available here: http://www.rcavioni.com/ili9327.pdf

You should be able to write to a single pixel with code that should look something like the code below. I cannot test the code right now so I do not know if it will work, I'm just trying to show the concept. You'll need to reference the ili9327 datasheet to understand the command bytes. You basically set the address in LCD memory that you want to write to then write the color that you want to appear at that pixel location.

void setPixel(int x1,int y1,int x2,int y2,int color)     
{
	char m,i;

	cmd(0x2a);
  	writeData(x1>>8);
  	writeData(x1);
  	writeData(x2>>8);
  	writeData(x2);

  	cmd(0x2b);
  	writeData(y1>>8);
  	writeData(y1);
  	writeData(y2>>8);
  	writeData(y2);

  	cmd(0x2c);
        SPI_TX(MCP23S17,GPIOA,LCD_RST|LCD_RD|LCD_RS);
        SPI_TX(MCP23S17,GPIOB,color);
        SPI_TX(MCP23S17,GPIOA,LCD_RST|LCD_WR|LCD_RS|LCD_RD ); 
	digitalWrite(LCD_CS,HIGH);   
}

Thank you for your answear. That's exactly what I meant. But I'm trying to find a working example or some description of setting the address of a pixel.

There is some description in the datasheet on page 21.

Address Counter (AC)
Address counter (AC) gives address to GRAM. When command setting address is written to CDR, the data
is transferred from CDR to AC.
When data is written/read to/from GRAM, address counter (AC) will increment by +1 or –1 automatically.
ILI9327 writes data to only rectangular area that was specified by GRAM.

Graphic RAM (GRAM)
The graphic RAM (GRAM) stores 233,280 bytes pattern data using 18 bits for one pixel, enabling a
maximum 240RGB x 432 dot graphic display at the maximum.

Also there is some command description, but it is slightly insufficient.

Get_address_mode (0Bh) on page 51
Set_column_address (2Ah) on page 70
Set_page_address (2Bh) on page 72
Set_address_mode (36h) on page 86

Display Data RAM
Configuration on page 165
Memory to Display Address Mapping on page 166

And now I have no idea how to implement it with MCP23S17 functions in C to set the pixel address.