aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-17 02:00:48 +0200
committerTectu <joel@unormal.org>2012-06-17 02:00:48 +0200
commitf8997e5703c2c02a35f580b69dba58399ad84cf5 (patch)
tree3aea32b73facb29664e359f22d8e4d7387a0b42a
parenta69832f4ec69abc9bcecc3f391baf07794164c08 (diff)
downloaduGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.tar.gz
uGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.tar.bz2
uGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.zip
added lcdWriteStream start and stop functions
-rw-r--r--drivers/lcd/ssd1289_lld.c28
-rw-r--r--drivers/lcd/ssd1289_lld.h2
-rw-r--r--glcd.c8
-rw-r--r--glcdconf.h11
4 files changed, 46 insertions, 3 deletions
diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c
index 7a9109ad..82cd281e 100644
--- a/drivers/lcd/ssd1289_lld.c
+++ b/drivers/lcd/ssd1289_lld.c
@@ -71,8 +71,34 @@ static __inline void lcdDelay(uint16_t us) {
chThdSleepMicroseconds(us);
}
-__inline lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
+__inline void lld_lcdWriteStreamStart(void) {
+ #ifdef LCD_USE_GPIO
+ Clr_CS
+ Clr_RS;
+ Set_RD;
+ palWritePort(LCD_DATA_PORT, 0x0022);
+
+ Clr_WR;
+ Set_WR;
+ #endif
+}
+
+__inline void lld_lcdWriteStreamStop(void) {
+ #ifdef LCD_USE_GPIO
+ Set_CS;
+ #endif
+}
+
+__inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
+ uint16_t i;
+
+ for(i = 0; i < size; i++) {
+ palWritePort(LCD_DATA_PORT, buffer[i]);
+
+ Clr_WR;
+ Set_WR;
+ }
}
void lld_lcdSetCursor(uint16_t x, uint16_t y) {
diff --git a/drivers/lcd/ssd1289_lld.h b/drivers/lcd/ssd1289_lld.h
index 19235d2f..6d26d3ad 100644
--- a/drivers/lcd/ssd1289_lld.h
+++ b/drivers/lcd/ssd1289_lld.h
@@ -16,6 +16,8 @@
#define Clr_RD palClearPad(LCD_CMD_PORT, LCD_RD);
void lld_lcdInit(void);
+void lld_lcdWriteStreamStart(void);
+void lld_lcdWriteStreamStop(void);
void lld_lcdWriteStream(uint16_t *buffer, uint16_t size);
void lld_lcdSetCursor(uint16_t x, uint16_t y);
void lld_lcdSetOrientation(uint8_t newOrientation);
diff --git a/glcd.c b/glcd.c
index 2e4f059d..a28681d2 100644
--- a/glcd.c
+++ b/glcd.c
@@ -59,6 +59,14 @@ void lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color) {
lld_lcdDrawPixel(x, y, color);
}
+static void lcdWriteStreamStart(void) {
+ lld_lcdWriteStreamStart();
+}
+
+static void lcdWriteStreamStop(void) {
+ lld_lcdWriteStreamStop();
+}
+
static void lcdWriteStream(uint16_t *buffer, uint16_t size) {
lld_lcdWriteStream(buffer, size);
}
diff --git a/glcdconf.h b/glcdconf.h
index d8a15e06..657ee32d 100644
--- a/glcdconf.h
+++ b/glcdconf.h
@@ -4,11 +4,18 @@
/***** LCD CONTROLLER *****/
#define LCD_USE_SSD1289
-//#define LCD_USE_S6D1121
+// #define LCD_USE_S6D1121
+
+
+/***** LCD INTERFACE *****/
+#define LCD_USE_GPIO
+// #define LCD_USE_SPI
+// #define LCD_USE_FSMC
/***** TOUCHPAD CONTROLLER *****/
-//#define TOUCHPAD_USE_ADS7843
+// #define TOUCHPAD_USE_ADS7843
#define TOUCHPAD_USE_XPT2046
+
#endif