aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-05-23 16:10:03 +0200
committerTectu <joel@unormal.org>2012-05-23 16:10:03 +0200
commit94322d769e59487313b7286ba5e13e52cce57467 (patch)
tree4a0f83664d29715efadbe02ed25ca685edc4afd1
parent0eea8db0f3c470766e7120ab7dc7250d4e148021 (diff)
downloaduGFX-94322d769e59487313b7286ba5e13e52cce57467.tar.gz
uGFX-94322d769e59487313b7286ba5e13e52cce57467.tar.bz2
uGFX-94322d769e59487313b7286ba5e13e52cce57467.zip
fixes
-rwxr-xr-xglcd.c16
-rwxr-xr-xglcd.h16
2 files changed, 16 insertions, 16 deletions
diff --git a/glcd.c b/glcd.c
index f5998e2a..22fc492f 100755
--- a/glcd.c
+++ b/glcd.c
@@ -8,7 +8,7 @@ static __inline void lcdWriteIndex(uint16_t index) {
Clr_Rs;
Set_nRd;
- palWritePort(LCD_PORT, index);
+ LCD_DATA_PORT->ODR = index;
Clr_nWr;
Set_nWr;
@@ -17,7 +17,7 @@ static __inline void lcdWriteIndex(uint16_t index) {
static __inline void lcdWriteData(uint16_t data) {
Set_Rs;
- palWritePort(LCD_PORT, data);
+ LCD_DATA_PORT->ODR = data;
Clr_nWr;
Set_nWr;
@@ -31,15 +31,15 @@ static __inline uint16_t lcdReadData(void) {
Clr_nRd;
// change pin mode to digital input
- LCD_PORT->CRH = 0x44444444;
- LCD_PORT->CRL = 0x44444444;
+ LCD_DATA_PORT->CRH = 0x44444444;
+ LCD_DATA_PORT->CRL = 0x44444444;
- value = LCD_PORT->IDR;
- value = LCD_PORT->IDR;
+ value = LCD_DATA_PORT->IDR;
+ value = LCD_DATA_PORT->IDR;
// change pin mode back to digital output
- LCD_PORT->CRH = 0x33333333;
- LCD_PORT->CRL = 0x33333333;
+ LCD_DATA_PORT->CRH = 0x33333333;
+ LCD_DATA_PORT->CRL = 0x33333333;
Set_nRd;
diff --git a/glcd.h b/glcd.h
index 27c8bf6e..fa3d94f3 100755
--- a/glcd.h
+++ b/glcd.h
@@ -7,14 +7,14 @@
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
-#define Set_Cs LCD_PORT->ODR |= ( 1<<12 );
-#define Clr_Cs LCD_PORT->ODR &= ~( 1<<12 );
-#define Set_Rs LCD_PORT->ODR |= ( 1<<13 );
-#define Clr_Rs LCD_PORT->ODR &= ~( 1<<13 );
-#define Set_nWr LCD_PORT->ODR |= ( 1<<14 );
-#define Clr_nWr LCD_PORT->ODR &= ~( 1<<14 );
-#define Set_nRd LCD_PORT->ODR |= ( 1<<15 );
-#define Clr_nRd LCD_PORT->ODR &= ~( 1<<15 );
+#define Set_Cs LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_CS);
+#define Clr_Cs LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_CS);
+#define Set_Rs LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_RS);
+#define Clr_Rs LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_RS);
+#define Set_nWr LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_WR);
+#define Clr_nWr LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_WR);
+#define Set_nRd LCD_CMD_PORT->ODR |= (1 << GPIOD_LCD_RD);
+#define Clr_nRd LCD_CMD_PORT->ODR &= ~(1 << GPIOD_LCD_RD);
/* LCD color */
#define White 0xFFFF