diff options
author | Joel Bodenmann <joel@unormal.org> | 2012-11-12 23:56:09 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2012-11-12 23:56:09 +0100 |
commit | 93901d8f1741b15bcfab7245471cbce5778a56f4 (patch) | |
tree | f2ee1391a208cf140f4128a2aa11b5903d77d04f | |
parent | f66e79b64888bafed8055e5310f97a65c891acd9 (diff) | |
download | uGFX-93901d8f1741b15bcfab7245471cbce5778a56f4.tar.gz uGFX-93901d8f1741b15bcfab7245471cbce5778a56f4.tar.bz2 uGFX-93901d8f1741b15bcfab7245471cbce5778a56f4.zip |
ILI9320 update
-rw-r--r-- | drivers/gdisp/ILI9320/gdisp_lld.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index 26fad328..62cf7c09 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -85,8 +85,24 @@ static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) { GDISP_LLD(write_data)(lcdRegValue);
}
+static __inline uint16_t lld_lcdReadData(void) {
+ /* fix this! */
+ //return GDISP_LLD(read_data);
+ return GDISP_RAM;
+}
+
+static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
+ volatile uint16_t dummy;
+
+ GDISP_LLD(write_index)(lcdReg);
+ dummy = lld_lcdReadData();
+ (void)dummy;
+
+ return lld_lcdReadData();
+}
+
static __inline void lld_lcdWriteStreamStart(void) {
- GDISP_REG = 0x0022;
+ lld_lcdWriteIndex(0x0022);
}
static __inline void lld_lcdWriteStreamStop(void) {
@@ -97,11 +113,11 @@ static __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) { uint16_t i;
for(i = 0; i < size; i++)
- GDISP_RAM = buffer[i];
+ lld_lcdWriteData(buffer[i]);
}
static __inline void lld_lcdReadStreamStart(void) {
- GDISP_REG = 0x0022;
+ lld_lcdWriteIndex(0x0022);
}
static __inline void lld_lcdReadStreamStop(void) {
@@ -112,26 +128,11 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { uint16_t i;
volatile uint16_t dummy;
- dummy = GDISP_RAM; /* throw away first value read */
+ dummy = lld_lcdReadData();
(void)dummy;
for(i = 0; i < size; i++)
- buffer[i] = GDISP_RAM;
-}
-
-static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
- volatile uint16_t dummy;
-
- GDISP_LLD(write_index)(lcdReg);
-
- /* fix this! */
- //dummy = GDISP_LLD(read_data);
- dummy = GDISP_RAM;
- (void)dummy;
-
- /* fix this! */
- //return GDISP_LLD(read_data);
- return GDISP_RAM;
+ buffer[i] = lld_lcdReadData();
}
bool_t GDISP_LLD(init)(void) {
|