summaryrefslogtreecommitdiff
path: root/nuttx/drivers/lcd
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-15 12:40:59 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-15 12:40:59 +0000
commita778f0c7e076b4bab911945ee2630d767448d147 (patch)
tree09b07d102f0fc5d4d08f5233f0a17e47f44f5150 /nuttx/drivers/lcd
parentc1a162433f5694f2ff3bea4258bdbd3141712ba1 (diff)
downloadpx4-nuttx-a778f0c7e076b4bab911945ee2630d767448d147.tar.gz
px4-nuttx-a778f0c7e076b4bab911945ee2630d767448d147.tar.bz2
px4-nuttx-a778f0c7e076b4bab911945ee2630d767448d147.zip
NX for 4bpp
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2671 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/lcd')
-rwxr-xr-xnuttx/drivers/lcd/p14201.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/nuttx/drivers/lcd/p14201.c b/nuttx/drivers/lcd/p14201.c
index abaad4f46..40fd75e4a 100755
--- a/nuttx/drivers/lcd/p14201.c
+++ b/nuttx/drivers/lcd/p14201.c
@@ -124,6 +124,12 @@
# define CONFIG_LCD_MAXPOWER 1
#endif
+/* The leftmost column is contained in bits 7:4 */
+
+#ifndef CONFIG_NX_PACKEDMSFIRST
+# warning "CONFIG_NX_PACKEDMSFIRST needs to be set"
+#endif
+
/* Define the following to enable register-level debug output */
#undef CONFIG_LCD_RITDEBUG
@@ -624,6 +630,10 @@ static inline void rit_clear(FAR struct rit_dev_s *priv)
FAR uint8_t *ptr = g_framebuffer;
unsigned int row;
+ /* Initialize the framebuffer */
+
+ memset(g_framebuffer, (RIT_Y4_BLACK << 4) | RIT_Y4_BLACK, RIT_YRES * RIT_XRES / 2);
+
/* Set a window to fill the entire display */
rit_sndcmd(priv, g_setallcol, sizeof(g_setallcol));
@@ -698,7 +708,7 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
/* Get the beginning of the run in the framebuffer */
- run = g_framebuffer + row * RIT_XRES / 2 + start;
+ run = g_framebuffer + row * RIT_XRES / 2;
/* Copy the run into the framebuffer, handling nibble alignment */
@@ -706,14 +716,15 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
{
/* Beginning of buffer is properly aligned */
- memcpy(run, buffer, aend - start);
+ memcpy(&run[start], buffer, aend - start);
- /* Handle an final partial byte */
+ /* Handle any final partial byte */
if (aend != end)
{
- /* The leftmost column being contained in bits 7:4 */
-# warning "Missing logic"
+ /* The leftmost column is contained in bits 7:4 */
+
+ run[end] = (run[end] & 0x0f) | (buffer[aend - start] & 0xf0);
}
}
else
@@ -833,8 +844,6 @@ static int rit_getvideoinfo(FAR struct lcd_dev_s *dev,
static int rit_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo)
{
- FAR struct rit_dev_s *priv = (FAR struct rit_dev_s *)dev;
-
DEBUGASSERT(priv && pinfo && planeno == 0);
gvdbg("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
memcpy(pinfo, &g_planeinfo, sizeof(struct lcd_planeinfo_s));
@@ -979,12 +988,6 @@ FAR struct lcd_dev_s *rit_initialize(FAR struct spi_dev_s *spi, unsigned int dev
priv->contrast = RIT_CONTRAST;
priv->on = false;
- /* Initialize the framebuffer */
-
-#ifdef CONFIG_P14201_FRAMEBUFFER
- memset(g_framebuffer, (RIT_Y4_BLACK << 4) | RIT_Y4_BLACK, RIT_YRES * RIT_XRES / 2);
-#endif
-
/* Clear the display */
rit_clear(priv);