Vishay UV Sensor I2C library
Dependents: test_VEML6075 quattro_vishay_6075_171018 testSensor
Diff: VEML6075.h
- Revision:
- 0:14ccc7ed49fa
- Child:
- 2:0f3bb80aba40
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VEML6075.h Fri Feb 05 02:28:12 2016 +0000 @@ -0,0 +1,56 @@ +/* + * File description + * + */ + +#ifndef _VEML6075_H_ +#define _VEML6075_H_ + +#include "mbed.h" + +/** + * UVA and UVB Light Sensor with I2C Interface + * I2C 7bit address: 0x10 + * + */ + +class VEML6075 +{ +public: + /** + * constructor + * + * @param sda SDA pin + * @param scl SCL pin + * @param addr address of the I2C peripheral + */ + VEML6075(PinName sda, PinName scl, int addr) ; + + ~VEML6075() ; + + /* + * some member functions here (yet to be written) + */ +float getUVA(void) ; // return float value of UVA +float getUVA_CIE(void) ; // return float value of UVA_CIE +float getUVB(void) ; // return float value of UVB +float getUVB_CIE(void) ; // return float value of UVB_CIE +void getUVConf(uint8_t *uvconf) ; +void setUVConf(uint8_t uvconf) ; +void getUVAData(uint16_t *uvadata) ; +void getUVBData(uint16_t *uvbdata) ; +void getUVDData(uint16_t *uvddata) ; +void getUVCOMP1Data(uint16_t *uvcomp1data) ; +void getUVCOMP2Data(uint16_t *uvcomp2data) ; +float UVI(void) ; +void getID(uint16_t *id) ; +// 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 /* _VEML6075_H_ */