KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
84:e102021864b5
Parent:
83:7bad0068cca0
Child:
85:022bba13c5c4
--- a/RA8875.h	Thu Jan 01 20:35:37 2015 +0000
+++ b/RA8875.h	Mon Jan 12 01:10:35 2015 +0000
@@ -171,12 +171,15 @@
         ISO8859_4       ///< ISO8859-4 font
     } font_t;
     
-    /// font rotation selection
+    /// display orientation
     typedef enum
     {
-        normal,         ///< normal orientation
-        rotated         ///< rotated orientation
-    } font_angle_t;
+        normal,         ///< normal (landscape) orientation
+        rotate_0 = normal,  ///< alternate to 'normal'
+        rotate_90,      ///< rotated clockwise 90 degree
+        rotate_180,     ///< rotated (clockwise) 180 degree
+        rotate_270,     ///< rotated clockwise 270 degree
+    } orientation_t;
     
     /// alignment  
     typedef enum
@@ -965,6 +968,45 @@
     ///
     RetCode_t SetTextFont(font_t font = ISO8859_1);
     
+    /// Sets the display orientation.
+    ///
+    /// @note This command does not let you "merge" text onto an existing
+    ///       image, since it reuses the memory for the new orientation.
+    ///       Therefore, it is recommended that you issue a cls() prior
+    ///       to sending text to the screen, or you end with a blended
+    ///       image that is probably not as intended.
+    ///
+    /// @code
+    ///     lcd.cls();
+    ///     lcd.SetOrientation(RA8875::normal);
+    ///     lcd.puts(30,30, "Normal Landscape");
+    ///     wait_ms(2500);
+    ///     
+    ///     lcd.cls();
+    ///     lcd.SetOrientation(RA8875::rotate_90);
+    ///     lcd.puts(30,30, "Rotated 90 Text\r\n");
+    ///     wait_ms(2500);
+    ///     
+    ///     lcd.cls();
+    ///     lcd.SetOrientation(RA8875::rotate_180);
+    ///     lcd.puts(30,30, "Rotated 180 Text\r\n");
+    ///     wait_ms(2500);
+    /// 
+    ///     lcd.cls();
+    ///     lcd.SetOrientation(RA8875::rotate_270);
+    ///     lcd.puts(30,30, "Rotated 270 Text\r\n");
+    ///     wait_ms(2500);
+    /// @endcode
+    ///
+    /// @param[in] angle defaults to normal, but can be rotated
+    ///         - normal | rotate_0
+    ///         - rotate_90 (clockwise)
+    ///         - rotate_180
+    ///         - rotate_270 (clockwise)
+    /// @returns success/failure code. @see RetCode_t.
+    ///
+    RetCode_t SetOrientation(orientation_t angle = normal);
+    
     /// Control the font behavior.
     ///
     /// This command lets you make several modifications to any text that
@@ -974,13 +1016,16 @@
     /// Default:
     /// @li Full alignment disabled, 
     /// @li Font with Background color, 
-    /// @li Font in normal orientiation,
-    /// @li Horizontal scale x 1
-    /// @li Vertical scale x 1
-    /// @li alignment
+    /// @li Font in normal orientiation, or rotated 90, 180, or 270 clockwise,
+    /// @li Horizontal scale x 1, 2, 3, or 4
+    /// @li Vertical scale x 1, 2, 3, or 4
+    ///
+    /// @note alignment is a special mode for the fonts, when mixing half and
+    ///     full fonts on one presentation. 'align_full' starts each full
+    ///     character on an even alignment. See section 7-4-7 of the RA8875
+    ///     specification.
     /// 
     /// @param[in] fillit defaults to FILL, but can be NOFILL
-    /// @param[in] angle defaults to normal, but can be rotated
     /// @param[in] hScale defaults to 1, but can be 1, 2, 3, or 4,
     ///     and scales the font size by this amount.
     /// @param[in] vScale defaults to 1, but can be 1, 2, 3, or 4,
@@ -993,7 +1038,6 @@
     /// @returns success/failure code. @see RetCode_t.
     ///
     RetCode_t SetTextFontControl(fill_t fillit = FILL, 
-        font_angle_t angle = normal, 
         HorizontalScale hScale = 1, 
         VerticalScale vScale = 1, 
         alignment_t alignment = align_none);