/* Read device ID to idenfity the device ILI9325 device ID locates in Device Code Read (R00h) register. ILI9341 device ID locates in Read ID4 (RD3h) register.  */
uint8_t ili93xx_device_type_identify(void)
/* Read device ID to idenfity the device ILI9325 device ID locates in Device Code Read (R00h) register. ILI9341 device ID locates in Read ID4 (RD3h) register.  */
uint8_t ili93xx_device_type_identify(void)
{
	uint8_t paratable[6];
	uint16_t chipid;
	ili93xx_read_register(ILI9341_CMD_READ_ID4, paratable, 4);
	chipid = ((uint16_t)paratable[2] << 8) + paratable[3];
	if (chipid == ILI9341_DEVICE_CODE) {
		g_uc_device_type = DEVICE_TYPE_ILI9341;
		return 0;
	}
	ili93xx_read_register(ILI9325_DEVICE_CODE_REG, paratable, 2);
	chipid = ((uint16_t)paratable[0] << 8) + paratable[1];
	if (chipid == ILI9325_DEVICE_CODE) {
		g_uc_device_type = DEVICE_TYPE_ILI9325;
		return 0;
	}
	return 1;
}