IS31SE5000 IR SENSOR FOR TOUCHLESS MOTION AND PROXIMITY

Dependents:   test_IS31SE5000 testSensor

IS31SE5000.h

Committer:
Rhyme
Date:
2015-12-24
Revision:
0:b92d4b745118
Child:
1:3f4ccc809dfc

File content as of revision 0:b92d4b745118:

/**
 * IR31SE5000 : IR sensor for touchless motion and proximity
 * IS31SE5000.h
 *
 */
 
#ifndef _IS31SE5000_h_
#define _IS31SE5000_h_

class IS31SE5000 
{
public:
 /**
 *  constructor
 *
 * @param sda SDA pin
 * @param scl SCL pin
 * @param addr 7bit address of the I2C peripheral
 */
 IS31SE5000(PinName sda, PinName scl, int addr) ;
 
 ~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 */
 
 /* for Shutdown Register */
 void activate(void) ;
 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) ;
 
 /* */
 uint8_t get_shutdown_reg(void) ;
 uint8_t get_config_reg(void) ;
 
 /*
  * some member functions here (yet to be written)
  */
  private:
  I2C m_i2c;
  int m_addr;
  void readRegs(int addr, uint8_t *data, int len) ;
  void writeRegs(uint8_t *data, int len) ;
  
  uint8_t shutdown_reg ;
  uint8_t config_reg ;
} ;

#endif /* _IS31SE5000_h_ */