SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Revision:
36:7e747e19f660
Parent:
31:f29f71336710
diff -r ac4fcca21560 -r 7e747e19f660 RemovedSources/OV7725RegBuf.h.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RemovedSources/OV7725RegBuf.h.txt	Tue Mar 14 22:23:15 2017 +0000
@@ -0,0 +1,52 @@
+#pragma once
+#ifndef OV7725_REG_BUF_H
+#define OV7725_REG_BUF_H
+
+#include <mbed.h>
+#include "OV7725RegAddr.h"
+
+#define WRITE_DEFAULT_REG_ON
+#define WRITE_ORIGIN_REG_ON
+
+namespace SW
+{
+    class Core;
+}
+
+class OV7725RegBuf
+{
+public:
+    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;
+    
+    SW::Core & m_core;
+    
+    I2C m_sccbCtrl;
+};
+
+#endif //OV7725_REG_BUF_H
\ No newline at end of file