pixy2 smart camera library www.pixycam.com

Pixy2 Library project (using UART interface)

Revision:
11:68ef9f85e40e
Parent:
10:ea759846c2d5
Child:
12:7493191dd1dc
--- a/pixy2.h	Tue Mar 12 14:06:53 2019 +0000
+++ b/pixy2.h	Tue Mar 12 14:16:53 2019 +0000
@@ -79,7 +79,7 @@
  *  \param PIXY2_TYPE_ERROR :       Unexpected message type
  *  @note More documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:general_api#error-codes
  */
-typedef int             Pixy2ErrorCode;
+typedef int             T_pixy2ErrorCode;
 
 #define PIXY2_OK             0
 #define PIXY2_MISC_ERROR    -1
@@ -213,7 +213,7 @@
     Byte                pixFWVersionMin;
     Word                pixFWBuild;
     char                pixHFString[10];
-}T_Pixy2Version;
+}T_pixy2Version;
 
 /**
  *  \struct T_Pixy2Resolution
@@ -224,7 +224,7 @@
 typedef struct {
     Word                pixFrameWidth;
     Word                pixFrameHeight;
-}T_Pixy2Resolution;
+}T_pixy2Resolution;
 
 /**
  *  \struct T_pixy2Bloc
@@ -271,7 +271,7 @@
     Byte                pixY1;
     Byte                pixIndex;
     Byte                pixFlags;
-}T_Pixy2Vector;
+}T_pixy2Vector;
 
 /**
  *  \struct T_Pixy2InterLine
@@ -287,7 +287,7 @@
     Byte                pixIndex;
     Byte                pixReserved;
     sWord               pixAngle;
-}T_Pixy2InterLine;
+}T_pixy2InterLine;
 
 /**
  *  \struct T_pixy2Intersection
@@ -383,7 +383,7 @@
  * @param version (T_Pixy2Version - passed by reference) : pointer to the version data structure
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_getVersion (T_Pixy2Version *version);
+T_pixy2ErrorCode pixy2_getVersion (T_pixy2Version *version);
 
 /**
  * Gets the width and height of the frames used by the current program.
@@ -393,7 +393,7 @@
  * @param resolution (T_Pixy2Resolution - passed by reference) : pointer to the resolution data structure
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_getResolution (T_Pixy2Resolution *resolution);
+T_pixy2ErrorCode pixy2_getResolution (T_pixy2Resolution *resolution);
 
 /**
  * Sets the relative exposure level of Pixy2's image sensor.
@@ -403,7 +403,7 @@
  * @param brightness (Byte - passed by value) : brightness level 
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_setCameraBrightness (Byte brightness);
+T_pixy2ErrorCode pixy2_setCameraBrightness (Byte brightness);
 
 /**
  * Sets the servo positions of servos plugged into Pixy2's two RC servo connectors. 
@@ -413,7 +413,7 @@
  * @param s1 (Word - passed by value) : value between 0 and 511 
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_setServos (Word s0, Word s1); 
+T_pixy2ErrorCode pixy2_setServos (Word s0, Word s1); 
 
 /**
  * Sets Pixy2's RGB LED value. The three arguments sets the brightness of the red, green and blue sections of the LED.
@@ -425,7 +425,7 @@
  * @param blue (Byte - passed by value) : Blue component value (between 0 and 255) 
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_setLED (Byte red, Byte green, Byte blue);
+T_pixy2ErrorCode pixy2_setLED (Byte red, Byte green, Byte blue);
 
 /**
  * Turns on/off Pixy2's integrated light source.
@@ -437,7 +437,7 @@
  * @param lower (Byte - passed by value) : binary, zero or non-zero 
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_setLamp (Byte upper, Byte lower);
+T_pixy2ErrorCode pixy2_setLamp (Byte upper, Byte lower);
 
 /**
  * Gets Pixy2's framerate.
@@ -448,7 +448,7 @@
  * @param framerate (T_pixy2returnCode - passed by reference) : acknoledge 
  * @return Pixy2ErrorCode : error code.
  */
-Pixy2ErrorCode pixy2_getFPS (T_pixy2ReturnCode *framerate);
+T_pixy2ErrorCode pixy2_getFPS (T_pixy2ReturnCode *framerate);
 
 /**
  * Gets all detected blocks in the most recent frame.
@@ -463,7 +463,7 @@
  * @note Filtering is based on ORing codes : 1 for sig1, 2 for sig2, 4 for sig3, 8 for sig4, 16 for sig5, 32 for sig6, 64 sor sig7 and 128 for color code.
  * @note So sigmap = 255 means accept all and sigmap = 0 means reject all. For example filtering to get only sig1 and sig5 means using sigmap = 17 (16 + 1).
  */
-Pixy2ErrorCode pixy2_getBlocks (Byte sigmap, Byte maxBloc);
+T_pixy2ErrorCode pixy2_getBlocks (Byte sigmap, Byte maxBloc);
 
 /**
  * This function gets the latest main features of Line tracking (including the Vector, any intersection that connects to the Vector, and barcodes).
@@ -479,7 +479,7 @@
  * @note Filtering is based on ORing codes : 1 for vectors, 2 for intersections, 4 for barcodes.
  * @note So 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
  */
-Pixy2ErrorCode pixy2_getMainFeature (Byte features);
+T_pixy2ErrorCode pixy2_getMainFeature (Byte features);
 
 /**
  * This function gets all the latest features of Line tracking (including the Vector, any intersection that connects to the Vector, and barcodes).
@@ -494,22 +494,22 @@
  * @note So for filtering : 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
  * @note So for return value : 1 means only vector(s) detected, 2 means only intersection(s) detected, 3 vector(s) and intersection(s) detected and so on.
  */
-Pixy2ErrorCode pixy2_getAllFeature (Byte features);
-Pixy2ErrorCode pixy2_setMode (Byte mode);
-Pixy2ErrorCode pixy2_setNexTurn (Word angle);
-Pixy2ErrorCode pixy2_setDefaultTurn (Word angle);
-Pixy2ErrorCode pixy2_setVector (Byte vectorIndex);
-Pixy2ErrorCode pixy2_ReverseVector (void);
-Pixy2ErrorCode pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel);
+T_pixy2ErrorCode pixy2_getAllFeature (Byte features);
+T_pixy2ErrorCode pixy2_setMode (Byte mode);
+T_pixy2ErrorCode pixy2_setNexTurn (Word angle);
+T_pixy2ErrorCode pixy2_setDefaultTurn (Word angle);
+T_pixy2ErrorCode pixy2_setVector (Byte vectorIndex);
+T_pixy2ErrorCode pixy2_ReverseVector (void);
+T_pixy2ErrorCode pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel);
 
 // Variables globales Publiques
 Byte                Pixy2_numBlocks;
 T_pixy2Bloc         Pixy2_blocks[];
 Byte                Pixy2_numVectors;
-T_Pixy2Vector       Pixy2_vectors[];
+T_pixy2Vector       Pixy2_vectors[];
 Byte                Pixy2_numIntersections;
 T_pixy2Intersection Pixy2_intersections[];
-T_Pixy2InterLine    Pixy2_intLines[];
+T_pixy2InterLine    Pixy2_intLines[];
 Byte                Pixy2_numBarcodes;
 T_pixy2BarCode      Pixy2_barcodes[];
 
@@ -521,24 +521,24 @@
 Byte                frameContainChecksum;
 
 // Fonctions privées
-Pixy2ErrorCode pixy2_sndGetVersion (void);
-Pixy2ErrorCode pixy2_sndGetResolution (void);
-Pixy2ErrorCode pixy2_sndSetCameraBrightness (Byte brightness);
-Pixy2ErrorCode pixy2_sndSetServo (Word s0, Word s1);
-Pixy2ErrorCode pixy2_sndSetLED (Byte red, Byte green, Byte blue);
-Pixy2ErrorCode pixy2_sndSetLamp (Byte upper, Byte lower);
-Pixy2ErrorCode pixy2_sndGetFPS (void);
-Pixy2ErrorCode pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc);
-Pixy2ErrorCode pixy2_sndGetMainFeature (Byte type, Byte feature);
-Pixy2ErrorCode pixy2_sndSetMode (Byte mode);
-Pixy2ErrorCode pixy2_sndSetNexTurn (Word angle);
-Pixy2ErrorCode pixy2_sndSetDefaultTurn (Word angle);
-Pixy2ErrorCode pixy2_sndSetVector (Byte vectorIndex);
-Pixy2ErrorCode pixy2_sndReverseVector (void);
-Pixy2ErrorCode pixy2_sndGetRGB (Word x, Word y, Byte saturate);
+T_pixy2ErrorCode pixy2_sndGetVersion (void);
+T_pixy2ErrorCode pixy2_sndGetResolution (void);
+T_pixy2ErrorCode pixy2_sndSetCameraBrightness (Byte brightness);
+T_pixy2ErrorCode pixy2_sndSetServo (Word s0, Word s1);
+T_pixy2ErrorCode pixy2_sndSetLED (Byte red, Byte green, Byte blue);
+T_pixy2ErrorCode pixy2_sndSetLamp (Byte upper, Byte lower);
+T_pixy2ErrorCode pixy2_sndGetFPS (void);
+T_pixy2ErrorCode pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc);
+T_pixy2ErrorCode pixy2_sndGetMainFeature (Byte type, Byte feature);
+T_pixy2ErrorCode pixy2_sndSetMode (Byte mode);
+T_pixy2ErrorCode pixy2_sndSetNexTurn (Word angle);
+T_pixy2ErrorCode pixy2_sndSetDefaultTurn (Word angle);
+T_pixy2ErrorCode pixy2_sndSetVector (Byte vectorIndex);
+T_pixy2ErrorCode pixy2_sndReverseVector (void);
+T_pixy2ErrorCode pixy2_sndGetRGB (Word x, Word y, Byte saturate);
 
 void pixy2_getByte ();
-Pixy2ErrorCode pixy2_validateChecksum (Byte* tab);
+T_pixy2ErrorCode pixy2_validateChecksum (Byte* tab);
 };
 
 #endif        
\ No newline at end of file