diff options
author | Tectu <joel@unormal.org> | 2012-06-17 02:00:48 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-17 02:00:48 +0200 |
commit | f8997e5703c2c02a35f580b69dba58399ad84cf5 (patch) | |
tree | 3aea32b73facb29664e359f22d8e4d7387a0b42a | |
parent | a69832f4ec69abc9bcecc3f391baf07794164c08 (diff) | |
download | uGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.tar.gz uGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.tar.bz2 uGFX-f8997e5703c2c02a35f580b69dba58399ad84cf5.zip |
added lcdWriteStream start and stop functions
-rw-r--r-- | drivers/lcd/ssd1289_lld.c | 28 | ||||
-rw-r--r-- | drivers/lcd/ssd1289_lld.h | 2 | ||||
-rw-r--r-- | glcd.c | 8 | ||||
-rw-r--r-- | glcdconf.h | 11 |
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); @@ -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); } @@ -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 |