Hello guys,
I think my lcd is internaly hard-wired to work without chip select pin and only in 8 bits mode with mosi and miso wires since the chinese seller provides the following informations:
Feature:
Size: 2.4 inches
Drive chip: ILI9341
Touch type: without touching
Resolution: 240*320
Communication interface: SPI
Interface description:
1. GND (power ground)
2. VCC (power supply is 3.3V)
3. CLK (clock line)
4. MOSI (data input)
5. RES (reset line)
6. DC (data / command selection line)
7. BLK (backlight)
8. MISO (data output)
I am still trying to figure out if I can use the ChibiOS SPI driver. I think I can but for now I was not able to communicate.
The Adafruit library use this to send commands:
Code: Select all
From Adafruit lib
/**************************************************************************/
/*!
@brief Read 8 bits of data from ILI9341 configuration memory. NOT from RAM!
This is highly undocumented/supported, it's really a hack but kinda works?
@param commandByte The command register to read data from
@param index The byte index into the command to read from
@return Unsigned 8-bit data read from ILI9341 register
*/
/**************************************************************************/
uint8_t Adafruit_ILI9341::readcommand8(uint8_t commandByte, uint8_t index) {
uint8_t data = 0x10 + index;
sendCommand(0xD9, &data, 1); // Set Index Register
return Adafruit_SPITFT::readcommand8(commandByte);
}
/*!
@brief Read 8 bits of data from display configuration memory (not RAM).
This is highly undocumented/supported and should be avoided,
function is only included because some of the examples use it.
@param commandByte
The command register to read data from.
@param index
The byte index into the command to read from.
@return Unsigned 8-bit data read from display register.
*/
/**************************************************************************/
uint8_t Adafruit_SPITFT::readcommand8(uint8_t commandByte, uint8_t index) {
uint8_t result;
startWrite();
SPI_DC_LOW(); // Command mode
spiWrite(commandByte);
SPI_DC_HIGH(); // Data mode
do {
result = spiRead();
} while(index--); // Discard bytes up to index'th
endWrite();
return result;
}
I would prefere to avoid using adafruit lib but rather make it with ChibiOS SPI. My goal is to stream data from my camera directly to the LCD. I want to configure the LCD at init and then only send pixel data.
Greetings,
Lyris