CameraC328
Dependents: CameraC328_TestProgram CameraC328_Thresholding Camera_TestProgram_2015 Camera_TestProgram_2015 ... more
Diff: CameraC328.h
- Revision:
- 4:ad06342d4b84
- Parent:
- 3:6d3150d4396a
- Child:
- 5:5d2088c2433c
--- a/CameraC328.h Tue Jun 29 11:45:53 2010 +0000 +++ b/CameraC328.h Tue Jun 29 22:55:35 2010 +0000 @@ -1,16 +1,16 @@ /** - * C328-7640 device driver class + * C328-7640 device driver class (Version 0.0.2) * Reference documents: C328-7640 User Manual v3.0 2004.8.19 * - * Version 0.0.1 - * * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) - * shinta.main.jp@gmail.com * http://shinta.main.jp/ */ #include "mbed.h" +#ifndef _CAMERA_C328_H_ +#define _CAMERA_C328_H_ + class CameraC328 { public: @@ -100,11 +100,14 @@ ErrorNumber init(ColorType ct, RawResolution rr, JpegResolution jr); ErrorNumber getUncompressedSnapshotPicture(void(*func)(size_t done, size_t total, char c)); ErrorNumber getUncompressedPreviewPicture(void(*func)(size_t done, size_t total, char c)); + ErrorNumber getJpegSnapshotPicture(void(*func)(char *buf, size_t siz)); + ErrorNumber getJpegPreviewPicture(void(*func)(char *buf, size_t siz)); private: Serial serial; static const int COMMAND_LENGTH = 6; static const int SYNCMAX = 60; + static const int packageSize = 512; ErrorNumber sendInitial(ColorType ct, RawResolution rr, JpegResolution jr); ErrorNumber sendGetPicture(PictureType pt); @@ -119,7 +122,9 @@ ErrorNumber sendAck(uint8_t commandId, uint16_t packageId); ErrorNumber recvAckOrNck(); - bool sendBytes(char *buf, size_t len, int timeout_us = 5000); - bool recvBytes(char *buf, size_t len, int timeout_us = 5000); + bool sendBytes(char *buf, size_t len, int timeout_us = 20000); + bool recvBytes(char *buf, size_t len, int timeout_us = 20000); bool waitRecv(); }; + +#endif