IS31SE5000 IR SENSOR FOR TOUCHLESS MOTION AND PROXIMITY

Dependents:   test_IS31SE5000 testSensor

Revision:
1:3f4ccc809dfc
Parent:
0:b92d4b745118
Child:
2:215d002d2bbf
--- a/IS31SE5000.h	Thu Dec 24 00:40:19 2015 +0000
+++ b/IS31SE5000.h	Thu May 11 07:26:49 2017 +0000
@@ -21,29 +21,124 @@
  
  ~IS31SE5000() ;
  
- /* for Status Register */
- uint8_t getStatus(void) ; /* returns status register */
- uint8_t getPD(void) ; /* get Proximity Detection Value */
- uint8_t getMD(void) ; /* get Motion Detection Value */
+ /**
+  * get status register value
+  *
+  * @param none
+  * @returns uint8_t status register value
+  *
+  * @note status register 0x00
+  * @note bit[7:4] (reserved)
+  * @note -
+  * @note bit[3:2] PD
+  * @note 01: Be off,  02: Be close, Others: No motion
+  * @note -
+  * @note bit[1:0] MD
+  * @note 01: From PD2 to PD1, 10: From PD1 to PD2, Others: No motion
+  */
+ uint8_t getStatus(void) ;
+ 
+ /**
+  * get Proximity Detection Value
+  * 
+  * @param none
+  * @returns uint8_t value of PD part of status register bit[3:2]
+  */
+ uint8_t getPD(void) ; 
  
- /* for Shutdown Register */
+ /**
+  * get Mortion Detection Value
+  * @param none
+  * @returns uint8_t value of MD part of status register bit[1:0]
+  */
+ uint8_t getMD(void) ; 
+ 
+/**
+ * get shutdown register value
+ *
+ * @param none
+ * @returns uint8_t shutdown register value
+ *
+ * @note shutdown register (0x01)
+ * @note bit[7:1] (reserved)
+ * @note bit[0] SSD
+ * @note 0: Software shutdown mode, 1: Normal operation
+ */
+ uint8_t get_shutdown_reg(void) ;
+ 
+ /**
+  * activate the device
+  *
+  * @param none
+  * @returns none
+  */
  void activate(void) ;
+ 
+ /**
+  * (Software) shutdown the device
+  *
+  * @param none
+  * @returns none
+  */
  void shutdown(void) ;
  
- /* for Configuration Register */
- void setEC(uint8_t ec_value) ;
- void motionMode(void) ;
- void proximityMode(void) ;
- uint8_t getEC(void) ;
- uint8_t getMode(void) ;
+/**
+ * get Configuration Register value
+ *
+ * @param none
+ * @returns uint8_t configuration register value
+ *
+ * @note Configuration Register (0x11)
+ * @note bit[7:4] (reserved)
+ * @note -
+ * @note bit[3:1] EC Emitting Current Setting
+ * @note 000: 400mA, 001: 280mA, 01x: 210mA, 1xx: 70mA
+ * @note - 
+ * @note bit[0] MODE Mode Selection
+ * @note 0: Motion mode, 1: Proximity mode
+ */
+ uint8_t get_config_reg(void) ;
+
+/**
+ * get EC value of Configuration Register bit[3:1]
+ *
+ * @param none
+ * @returns uint8_t EC part of Configuration Register bit[3:1]
+ */
+uint8_t getEC(void) ;
+
+/**
+ * set EC value to Configuration Register [3:1]
+ *
+ * @param uint8_t EC Value to assign, 000b ~ 1xxb
+ * @returns none
+ */
+void setEC(uint8_t ec_value) ;
  
- /* */
- uint8_t get_shutdown_reg(void) ;
- uint8_t get_config_reg(void) ;
+/**
+ * get MODE value of Configuration Register bit[0]
+ *
+ * @param none
+ * @returns uint8_t MODE value of configuration Register bit[0]
+ */
+uint8_t getMode(void) ;
+
+/**
+ * Set device mode to motion detection
+ *
+ * @param none
+ * @returns none
+ */
+void motionMode(void) ;
+
+/**
+ * Set device mode to proximity detection
+ *
+ * @param none
+ * @returns none
+ */
+void proximityMode(void) ;
  
- /*
-  * some member functions here (yet to be written)
-  */
   private:
   I2C m_i2c;
   int m_addr;