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/CamRegBuf.h

Committer:
hazheng
Date:
2017-04-19
Branch:
Drift
Revision:
87:15fcf7891bf9
Parent:
32:5badeff825dc
Child:
92:e9bd429f16b5

File content as of revision 87:15fcf7891bf9:

#pragma once
#ifndef CAM_REG_BUF_H
#define CAM_REG_BUF_H

#include <mbed.h>

struct sensor_reg;

class CamRegBuf
{
public:
    CamRegBuf(uint8_t writeAddr,  uint8_t readAddr);
    
    ~CamRegBuf();
    
    //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);
    
    //int32_t I2CBufferRead(int32_t ucDevAddr, uint8_t *ucBuffer, int32_t ulSize);
    
    //int32_t I2CBufferWrite(int32_t ucDevAddr, uint8_t *ucBuffer, int32_t ulSize);
    
    //Blocking method. Do not use during the running state!!
    void ReadRegisters();
    
    //Blocking method. Do not use during the running state!!
    void WriteRegSet(const struct sensor_reg * reglist);
    
private:
    uint8_t m_writeAddr;
    
    uint8_t m_readAddr;
    
    I2C m_sccbCtrl;
};

#endif //CAM_REG_BUF_H