aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-10 22:28:02 +0200
committerTectu <joel@unormal.org>2012-06-10 22:28:02 +0200
commitb008620171c3a21eeb10a2ca18e03000a681ce87 (patch)
tree1f3e01d40c81b40af08592d63a7a28028e605572 /drivers
parent7122ec3d1c50b00d5cb4f43087eca3f3257db48b (diff)
downloaduGFX-b008620171c3a21eeb10a2ca18e03000a681ce87.tar.gz
uGFX-b008620171c3a21eeb10a2ca18e03000a681ce87.tar.bz2
uGFX-b008620171c3a21eeb10a2ca18e03000a681ce87.zip
added ssd1289_lld
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ssd1289_lld.c58
-rw-r--r--drivers/ssd1289_lld.h15
2 files changed, 73 insertions, 0 deletions
diff --git a/drivers/ssd1289_lld.c b/drivers/ssd1289_lld.c
index e69de29b..e6ec0485 100644
--- a/drivers/ssd1289_lld.c
+++ b/drivers/ssd1289_lld.c
@@ -0,0 +1,58 @@
+#include "ssd1289_lld.h"
+
+#ifdef LCD_USE_SSD1289
+
+extern uint16_t lcd_width, lcd_height;
+
+void lld_lcdWriteIndex(uint16_t index) {
+ Clr_RS;
+ Set_RD;
+
+ palWritePort(LCD_DATA_PORT, index);
+
+ Clr_WR;
+ Set_WR;
+}
+
+void lld_lcdWriteData(uint16_t data) {
+ Set_RS;
+
+ palWritePort(LCD_DATA_PORT, data);
+
+ Clr_WR;
+ Set_WR;
+}
+
+uint16_t lld_lcdReadData(void) {
+ uint16_t value;
+
+ Set_RS;
+ Set_WR;
+ Clr_RD;
+
+ // change pin mode to digital input
+ LCD_DATA_PORT->CRH = 0x44444444;
+ LCD_DATA_PORT->CRL = 0x44444444;
+
+ value = palReadPort(LCD_DATA_PORT); // dummy
+ value = palReadPort(LCD_DATA_PORT);
+
+ // change pin mode back to digital output
+ LCD_DATA_PORT->CRH = 0x33333333;
+ LCD_DATA_PORT->CRL = 0x33333333;
+
+ Set_RD;
+
+ return value;
+}
+
+uint16_t lld_lcdGetHeight(void) {
+ return lcd_height;
+}
+
+uint16_t lld_lcdGetWidth(void) {
+ return lcd_width;
+}
+
+#endif
+
diff --git a/drivers/ssd1289_lld.h b/drivers/ssd1289_lld.h
index e69de29b..837d0496 100644
--- a/drivers/ssd1289_lld.h
+++ b/drivers/ssd1289_lld.h
@@ -0,0 +1,15 @@
+#ifndef SSD1289_H
+#define SSD1289_H
+
+#include "glcd.h"
+
+#ifndef LCD_USE_SSD1289
+
+void lld_lcdWriteIndex(uint16_t index);
+void lld_lcdWriteData(uint16_t data);
+void lld_lcdWriteData(uint16_t data);
+uint16_t lld_lcdGetHeight(void);
+uint16_t lld_lcdGetWidth(void);
+
+#endif
+#endif