KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
82:f7d300f26540
Parent:
81:01da2e34283d
Child:
83:7bad0068cca0
--- a/RA8875.cpp	Sun Dec 28 21:50:28 2014 +0000
+++ b/RA8875.cpp	Tue Dec 30 23:45:37 2014 +0000
@@ -210,6 +210,12 @@
 }
 
 
+RA8875::LayerMode_T RA8875::GetLayerMode(void)
+{
+    return (LayerMode_T)(ReadCommand(0x52) & 0x7);
+}
+
+
 RetCode_t RA8875::SetLayerMode(LayerMode_T mode)
 {
     unsigned char ltpr0 = ReadCommand(0x52) & ~0x7; // retain all but the display layer mode
@@ -399,6 +405,17 @@
 #endif
 
 
+bool RA8875::Intersect(rect_t rect, point_t p)
+{
+    if (p.x >= min(rect.p1.x, rect.p2.x) && p.x <= max(rect.p1.x, rect.p2.x)
+    && p.y >= min(rect.p1.y, rect.p2.y) && p.y <= max(rect.p1.y, rect.p2.y))
+        return true;
+    else
+        return false;
+}
+
+
+
 RetCode_t RA8875::WriteCommandW(uint8_t command, uint16_t data)
 {
 #if 1