Vishay UV Sensor I2C library

VEML6075.h

Committer:
shockey
Date:
2016-02-05
Revision:
0:14ccc7ed49fa
Child:
2:0f3bb80aba40

File content as of revision 0:14ccc7ed49fa:

/*
 * 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_ */