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
Diff: Hardwares/CamRegBuf.h
- Revision:
- 30:ff7f83ad6369
- Child:
- 32:5badeff825dc
diff -r f87d8790f57d -r ff7f83ad6369 Hardwares/CamRegBuf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hardwares/CamRegBuf.h Thu Mar 02 04:22:56 2017 +0000 @@ -0,0 +1,43 @@ +#pragma once +#ifndef CAM_REG_BUF_H +#define CAM_REG_BUF_H + +#include <mbed.h> + +namespace SW +{ + class Core; +} + +struct sensor_reg; + +class CamRegBuf +{ +public: + CamRegBuf(SW::Core & core, 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); + + //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; + + SW::Core & m_core; + + I2C m_sccbCtrl; +}; + +#endif //CAM_REG_BUF_H \ No newline at end of file