diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-05 19:59:10 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-05 19:59:10 +0000 |
commit | 4a0b3d5f1c3d9aff64c7029f785b2a310129e7f2 (patch) | |
tree | a8895353b5f7c83448e391c614fd4067d600044a /nuttx/configs/stm3210e-eval | |
parent | b4739f795b424040fbd1644dca719d537918e575 (diff) | |
download | px4-nuttx-4a0b3d5f1c3d9aff64c7029f785b2a310129e7f2.tar.gz px4-nuttx-4a0b3d5f1c3d9aff64c7029f785b2a310129e7f2.tar.bz2 px4-nuttx-4a0b3d5f1c3d9aff64c7029f785b2a310129e7f2.zip |
Fix banding on the R61580 LCD
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4136 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm3210e-eval')
-rwxr-xr-x | nuttx/configs/stm3210e-eval/RIDE/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/buttons/defconfig | 7 | ||||
-rwxr-xr-x | nuttx/configs/stm3210e-eval/nsh/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/nsh2/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/nx/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/nxlines/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/nxtext/defconfig | 7 | ||||
-rwxr-xr-x | nuttx/configs/stm3210e-eval/ostest/defconfig | 7 | ||||
-rw-r--r-- | nuttx/configs/stm3210e-eval/src/up_lcd.c | 96 | ||||
-rwxr-xr-x | nuttx/configs/stm3210e-eval/usbserial/defconfig | 7 | ||||
-rwxr-xr-x | nuttx/configs/stm3210e-eval/usbstorage/defconfig | 7 |
11 files changed, 149 insertions, 17 deletions
diff --git a/nuttx/configs/stm3210e-eval/RIDE/defconfig b/nuttx/configs/stm3210e-eval/RIDE/defconfig index 21adf16ab..f47f40bf3 100755 --- a/nuttx/configs/stm3210e-eval/RIDE/defconfig +++ b/nuttx/configs/stm3210e-eval/RIDE/defconfig @@ -224,6 +224,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/buttons/defconfig b/nuttx/configs/stm3210e-eval/buttons/defconfig index 16c19e07f..7a1e4d78d 100644 --- a/nuttx/configs/stm3210e-eval/buttons/defconfig +++ b/nuttx/configs/stm3210e-eval/buttons/defconfig @@ -237,6 +237,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/nsh/defconfig b/nuttx/configs/stm3210e-eval/nsh/defconfig index 06df09d2e..8e1e1f848 100755 --- a/nuttx/configs/stm3210e-eval/nsh/defconfig +++ b/nuttx/configs/stm3210e-eval/nsh/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig index 281fec5b7..ae6a06606 100644 --- a/nuttx/configs/stm3210e-eval/nsh2/defconfig +++ b/nuttx/configs/stm3210e-eval/nsh2/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig index 8381ae8f6..94d843fb9 100644 --- a/nuttx/configs/stm3210e-eval/nx/defconfig +++ b/nuttx/configs/stm3210e-eval/nx/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/nxlines/defconfig b/nuttx/configs/stm3210e-eval/nxlines/defconfig index 048476296..0ed46b6ad 100644 --- a/nuttx/configs/stm3210e-eval/nxlines/defconfig +++ b/nuttx/configs/stm3210e-eval/nxlines/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig index 07ab05c74..e48a147c9 100644 --- a/nuttx/configs/stm3210e-eval/nxtext/defconfig +++ b/nuttx/configs/stm3210e-eval/nxtext/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/ostest/defconfig b/nuttx/configs/stm3210e-eval/ostest/defconfig index b3516fa5d..c4f81ecd8 100755 --- a/nuttx/configs/stm3210e-eval/ostest/defconfig +++ b/nuttx/configs/stm3210e-eval/ostest/defconfig @@ -235,6 +235,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/src/up_lcd.c b/nuttx/configs/stm3210e-eval/src/up_lcd.c index 481da54dd..a3fe6c810 100644 --- a/nuttx/configs/stm3210e-eval/src/up_lcd.c +++ b/nuttx/configs/stm3210e-eval/src/up_lcd.c @@ -289,6 +289,7 @@ #define LCD_REG_153 0x99 #define LCD_REG_154 0x9a #define LCD_REG_157 0x9d +#define LCD_REG_164 0xa4 #define LCD_REG_192 0xc0 #define LCD_REG_193 0xc1 #define LCD_REG_229 0xe5 @@ -1074,27 +1075,14 @@ static inline void stm3210e_lcdinitialize(void) id = stm3210e_readreg(LCD_REG_0); lcddbg("LCD ID: %04x\n", id); - /* Check if the ID is for the SPFD5408B or the almost compatible R61580 */ + /* Check if the ID is for the SPFD5408B */ -#if !defined(CONFIG_STM32_SPFD5408B_DISABLE) || !defined(CONFIG_STM32_R61580_DISABLE) -#if !defined(CONFIG_STM32_SPFD5408B_DISABLE) && !defined(CONFIG_STM32_R61580_DISABLE) - if (id == SPFD5408B_ID || id == R61580_ID) -#elif !defined(CONFIG_STM32_SPFD5408B_DISABLE) +#if !defined(CONFIG_STM32_SPFD5408B_DISABLE) if (id == SPFD5408B_ID) -#else - if (id == R61580_ID) -#endif { - /* Set the LCD type for the SPFD5408B or the R61580 */ - -#if !defined(CONFIG_STM32_SPFD5408B_DISABLE) && !defined(CONFIG_STM32_R61580_DISABLE) - g_lcddev.type = (id == SPFD5408B_ID ? LCD_TYPE_SPFD5408B : LCD_TYPE_R61580); -#elif !defined(CONFIG_STM32_SPFD5408B_DISABLE) - g_lcddev.type = SPFD5408B_ID; -#else - g_lcddev.type = LCD_TYPE_R61580; -#endif + /* Set the LCD type for the SPFD5408B */ + g_lcddev.type = LCD_TYPE_SPFD5408B; lcddbg("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1191,6 +1179,80 @@ static inline void stm3210e_lcdinitialize(void) } else #endif + + /* Check if the ID is for the almost compatible R61580 */ + +#if !defined(CONFIG_STM32_R61580_DISABLE) + if (id == R61580_ID) + { + /* Set the LCD type for the R61580 */ + + g_lcddev.type = LCD_TYPE_R61580; + lcddbg("LCD type: %d\n", g_lcddev.type); + + /* Start Initial Sequence */ + + stm3210e_writereg(LCD_REG_0, 0x0000); + stm3210e_writereg(LCD_REG_0, 0x0000); + up_mdelay(100); + stm3210e_writereg(LCD_REG_0, 0x0000); + stm3210e_writereg(LCD_REG_0, 0x0000); + stm3210e_writereg(LCD_REG_0, 0x0000); + stm3210e_writereg(LCD_REG_0, 0x0000); + stm3210e_writereg(LCD_REG_164, 0x0001); + up_mdelay(100); + stm3210e_writereg(LCD_REG_96, 0xa700); + stm3210e_writereg(LCD_REG_8, 0x0808); + + /* Gamma Setting */ + + stm3210e_writereg(LCD_REG_48, 0x0203); + stm3210e_writereg(LCD_REG_49, 0x080f); + stm3210e_writereg(LCD_REG_50, 0x0401); + stm3210e_writereg(LCD_REG_51, 0x050b); + stm3210e_writereg(LCD_REG_52, 0x3330); + stm3210e_writereg(LCD_REG_53, 0x0b05); + stm3210e_writereg(LCD_REG_54, 0x0005); + stm3210e_writereg(LCD_REG_55, 0x0f08); + stm3210e_writereg(LCD_REG_56, 0x0302); + stm3210e_writereg(LCD_REG_57, 0x3033); + + /* Power Setting */ + + stm3210e_writereg(LCD_REG_144, 0x0018); /* 80Hz */ + stm3210e_writereg(LCD_REG_16, 0x0530); /* BT, AP */ + stm3210e_writereg(LCD_REG_17, 0x0237); /* DC1,DC0,VC */ + stm3210e_writereg(LCD_REG_18, 0x01bf); + stm3210e_writereg(LCD_REG_19, 0x1000); /* VCOM */ + up_mdelay(200); + + stm3210e_writereg(LCD_REG_1, 0x0100); /* Set SS bit */ + stm3210e_writereg(LCD_REG_2, 0x0200); + stm3210e_writereg(LCD_REG_3, 0x1030); /* Set GRAM write direction and BGR=1. */ + stm3210e_writereg(LCD_REG_9, 0x0001); + stm3210e_writereg(LCD_REG_10, 0x0008); + stm3210e_writereg(LCD_REG_12, 0x0000); /* RGB 18-bit System interface setting */ + stm3210e_writereg(LCD_REG_13, 0xd000); + stm3210e_writereg(LCD_REG_14, 0x0030); + stm3210e_writereg(LCD_REG_15, 0x0000); /* RGB interface polarity, no impact */ + stm3210e_writereg(LCD_REG_32, 0x0000); /* H Start */ + stm3210e_writereg(LCD_REG_33, 0x0000); /* V Start */ + stm3210e_writereg(LCD_REG_41, 0x002e); + stm3210e_writereg(LCD_REG_80, 0x0000); /* Horizontal GRAM Start Address */ + stm3210e_writereg(LCD_REG_81, 0x00ef); /* Horizontal GRAM End Address */ + stm3210e_writereg(LCD_REG_82, 0x0000); /* Vertical GRAM Start Address */ + stm3210e_writereg(LCD_REG_83, 0x013f); /* Vertical GRAM End Address */ + stm3210e_writereg(LCD_REG_97, 0x0001); /* NDL, VLE, REV */ + stm3210e_writereg(LCD_REG_106, 0x0000); /* set scrolling line */ + stm3210e_writereg(LCD_REG_128, 0x0000); + stm3210e_writereg(LCD_REG_129, 0x0000); + stm3210e_writereg(LCD_REG_130, 0x005f); + stm3210e_writereg(LCD_REG_147, 0x0701); + + stm3210e_writereg(LCD_REG_7, 0x0000); /* Display OFF */ + } + else +#endif { #ifndef CONFIG_STM32_AM240320_DISABLE g_lcddev.type = LCD_TYPE_AM240320; diff --git a/nuttx/configs/stm3210e-eval/usbserial/defconfig b/nuttx/configs/stm3210e-eval/usbserial/defconfig index ef85b33bb..be28df966 100755 --- a/nuttx/configs/stm3210e-eval/usbserial/defconfig +++ b/nuttx/configs/stm3210e-eval/usbserial/defconfig @@ -235,6 +235,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/stm3210e-eval/usbstorage/defconfig b/nuttx/configs/stm3210e-eval/usbstorage/defconfig index 7e7a447ce..9d4557ab9 100755 --- a/nuttx/configs/stm3210e-eval/usbstorage/defconfig +++ b/nuttx/configs/stm3210e-eval/usbstorage/defconfig @@ -233,6 +233,13 @@ CONFIG_SSI_POLLWAIT=y #CONFIG_SSI_TXLIMIT=4 # +# STM3210E-EVAL specific LCD settings +# +CONFIG_STM32_AM240320_DISABLE=n +CONFIG_STM32_SPFD5408B_DISABLE=n +CONFIG_STM32_R61580_DISABLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with |