I2C hang recover function added

Dependencies:   UniGraphic mbed vt100

Embed: (wiki syntax)

« Back to documentation index

VEML6040 Class Reference

VEML6040 Class Reference

RGBW Color Sensor with I2C Interface I2C 7bit address: 0x10. More...

#include <VEML6040.h>

Public Member Functions

 VEML6040 (I2C *i2c, int addr)
 constructor
 ~VEML6040 ()
 destructor
float getR (void)
 get Red
float getG (void)
 get Green
float getB (void)
 get Blue
float getW (void)
 get White
float getX (void)
 get CCT(McCAMY FORMULA) value X
float getY (void)
 get CCT(McCAMY FOMULA) value Y
float getZ (void)
 get CCT(McCAMY FOMULA) value Z
float getCIEX (void)
 get CIE1931 X
float getCIEY (void)
 get CIE1931 Y
int getCOLORConf (uint8_t *colorconf)
 get color config data
int setCOLORConf (uint8_t colorconf)
 set color config data
int getRData (uint16_t *rdata)
 get raw Red data
int getGData (uint16_t *gdata)
 get raw Green data
int getBData (uint16_t *bdata)
 get raw Blue data
int getWData (uint16_t *wdata)
 get raw White data
float getCCTiData (void)
 get CCTi data for CCT (EMPIRICAL APPROACH)
float getCCTData (void)
 get CCT data (EMPIRICAL APPROACH)

Detailed Description

RGBW Color Sensor with I2C Interface I2C 7bit address: 0x10.

Definition at line 12 of file VEML6040.h.


Constructor & Destructor Documentation

VEML6040 ( I2C *  i2c,
int  addr 
)

constructor

Parameters:
i2cPointer of the I2C object
addraddress of the I2C peripheral

Definition at line 50 of file VEML6040.cpp.

~VEML6040 (  )

destructor

Definition at line 56 of file VEML6040.cpp.


Member Function Documentation

float getB ( void   )

get Blue

Parameters:
none
Returns:
float value of Blue

Definition at line 160 of file VEML6040.cpp.

int getBData ( uint16_t *  bdata )

get raw Blue data

Parameters:
uint16_t*bdata
Returns:
i2c status 0: success non-0: failure

Definition at line 121 of file VEML6040.cpp.

float getCCTData ( void   )

get CCT data (EMPIRICAL APPROACH)

Parameters:
none
Returns:
float CCD data

Definition at line 230 of file VEML6040.cpp.

float getCCTiData ( void   )

get CCTi data for CCT (EMPIRICAL APPROACH)

Parameters:
none
Returns:
float CCTi data

Definition at line 217 of file VEML6040.cpp.

float getCIEX ( void   )

get CIE1931 X

Parameters:
none
Returns:
float CIE1931 X

Definition at line 241 of file VEML6040.cpp.

float getCIEY ( void   )

get CIE1931 Y

Parameters:
none
Returns:
float CIE1931 Y

Definition at line 254 of file VEML6040.cpp.

int getCOLORConf ( uint8_t *  colorconf )

get color config data

get COLOR Config

Parameters:
*colorconfuint8_t 0: success non-0: failure
*colorconfuint8_t refer to setCOLORConf for the value
Returns:
0: success non-0: failure

Definition at line 90 of file VEML6040.cpp.

float getG ( void   )

get Green

Parameters:
none
Returns:
float value of Green

Definition at line 151 of file VEML6040.cpp.

int getGData ( uint16_t *  gdata )

get raw Green data

Parameters:
uint16_t*gdata
Returns:
i2c status 0: success non-0: failure

Definition at line 112 of file VEML6040.cpp.

float getR ( void   )

get Red

Parameters:
none
Returns:
float value of Red

Definition at line 142 of file VEML6040.cpp.

int getRData ( uint16_t *  rdata )

get raw Red data

Parameters:
uint16_t*rdata
Returns:
i2c status 0: success non-0: failure

Definition at line 103 of file VEML6040.cpp.

float getW ( void   )

get White

Parameters:
none
Returns:
float value of White

Definition at line 169 of file VEML6040.cpp.

int getWData ( uint16_t *  wdata )

get raw White data

Parameters:
uint16_t*wdata
Returns:
i2c status 0: success non-0: failure

Definition at line 130 of file VEML6040.cpp.

float getX ( void   )

get CCT(McCAMY FORMULA) value X

Parameters:
none
Returns:
float CCT value X

Definition at line 178 of file VEML6040.cpp.

float getY ( void   )

get CCT(McCAMY FOMULA) value Y

Parameters:
none
Returns:
float CCT value Y

Definition at line 191 of file VEML6040.cpp.

float getZ ( void   )

get CCT(McCAMY FOMULA) value Z

Parameters:
none
Returns:
float CCT value Z

Definition at line 204 of file VEML6040.cpp.

int setCOLORConf ( uint8_t  colorconf )

set color config data

set COLOR Config

Parameters:
*colorconfuint8_t
Returns:
0: success non-0: failure
Parameters:
colorconfuint8_t 8bit register value
Returns:
0: success non-0: failure
Note:
Command Code 0x00 is used to access CONF register
bit[7] (reserved)
bit[6:4] = IT[2:0] Integration Time Selector
bit[3] (reserved)
bit[2] TRIG Proceed one detcting cycle at manual force mode
bit[1] AF 0: Auto mode 1: manual force mode
bit[0] SD 0: normal 1: chip shutdown setting
IT[2:0] 0=40ms, 1=80ms, 2=160ms, 3=320ms, 4=640ms, 5=1280ms
as our WatchDog is set to 1sec, 1280ms is invalid
and 640ms may not be practical

Definition at line 74 of file VEML6040.cpp.