KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
131:5bd6ba2ee4a1
Parent:
127:db7f2c704693
Child:
132:a5d7a8541683
Child:
138:61e93bed397e
--- a/RA8875.h	Sat Aug 06 22:44:49 2016 +0000
+++ b/RA8875.h	Fri Aug 12 11:30:33 2016 +0000
@@ -507,9 +507,9 @@
     /// @param[in] color_bpp can be either 8 or 16, but must be consistent
     ///             with the width and height parameters. This parameter is optional
     ///             and the default is 16.
-    /// @param[in] poweron defines if the display should be left in the power-on or off state.
-    ///            If power is true (on), the backlight is set to 100%. This parameter is optional
-    ///             and the default is true (on). See @ref Power.
+    /// @param[in] poweron defines if the display should be initialized into the power-on or off state.
+    ///            If power is non-zero(on), the backlight is set to this vale. This parameter is optional
+    ///             and the default is 255 (on and full brightness). See @ref Power.
     /// @param[in] keypadon defines if the keypad support should be enabled. This parameter is optional
     ///             and the default is true (enabled). See @ref KeypadInit.
     /// @param[in] touchscreeenon defines if the touchscreen support should be enabled. 
@@ -521,7 +521,7 @@
     /// @returns success/failure code. See @ref RetCode_t.
     ///
     RetCode_t init(int width = 480, int height = 272, int color_bpp = 16, 
-        bool poweron = true, bool keypadon = true, bool touchscreeenon = true);
+        uint8_t poweron = 255, bool keypadon = true, bool touchscreeenon = true);
 
 
     /// Get a pointer to the error code.
@@ -832,7 +832,7 @@
     ///
     point_t TouchCoordinates(uint8_t channel = 0)  { return (channel < 5) ? touchInfo[channel].coordinates : touchInfo[0].coordinates; }
 
-    
+
     /// Poll the TouchPanel and on a touch event return the a to d filtered x, y coordinates.
     ///
     /// This method reads the touch controller, which has a 10-bit range for each the
@@ -841,7 +841,8 @@
     /// @note The returned values are not in display (pixel) units but are in analog to
     ///     digital converter units.
     /// 
-    /// @note This API is usually not needed. See @ref TouchPanelComputeCalibration. 
+    /// @note This API is usually not needed and is likely to be deprecated. 
+    ///     See @ref TouchPanelComputeCalibration. 
     ///     See @ref TouchPanelReadable.
     /// 
     /// @param[out] x is the x scale a/d value.
@@ -865,7 +866,8 @@
     /// @note The returned values are not in display (pixel) units but are in analog to
     ///     digital converter units.
     /// 
-    /// @note This API is usually not needed. See @ref TouchPanelComputeCalibration. 
+    /// @note This API is usually not needed and is likely to be deprecated. 
+    ///     See @ref TouchPanelComputeCalibration. 
     ///     See @ref TouchPanelReadable.
     /// 
     /// @param[out] x is the x scale a/d value.
@@ -1049,7 +1051,7 @@
     /// Initialize the keypad interface on the RA8875 controller.
     ///
     /// Enables the keypad subsystem. It will scan the 4 x 5 matrix
-    /// and make available key presses. 
+    /// and make available key presses.
     ///
     /// @note See section 5-13 of RAIO RA8875 data sheet for more details.
     /// @note When using the display from buy-display.com, be sure that
@@ -1146,6 +1148,13 @@
     ///
     bool Intersect(rect_t rect, point_t p);
 
+    /// Determine if a rectangle intersects another rectangle.
+    ///
+    /// @param[in] rect1 is a rectangular region.
+    /// @param[in] rect2 is a second rectangular region.
+    /// @returns true if rect1 and rect2 intersect.
+    ///
+    bool Intersect(rect_t rect1, rect_t rect2);
     
     /// Write a command to the display with a word of data.
     ///
@@ -1754,8 +1763,8 @@
     /// @returns success/failure code. See @ref RetCode_t.
     ///
     virtual RetCode_t getPixelStream(color_t * p, uint32_t count, loc_t x, loc_t y);
-    
-    
+
+
     /// Write a boolean stream to the display.
     ///
     /// This takes a bit stream in memory and using the current color settings
@@ -2219,6 +2228,37 @@
     RetCode_t ellipse(loc_t x, loc_t y, dim_t radius1, dim_t radius2, fill_t fillit = NOFILL);
     
 
+
+    /// Block Move
+    ///
+    /// The Block Move API activates the RA8875 Block Transfer Engine. Due to the complex
+    /// set of possible operations, the user should read the related sections of the
+    /// RA8875 user manual.
+    ///
+    /// Some operations may require that other registers are configured, such as the
+    /// foreground and background color registers, and others. Those must be set
+    /// outside of this API.
+    ///
+    /// @param[in] dstLayer layer [5B.7]. layer value is 0 or 1 repreenting layer 1 and 2.
+    /// @param[in] dstDataSelect [50.5] defines the destination data type 0: block, 1: linear.
+    /// @param[in] dstPoint [58-5B] is a point_t defining the destination coordinate.
+    /// @param[in] srcLayer layer [57.7]. layer value is 0 or 1 repreenting layer 1 and 2.
+    /// @param[in] srcDataSelect [50.6] defines the source data type 0: block, 1: linear.
+    /// @param[in] srcPoint [54-57] is a point_t defining the source coordinate.
+    /// @param[in] bte_width [5C-5D]. operation width.
+    /// @param[in] bte_height [5E-5F]. operation height.
+    /// @param[in] bte_op_code [51.3-0] defines the raster operation function 
+    ///             (write/read/move/...)
+    /// @param[in] bte_rop_code [51.7-4] defines what type of BTE operation to perform
+    ///             (what is placed at the destination)
+    /// @returns success/failure code. See @ref RetCode_t.
+    ///
+    RetCode_t BlockMove(uint8_t dstLayer, uint8_t dstDataSelect, point_t dstPoint,
+        uint8_t srcLayer, uint8_t srcDataSelect, point_t srcPoint,
+        uint16_t bte_width, uint16_t bte_height,
+        uint8_t bte_op_code, uint8_t bte_rop_code);
+
+
     /// Control display power
     ///
     /// @param[in] on when set to true will turn on the display, when false it is turned off.
@@ -2242,7 +2282,7 @@
     /// @param[in] brightness ranges from 0 (off) to 255 (full on)
     /// @returns success/failure code. See @ref RetCode_t.
     ///
-    RetCode_t Backlight_u8(unsigned char brightness);
+    RetCode_t Backlight_u8(uint8_t brightness);
 
     
     /// Get backlight brightness.
@@ -2727,6 +2767,7 @@
         PRF_DRAWTRIANGLE,
         PRF_DRAWCIRCLE,
         PRF_DRAWELLIPSE,
+        PRF_BLOCKMOVE,
         METRICCOUNT
     } method_e;
     unsigned long metrics[METRICCOUNT];