Reference firmware for PixArt's PAA5100 sensor and evaluation board. "Hello World" and "Library" contain the exact same files. Please import just one of the two into your mBed compiler as a new program and not as a library.

Files at this revision

API Documentation at this revision

Comitter:
PixArtVY
Date:
Wed Jul 18 18:37:03 2018 +0000
Parent:
0:c8a2256e02c2
Commit message:
Added Apache License notice.

Changed in this revision

commHeaders/SPIcommFunctions.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c8a2256e02c2 -r 782127a132a3 commHeaders/SPIcommFunctions.h
--- a/commHeaders/SPIcommFunctions.h	Tue Apr 03 20:04:39 2018 +0000
+++ b/commHeaders/SPIcommFunctions.h	Wed Jul 18 18:37:03 2018 +0000
@@ -26,7 +26,7 @@
 //This function takes an 8-bit address and 8-bit data. Writes the given data to the given address.
 
 void startupCheck(void);
-//Sets all of the registers needed for initialization and performance optimization.
+//Checks whether or not the sensor was started up properly.
 
 void initializeSensor(void);
 //Sets all of the registers needed for initialization and performance optimization.
@@ -80,12 +80,15 @@
     writeRegister(0x7F, 0x0E);
     writeRegister(0x43, 0x10);
     
-    for(int i=0; i<3; i++)
+    if(readRegister(0x47) != 0x08)
     {
-        if(readRegister(0x47) != 0x08)
+        for(int i=0; i<3; i++)          //Checks register 0x47 three times. If the value is incorrect 3 times, throw a fail condition.
         {
-            writeRegister(0x43, 0x10)
-            startupFail++;
+            if(readRegister(0x47) != 0x08)
+            {
+                writeRegister(0x43, 0x10)
+                startupFail++;
+            }
         }
     }
 }
diff -r c8a2256e02c2 -r 782127a132a3 main.cpp
--- a/main.cpp	Tue Apr 03 20:04:39 2018 +0000
+++ b/main.cpp	Wed Jul 18 18:37:03 2018 +0000
@@ -1,13 +1,21 @@
 // PAA5100JE-Q: Optical Tracking Chip reference code.
-// Version: 1.0
-// Latest Revision Date: 4 Apr. 2018
+// Version: 1.1
+// Latest Revision Date: 18 July 2018
 // By PixArt Imaging Inc.
 // Primary Engineer: Vincent Yeh (PixArt USA)
 
+// Copyright [2018] [Vincent Yeh]
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
+// http://www.apache.org/licenses/LICENSE-2.0
+
+
 /*
 //=======================
 //Revision History
 //=======================
+Version 1.1 -- 18 July 2018
+Added apache license notice.
+
 Version 1.0 -- 4 Apr. 2018
 First release.
 */