diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index 70e40b6949b6971f3c27d2c7c46e2ee967e56602..8dac8289fbde23a0fd6c3339f2760fdc3231155c 100755 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -410,14 +410,14 @@ STM3210E-EVAL-specific Configuration Options STM3210E-EVAL LCD Hardware Configuration - CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape" + CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape" support. Default is this 320x240 "landscape" orientation (this setting is informative only... not used). - CONFIG_LCD_PORTRAIT - Define for 240x320 display "portrait" + CONFIG_LCD_PORTRAIT - Define for 240x320 display "portrait" orientation support. In this orientation, the STM3210E-EVAL's LCD ribbon cable is at the bottom of the display. Default is 320x240 "landscape" orientation. - CONFIG_LCD_RPORTRAIT - Define for 240x320 display "reverse + CONFIG_LCD_RPORTRAIT - Define for 240x320 display "reverse portrait" orientation support. In this orientation, the STM3210E-EVAL's LCD ribbon cable is at the top of the display. Default is 320x240 "landscape" orientation. @@ -484,7 +484,7 @@ Where <subdir> is one of the following: input. CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows - CONFIG_LCD_PORTRAIT=y : 240x320 + CONFIG_LCD_RPORTRAIT=y : 240x320 reverse portrait nxtext: ------ @@ -494,7 +494,7 @@ Where <subdir> is one of the following: or without the popup windows present. CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows - CONFIG_LCD_PORTRAIT=y : 240x320 + CONFIG_LCD_RPORTRAIT=y : 240x320 reverse portrait ostest: ------ diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 60f86875dfbf4fe1134f09ed404f90edb3b11d74..e65bfe469432bbb45835c0503d0beaea40dc57be 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -828,7 +828,8 @@ CONFIG_NX_MXCLIENTMSGS=16 # by CONFIG_LCD_MAXPOWER. Requires CONFIG_STM32_TIM1. # CONFIG_LCD_LANDSCAPE=n -CONFIG_LCD_PORTRAIT=y +CONFIG_LCD_PORTRAIT=n +CONFIG_LCD_RPORTRAIT=y CONFIG_LCD_BACKLIGHT=n # diff --git a/configs/stm3210e-eval/nxtext/defconfig b/configs/stm3210e-eval/nxtext/defconfig index a2ddaa218238d5bef477872b88e94b247cf779eb..c97285022138a16f94cd6cfbb0a055d148dcfa07 100644 --- a/configs/stm3210e-eval/nxtext/defconfig +++ b/configs/stm3210e-eval/nxtext/defconfig @@ -828,7 +828,8 @@ CONFIG_NX_MXCLIENTMSGS=16 # by CONFIG_LCD_MAXPOWER. Requires CONFIG_STM32_TIM1. # CONFIG_LCD_LANDSCAPE=n -CONFIG_LCD_PORTRAIT=y +CONFIG_LCD_PORTRAIT=n +CONFIG_LCD_RPORTRAIT=y CONFIG_LCD_BACKLIGHT=n # diff --git a/configs/stm3210e-eval/src/up_lcd.c b/configs/stm3210e-eval/src/up_lcd.c index a888f31e56ae658997eb0bd18d09f6f9229fd9f0..a183a04cb1cd0cef8d7a12aba00009cc64555ca2 100755 --- a/configs/stm3210e-eval/src/up_lcd.c +++ b/configs/stm3210e-eval/src/up_lcd.c @@ -85,8 +85,12 @@ /* Check orientation */ #if defined(CONFIG_LCD_PORTRAIT) -# if defined(CONFIG_LCD_LANDSCAPE) -# error "Cannot define both portrait and landscape orientations" +# if defined(CONFIG_LCD_LANDSCAPE) || defined(CONFIG_LCD_RPORTRAIT) +# error "Cannot define both portrait and any other orientations" +# endif +#elif defined(CONFIG_LCD_RPORTRAIT) +# if defined(CONFIG_LCD_LANDSCAPE) || defined(CONFIG_LCD_PORTRAIT) +# error "Cannot define both rportrait and any other orientations" # endif #elif !defined(CONFIG_LCD_LANDSCAPE) # define CONFIG_LCD_LANDSCAPE 1 @@ -575,7 +579,7 @@ static int stm3210e_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *bu stm3210e_writegram(*src++); } -#else /* CONFIG_LCD_PORTRAIT */ +#elif defined(CONFIG_LCD_PORTRAIT) /* Convert coordinates. (Swap row and column. This is done implicitly). */ /* Then write the GRAM data, manually incrementing Y (which is col) */ @@ -592,6 +596,28 @@ static int stm3210e_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *bu col++; } +#else /* CONFIG_LCD_RPORTRAIT */ + /* Convert coordinates. (Swap row and column. This is done implicitly). + * Which edge of the display is the "top"? + */ + + col = (STM3210E_XRES-1) - col; + row = (STM3210E_YRES-1) - row; + + /* Then write the GRAM data, manually incrementing Y (which is col) */ + + for (i = 0; i < npixels; i++) + { + /* Write the next pixel to this position */ + + stm3210e_setcursor(row, col); + stm3210e_gramselect(); + stm3210e_writegram(*src++); + + /* Decrement to next column */ + + col--; + } #endif return OK; } @@ -643,7 +669,7 @@ static int stm3210e_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, *dest++ = stm3210e_readgram(); } -#else /* CONFIG_LCD_PORTRAIT */ +#elif defined(CONFIG_LCD_PORTRAIT) /* Convert coordinates (Swap row and column. This is done implicitly). */ /* Then read the GRAM data, manually incrementing Y (which is col) */ @@ -660,6 +686,28 @@ static int stm3210e_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, col++; } +#else /* CONFIG_LCD_RPORTRAIT */ + /* Convert coordinates. (Swap row and column. This is done implicitly). + * Whic edge of the display is the "top"? + */ + + col = (STM3210E_XRES-1) - col; + row = (STM3210E_YRES-1) - row; + + /* Then write the GRAM data, manually incrementing Y (which is col) */ + + for (i = 0; i < npixels; i++) + { + /* Write the next pixel to this position */ + + stm3210e_setcursor(row, col); + stm3210e_gramselect(); + *dest++ = stm3210e_readgram(); + + /* Decrement to next column */ + + col--; + } #endif return OK;