diff --git a/bsp/stm32_radio/ili9325/ili9325.c b/bsp/stm32_radio/ili9325/ili9325.c index df5498bad1f8d4b34fd85d59dd8b73dd219f9163..c487bc9e7f45b195861f2d3d2a34dda747e39135 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 90f23c10a007679225fff23329590c3eff883d2b..540f91ebeccf7109c2156023e0f263d591dba133 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 */