Library for LinkSprite Y201 JPEG serial camera.

Files at this revision

API Documentation at this revision

Comitter:
ashleymills
Date:
Sat Jun 02 13:13:52 2012 +0000
Parent:
0:4c0fca059a0a
Child:
2:7d8a6087f2e5
Commit message:
nothing;

Changed in this revision

Y201.cpp Show annotated file Show diff for this revision Revisions of this file
Y201.h Show annotated file Show diff for this revision Revisions of this file
--- a/Y201.cpp	Sat Jun 02 11:47:56 2012 +0000
+++ b/Y201.cpp	Sat Jun 02 13:13:52 2012 +0000
@@ -63,7 +63,7 @@
 
 bool Y201::waitForInt(int bytes, int *fileSize) {
    int spos = 0;
-   long timeout = 100000000;
+   long timeout = 1000000000;
    long timer = 0;
    *fileSize = 0;
    while(spos<bytes) {
@@ -81,7 +81,7 @@
             if(timer<timeout) {
                 timer++;
             } else {
-                return -1;
+                return false;
             }
         }
     }
--- a/Y201.h	Sat Jun 02 11:47:56 2012 +0000
+++ b/Y201.h	Sat Jun 02 13:13:52 2012 +0000
@@ -5,10 +5,10 @@
 
 private:
 
-	// serial commands to drive camera
-	static const int resetSeq        [4];
-	static const int resetSeqLen        = 4;
-	static const int resetSeqAck     [4];
+    // serial commands to drive camera
+    static const int resetSeq        [4];
+    static const int resetSeqLen        = 4;
+    static const int resetSeqAck     [4];
     static const int resetSeqAckLen     = 4;
     static const int takePicSeq      [5];
     static const int takePicSeqLen      = 5;
@@ -37,17 +37,17 @@
         e640x480
     };
 
-	Y201(PinName tx, PinName rx, const char *name = NULL);
+    Y201(PinName tx, PinName rx, const char *name = NULL);
 
-	bool setImageSize(Y201ImageSize size);
+    bool setImageSize(Y201ImageSize size);
     bool takePicture();
     bool readImageSize(int *fileSize);
     bool readImage(int startAddress, int readLen, uint8_t *readBuffer);
     void trash();
     
-	bool waitForInt(int bytes, int *fileSize);
-	bool waitFor(const int *seq, const int seqLen);
-	void putSeq(const int *seq, int seqLen);
-	bool reset();
+    bool waitForInt(int bytes, int *fileSize);
+    bool waitFor(const int *seq, const int seqLen);
+    void putSeq(const int *seq, int seqLen);
+    bool reset();
 
 };