Vishay VEML6040 Color RGB sensor I2C driver library
Dependents: test_VEML6040 testSensor
VEML6040.h
- Committer:
- shockey
- Date:
- 2016-02-05
- Revision:
- 0:e6e6107c659e
- Child:
- 1:5540b216acfc
File content as of revision 0:e6e6107c659e:
/* * File description * */ #ifndef _VEML6040_H_ #define _VEML6040_H_ #include "mbed.h" /** * RGBW Color Sensor with I2C Interface * I2C 7bit address: 0x10 * */ class VEML6040 { public: /** * constructor * * @param sda SDA pin * @param scl SCL pin * @param addr address of the I2C peripheral */ VEML6040(PinName sda, PinName scl, int addr) ; ~VEML6040() ; /* * some member functions here (yet to be written) */ float getR(void) ; // return float value of Red float getG(void) ; // return float value of Green float getB(void) ; // return float value of Blue float getW(void) ; // return float value of White void getCOLORConf(uint8_t *colorconf) ; void setCOLORConf(uint8_t colorconf) ; void getRData(uint16_t *rdata) ; void getGData(uint16_t *gdata) ; void getBData(uint16_t *bdata) ; void getWData(uint16_t *wdata) ; // void cmdRead(uint8_t cmd, uint8_t *data, uint8_t numdata = 2) ; // void cmdWrite(uint8_t cmd, uint8_t *data, uint8_t numdata = 2) ; private: I2C m_i2c; int m_addr; void readRegs(int addr, uint8_t * data, int len); void writeRegs(uint8_t * data, int len); } ; #endif /* _VEML6040_H_ */