summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuyangyong <[email protected]>2010-03-06 02:01:59 +0000
committerwuyangyong <[email protected]>2010-03-06 02:01:59 +0000
commit3a8f591e51c16a3bb6eb630ca8d7c32206937faf (patch)
tree5156eced2cc2863f9b47a4968f528cb87bc3d1a7
parent162f120fdd5e21f6a0e360e4face0a6f7c266dd6 (diff)
add ili9325 dirction option
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@461 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--bsp/stm32_radio/ili9325/ili9325.c12
-rw-r--r--bsp/stm32_radio/ili9325/ili9325.h3
2 files changed, 13 insertions, 2 deletions
diff --git a/bsp/stm32_radio/ili9325/ili9325.c b/bsp/stm32_radio/ili9325/ili9325.c
index df5498bad1..c487bc9e7f 100644
--- a/bsp/stm32_radio/ili9325/ili9325.c
+++ b/bsp/stm32_radio/ili9325/ili9325.c
@@ -253,7 +253,11 @@ void ili9325_Initializtion(void)
{
ili9325_WriteReg(0x00e7,0x0010);
ili9325_WriteReg(0x0000,0x0001); //start internal osc
- ili9325_WriteReg(0x0001,0x0100);
+#if defined(_ILI_REVERSE_DIRECTION_)
+ ili9325_WriteReg(0x0001,0x0000); //Reverse Display
+#else
+ ili9325_WriteReg(0x0001,0x0100); //
+#endif
ili9325_WriteReg(0x0002,0x0700); //power on sequence
/* [5:4]-ID1~ID0 [3]-AM-1��ֱ-0ˮƽ */
ili9325_WriteReg(0x0003,(1<<12)|(1<<5)|(0<<4) | (1<<3) );
@@ -303,7 +307,11 @@ void ili9325_Initializtion(void)
ili9325_WriteReg(0x0051,0x00ef);
ili9325_WriteReg(0x0052,0x0000);
ili9325_WriteReg(0x0053,0x013f);
- ili9325_WriteReg(0x0060,0xa700);
+#if defined(_ILI_REVERSE_DIRECTION_)
+ ili9325_WriteReg(0x0060,0x2700);
+#else
+ ili9325_WriteReg(0x0060,0xA700);
+#endif
ili9325_WriteReg(0x0061,0x0001);
ili9325_WriteReg(0x006a,0x0000);
ili9325_WriteReg(0x0080,0x0000);
diff --git a/bsp/stm32_radio/ili9325/ili9325.h b/bsp/stm32_radio/ili9325/ili9325.h
index 90f23c10a0..540f91ebec 100644
--- a/bsp/stm32_radio/ili9325/ili9325.h
+++ b/bsp/stm32_radio/ili9325/ili9325.h
@@ -12,6 +12,9 @@ extern void ili9325_WriteRAM(u16 RGB_Code);
extern unsigned short ili9325_ReadGRAM(unsigned short x,unsigned short y);
extern void ili9325_WriteReg(u8 LCD_Reg,u16 LCD_RegValue);
+/* If LCD Display in wrong dirction uncomment this option*/
+#define _ILI_REVERSE_DIRECTION_
+
/* LCD is connected to the FSMC_Bank1_NOR/SRAM2 and NE2 is used as ship select signal */
/* RS <==> A2 */
#define ili9325_REG (*((volatile unsigned short *) 0x64000000)) /* RS = 0 */