Jordan Brack / SmartWheelsPublic

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Revision:
25:6f63053cee81
Parent:
13:7dcb1642ef99
diff -r f3ea8fbd9655 -r 6f63053cee81 Hardwares/OV7725RegBuf.h
--- a/Hardwares/OV7725RegBuf.h	Tue Feb 21 19:29:02 2017 +0000
+++ b/Hardwares/OV7725RegBuf.h	Tue Feb 21 20:00:41 2017 +0000
@@ -5,18 +5,48 @@
 #include <mbed.h>
 #include "OV7725RegAddr.h"
 
+#define WRITE_DEFAULT_REG_ON
+#define WRITE_ORIGIN_REG_ON
+
+namespace SW
+{
+    class Core;
+}
+
 class OV7725RegBuf
 {
 public:
-    OV7725RegBuf();
+    OV7725RegBuf(SW::Core & core);
+    
     ~OV7725RegBuf();
     
     uint8_t * GetData();
     
     static bool IsAddressReserved(const uint8_t addr);
     
+    //Blocking method. Do not use during the running state!!
+    void SCCBWrite(const uint8_t RegAddr, uint8_t Data);
+    
+    //Blocking method. Do not use during the running state!!
+    uint8_t SCCBRead(const uint8_t RegAddr);
+    
+    //Blocking method. Do not use during the running state!!
+    void ReadRegisters();
+    
+#ifdef WRITE_DEFAULT_REG_ON
+    void WriteDefaultRegisters();
+#endif
+    
+#ifdef WRITE_ORIGIN_REG_ON
+    void WriteOriginalRegisters();
+#endif
+    
 private:
-    uint8_t m_data[OV7725_LAST_ADDR + 1];
+    uint8_t * m_data;
+    
+    SW::Core & m_core;
+    
+    I2C m_sccbCtrl;
 };
 
 #endif //OV7725_REG_BUF_H
\ No newline at end of file