VEML6030, High Accuracy Ambient Light Sensor with I2C Interface

Dependents:   testVEML6030

Committer:
Rhyme
Date:
Sat Apr 29 07:56:03 2017 +0000
Revision:
1:00f62b381f9e
Parent:
0:852cb01d2317
Wrong Endian fixed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:852cb01d2317 1 #ifndef _VEML6030_H_
Rhyme 0:852cb01d2317 2 #define _VEML6030_H_
Rhyme 0:852cb01d2317 3 /**
Rhyme 0:852cb01d2317 4 * Vishay VEML6030
Rhyme 0:852cb01d2317 5 * High Accuracy Ambient Light Sensor with I2C Interface
Rhyme 0:852cb01d2317 6 */
Rhyme 0:852cb01d2317 7 /*
Rhyme 0:852cb01d2317 8 * @code
Rhyme 0:852cb01d2317 9 * @endcode
Rhyme 0:852cb01d2317 10 */
Rhyme 0:852cb01d2317 11 class VEML6030
Rhyme 0:852cb01d2317 12 {
Rhyme 0:852cb01d2317 13 public:
Rhyme 0:852cb01d2317 14 /**
Rhyme 0:852cb01d2317 15 * VEML6030 constructor
Rhyme 0:852cb01d2317 16 *
Rhyme 0:852cb01d2317 17 * @param sda SDA pin
Rhyme 0:852cb01d2317 18 * @param sdl SCL pin
Rhyme 0:852cb01d2317 19 * @param addr addr of the I2C peripheral
Rhyme 0:852cb01d2317 20 */
Rhyme 0:852cb01d2317 21 VEML6030(PinName sda, PinName scl, int addr);
Rhyme 0:852cb01d2317 22
Rhyme 0:852cb01d2317 23 /**
Rhyme 0:852cb01d2317 24 * VEML6030 destructor
Rhyme 0:852cb01d2317 25 */
Rhyme 0:852cb01d2317 26 ~VEML6030();
Rhyme 0:852cb01d2317 27
Rhyme 0:852cb01d2317 28 void setALSConf(uint16_t conf) ;
Rhyme 0:852cb01d2317 29 void setALS_WH(uint16_t wh) ;
Rhyme 0:852cb01d2317 30 void setALS_WL(uint16_t wl) ;
Rhyme 0:852cb01d2317 31 void setPowerSaving(uint16_t ps) ;
Rhyme 0:852cb01d2317 32 uint16_t getALS(void) ;
Rhyme 0:852cb01d2317 33 uint16_t getWHITE(void) ;
Rhyme 0:852cb01d2317 34 uint16_t getALS_INT(void) ;
Rhyme 0:852cb01d2317 35
Rhyme 0:852cb01d2317 36 private:
Rhyme 0:852cb01d2317 37 I2C m_i2c;
Rhyme 0:852cb01d2317 38 int m_addr;
Rhyme 0:852cb01d2317 39 void readRegs(int addr, uint8_t * data, int len);
Rhyme 0:852cb01d2317 40 void writeRegs(uint8_t * data, int len);
Rhyme 0:852cb01d2317 41
Rhyme 0:852cb01d2317 42 };
Rhyme 0:852cb01d2317 43 #endif /* _VEML6030_H_ */