summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog3
-rw-r--r--nuttx/drivers/lcd/mio283qt9a.c36
-rw-r--r--nuttx/include/nuttx/lcd/mio283qt9a.h5
3 files changed, 32 insertions, 12 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index b84741b33..722300de9 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -7174,3 +7174,6 @@
* arch/arm/src/sama5/sam_adc.c, sam_can.c, sam_emac.c, sam_gmac.c,
sam_ssc.c, and sam_twi.c: If running from SDRAM, then BOARD_MCK_FREQUENCY
is not a constant and cannot be used in conditional compilation (2014-4-16).
+ * drivers/lcd/mio283qt9a.c and include/nuttx/lcd/mio283qt9a.h: Update the
+ MIO183QT-9A LCD driver to support reading from the LCD. From Toby
+ Duckworth (2014-4-16).
diff --git a/nuttx/drivers/lcd/mio283qt9a.c b/nuttx/drivers/lcd/mio283qt9a.c
index a4b9abf82..33d61198b 100644
--- a/nuttx/drivers/lcd/mio283qt9a.c
+++ b/nuttx/drivers/lcd/mio283qt9a.c
@@ -286,19 +286,33 @@ static uint16_t mio283qt9a_readreg(FAR struct mio283qt9a_lcd_s *lcd, uint8_t reg
#endif
/**************************************************************************************
- * Name: mio283qt9a_gramselect
+ * Name: mio283qt9a_gramselect_write
*
* Description:
- * Setup to read or write multiple pixels to the GRAM memory
+ * Setup to write multiple pixels to the GRAM memory
*
**************************************************************************************/
-static inline void mio283qt9a_gramselect(FAR struct mio283qt9a_lcd_s *lcd)
+static inline void mio283qt9a_gramselect_write(FAR struct mio283qt9a_lcd_s *lcd)
{
lcd->index(lcd, 0x2c);
}
/**************************************************************************************
+ * Name: mio283qt9a_gramselect_read
+ *
+ * Description:
+ * Setup to read multiple pixels to the GRAM memory
+ *
+ **************************************************************************************/
+
+static inline void mio283qt9a_gramselect_read(FAR struct mio283qt9a_lcd_s *lcd)
+{
+ lcd->index(lcd, 0x2e);
+ lcd->readgram(lcd);
+}
+
+/**************************************************************************************
* Name: mio283qt9a_gramwrite
*
* Description:
@@ -352,7 +366,7 @@ static inline uint16_t mio283qt9a_gramread(FAR struct mio283qt9a_lcd_s *lcd,
{
/* Read the value (GRAM register already selected) */
- return lcd->read(lcd);
+ return lcd->readgram(lcd);
}
#endif
@@ -446,7 +460,7 @@ static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *
/* Write the run to GRAM. */
mio283qt9a_setarea(lcd, col, row, col + npixels - 1, row);
- mio283qt9a_gramselect(lcd);
+ mio283qt9a_gramselect_write(lcd);
for (i = 0; i < npixels; i++)
{
@@ -481,12 +495,12 @@ static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer
FAR struct mio283qt9a_dev_s *priv = &g_lcddev;
FAR struct mio283qt9a_lcd_s *lcd = priv->lcd;
FAR uint16_t *dest = (FAR uint16_t*)buffer;
- uint16_t accum;
+ uint16_t accum, test;
int i;
/* Buffer must be provided and aligned to a 16-bit address boundary */
- lcdvdbg("row: %d col: %d npixels: %d\n", row, col, npixels);
+ lcdvdbg("mio283qt9a_getrun row: %d col: %d npixels: %d\n", row, col, npixels);
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
/* Read the run from GRAM. */
@@ -498,7 +512,7 @@ static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer
/* Red the run fram GRAM. */
mio283qt9a_setarea(lcd, col, row, col + npixels - 1, row);
- mio283qt9a_gramselect(lcd);
+ mio283qt9a_gramselect_read(lcd);
/* Prime the pump for unaligned read data */
@@ -506,7 +520,9 @@ static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer
for (i = 0; i < npixels; i++)
{
- *dest++ = mio283qt9a_gramread(lcd, &accum);
+ test= mio283qt9a_gramread(lcd, &accum);
+ // lcddbg("read 0x%04x\n", test);
+ *dest++ = test;
}
/* De-select the LCD */
@@ -891,7 +907,7 @@ void mio283qt9a_clear(FAR struct lcd_dev_s *dev, uint16_t color)
/* Prepare to write GRAM data */
- mio283qt9a_gramselect(lcd);
+ mio283qt9a_gramselect_write(lcd);
/* Copy color into all of GRAM. Orientation does not matter in this case. */
diff --git a/nuttx/include/nuttx/lcd/mio283qt9a.h b/nuttx/include/nuttx/lcd/mio283qt9a.h
index 376bafa92..476c85d0f 100644
--- a/nuttx/include/nuttx/lcd/mio283qt9a.h
+++ b/nuttx/include/nuttx/lcd/mio283qt9a.h
@@ -52,7 +52,7 @@
* Pre-processor Definitions
**************************************************************************************/
/* Configuration **********************************************************************/
-/* CONFIG_LCD_MIO283QT9A - Enables support for the MIO283QT2-based LCD.
+/* CONFIG_LCD_MIO283QT9A - Enables support for the MIO283QT9A-based LCD.
* CONFIG_LCD_NOGETRUN
* NX components need to know if it can read from the LCD or not. If reading from the
* LCD is supported then some graphic operations can be improved. Default: Supported
@@ -76,7 +76,7 @@
struct mio283qt9a_lcd_s
{
- /* Interface to write to a MIO283QT2 register.
+ /* Interface to write to a MIO283QT9A register.
*
* - select Select the device (as necessary). The meaning of selecting (and
* and deselecting) is not defined. select() will be called before
@@ -94,6 +94,7 @@ struct mio283qt9a_lcd_s
void (*index)(FAR struct mio283qt9a_lcd_s *dev, uint8_t index);
#ifndef CONFIG_LCD_NOGETRUN
uint16_t (*read)(FAR struct mio283qt9a_lcd_s *dev);
+ uint16_t (*readgram)(FAR struct mio283qt9a_lcd_s *dev);
#endif
void (*write)(FAR struct mio283qt9a_lcd_s *dev, uint16_t value);
void (*backlight)(FAR struct mio283qt9a_lcd_s *dev, int power);