Request for help with LCD driver in Iris

Bas Wijnen wijnen at debian.org
Fri Nov 27 03:34:15 EST 2009


Hi,

For some time I've been fighting with the LCD driver in Iris.  I hope
someone from this list can look at it and point at the problem.  Below
is the code which is supposed to set up the device.  The result is that
the screen switches on, but it stays completely white.  I have set up a
frame buffer to display some gradients, which I expect to see.

Note that I'm using almost identical code on my Trendtac, and there it
does work.  The Trendtac doesn't have SPI pins, and uses 16 bit parallel
communication, so it's not completely the same.

Note for those who know the Linux source: my header file uses the same
names, but without the REG_ prefix.  So it is no problem that that is
missing.  Also, don't mind the missing semicolons; it's supposed to be
like that.

Any help is welcome.

Thanks,
Bas

// Display size.
unsigned h = 320, v = 240
// Note that the sync pulse is part of the pre-display region.
// Horizontal timings.
unsigned hsync = 1, hpre = 141, hpost = 273
// Vertical timings.
unsigned vsync = 1, vpre = 21, vpost = 2
// 3 clocks per pixel.
unsigned cpp = 3
// Bits per pixel.
unsigned bpp = LCD_CTRL_BPP_18_24
// Configuration.
unsigned cfg = LCD_CFG_MODE_SERIAL_TFT | LCD_CFG_HSP | LCD_CFG_VSP
// Set up SPI pins.
gpio_as_output (SP_PORT, (1 << SPEN) | (1 << SPCK) | (1 << SPDA))
gpio_set (SP_PORT, (1 << SPEN) | (1 << SPCK))

// Note that the sync pulse is part of the pre-display region.
unsigned vpe = vsync, vds = vpre, vde = vds + v, vt = vde + vpost
unsigned hpe = hsync, hds = hpre, hde = hds + cpp * h, ht = hde + hpost

cpm_stop_lcd ()
// commented out stuff to set up clocks; this is hardcoded to known good values.
cpm_start_lcd ()

// Reset the controller.
write_reg (0x05, 0x1e)
// Enable display.
write_reg (0x05, 0x5f)
// Set data to rgbrgbrgb input, with a delta color filter.
write_reg (0x13, 0x01)

LCD_CTRL = (bpp << LCD_CTRL_BPP_BIT) | LCD_CTRL_BST_16
LCD_CFG = cfg
LCD_HSYNC = hpe
LCD_VSYNC = vpe
LCD_VAT = (ht << 16) | vt
LCD_DAH = (hds << 16) | hde
LCD_DAV = (vds << 16) | vde
LCD_DA0 = physical_descriptor
LCD_CTRL = (bpp << LCD_CTRL_BPP_BIT) | LCD_CTRL_BST_16 | LCD_CTRL_ENA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20091127/25a33ee2/attachment.pgp>


More information about the discussion mailing list


interactive