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

Hardwares/OV7725RegBuf.h

Committer:
hazheng
Date:
2017-03-02
Revision:
31:f29f71336710

File content as of revision 31:f29f71336710:

#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