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/ArduCAM.h
- Revision:
- 29:f87d8790f57d
- Parent:
- 28:271fc8445e89
- Child:
- 32:5badeff825dc
diff -r 271fc8445e89 -r f87d8790f57d Hardwares/ArduCAM.h --- a/Hardwares/ArduCAM.h Mon Feb 27 21:43:59 2017 +0000 +++ b/Hardwares/ArduCAM.h Wed Mar 01 16:31:36 2017 +0000 @@ -2,8 +2,40 @@ #ifndef ARDU_CAM_H #define ARDU_CAM_H +#include <mbed.h> #include "PinAssignment.h" +#define ARDUCHIP_TEST1 0x00 //TEST register +#define ARDUCHIP_TEST_MSG 0x72 + +#define ARDUCHIP_CAP_CTRL 0x01 //Capture Control Register + +#define ARDUCHIP_MODE 0x02 //Mode register +//#define MCU2LCD_MODE 0x00 +//#define CAM2LCD_MODE 0x01 +#define MCU2LCD_MODE 0x01 +#define CAM2LCD_MODE 0x02 +//#define LCD2MCU_MODE 0x04 + +#define ARDUCHIP_FIFO 0x04 //FIFO and I2C control +#define FIFO_CLEAR_MASK 0x01 +#define FIFO_START_MASK 0x02 +#define FIFO_RDPTR_RST_MASK 0x10 +#define FIFO_WRPTR_RST_MASK 0x20 + + bool ardu_cam_init(); +void ardu_cam_set_mode(uint8_t mode); + +void ardu_cam_start_capture(); + +uint8_t ardu_cam_read_reg(uint8_t addr); + +void ardu_cam_write_reg(uint8_t addr, uint8_t data); + +int ardu_cam_bus_write(int address, int value); + +uint8_t ardu_cam_bus_read(int address); + #endif //ARDU_CAM_H \ No newline at end of file