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
Hardwares/CamRegBuf.h@30:ff7f83ad6369, 2017-03-02 (annotated)
- Committer:
- hazheng
- Date:
- Thu Mar 02 04:22:56 2017 +0000
- Revision:
- 30:ff7f83ad6369
- Child:
- 32:5badeff825dc
Added OV2640 programs. Added CamRegBuf, which is a more general version of OV7725RegBuf.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 30:ff7f83ad6369 | 1 | #pragma once |
hazheng | 30:ff7f83ad6369 | 2 | #ifndef CAM_REG_BUF_H |
hazheng | 30:ff7f83ad6369 | 3 | #define CAM_REG_BUF_H |
hazheng | 30:ff7f83ad6369 | 4 | |
hazheng | 30:ff7f83ad6369 | 5 | #include <mbed.h> |
hazheng | 30:ff7f83ad6369 | 6 | |
hazheng | 30:ff7f83ad6369 | 7 | namespace SW |
hazheng | 30:ff7f83ad6369 | 8 | { |
hazheng | 30:ff7f83ad6369 | 9 | class Core; |
hazheng | 30:ff7f83ad6369 | 10 | } |
hazheng | 30:ff7f83ad6369 | 11 | |
hazheng | 30:ff7f83ad6369 | 12 | struct sensor_reg; |
hazheng | 30:ff7f83ad6369 | 13 | |
hazheng | 30:ff7f83ad6369 | 14 | class CamRegBuf |
hazheng | 30:ff7f83ad6369 | 15 | { |
hazheng | 30:ff7f83ad6369 | 16 | public: |
hazheng | 30:ff7f83ad6369 | 17 | CamRegBuf(SW::Core & core, uint8_t writeAddr, uint8_t readAddr); |
hazheng | 30:ff7f83ad6369 | 18 | |
hazheng | 30:ff7f83ad6369 | 19 | ~CamRegBuf(); |
hazheng | 30:ff7f83ad6369 | 20 | |
hazheng | 30:ff7f83ad6369 | 21 | //Blocking method. Do not use during the running state!! |
hazheng | 30:ff7f83ad6369 | 22 | void SCCBWrite(const uint8_t RegAddr, uint8_t Data); |
hazheng | 30:ff7f83ad6369 | 23 | |
hazheng | 30:ff7f83ad6369 | 24 | //Blocking method. Do not use during the running state!! |
hazheng | 30:ff7f83ad6369 | 25 | uint8_t SCCBRead(const uint8_t RegAddr); |
hazheng | 30:ff7f83ad6369 | 26 | |
hazheng | 30:ff7f83ad6369 | 27 | //Blocking method. Do not use during the running state!! |
hazheng | 30:ff7f83ad6369 | 28 | void ReadRegisters(); |
hazheng | 30:ff7f83ad6369 | 29 | |
hazheng | 30:ff7f83ad6369 | 30 | //Blocking method. Do not use during the running state!! |
hazheng | 30:ff7f83ad6369 | 31 | void WriteRegSet(const struct sensor_reg * reglist); |
hazheng | 30:ff7f83ad6369 | 32 | |
hazheng | 30:ff7f83ad6369 | 33 | private: |
hazheng | 30:ff7f83ad6369 | 34 | uint8_t m_writeAddr; |
hazheng | 30:ff7f83ad6369 | 35 | |
hazheng | 30:ff7f83ad6369 | 36 | uint8_t m_readAddr; |
hazheng | 30:ff7f83ad6369 | 37 | |
hazheng | 30:ff7f83ad6369 | 38 | SW::Core & m_core; |
hazheng | 30:ff7f83ad6369 | 39 | |
hazheng | 30:ff7f83ad6369 | 40 | I2C m_sccbCtrl; |
hazheng | 30:ff7f83ad6369 | 41 | }; |
hazheng | 30:ff7f83ad6369 | 42 | |
hazheng | 30:ff7f83ad6369 | 43 | #endif //CAM_REG_BUF_H |