Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: UniGraphic mbed vt100
VEML6040.h
00001 #ifndef _VEML6040_H_ 00002 #define _VEML6040_H_ 00003 00004 #include "mbed.h" 00005 00006 /** 00007 * RGBW Color Sensor with I2C Interface 00008 * I2C 7bit address: 0x10 00009 * 00010 */ 00011 00012 class VEML6040 00013 { 00014 public: 00015 /** 00016 * constructor 00017 * 00018 * @param i2c Pointer of the I2C object 00019 * @param addr address of the I2C peripheral 00020 */ 00021 VEML6040(I2C *i2c, int addr) ; 00022 00023 /** 00024 * destructor 00025 */ 00026 ~VEML6040() ; 00027 00028 /** 00029 * get Red 00030 * @param none 00031 * @returns float value of Red 00032 */ 00033 float getR(void) ; // return float value of Red 00034 00035 /** 00036 * get Green 00037 * @param none 00038 * @returns float value of Green 00039 */ 00040 float getG(void) ; // return float value of Green 00041 00042 /** 00043 * get Blue 00044 * @param none 00045 * @returns float value of Blue 00046 */ 00047 float getB(void) ; // return float value of Blue 00048 00049 /** 00050 * get White 00051 * @param none 00052 * @returns float value of White 00053 */ 00054 float getW(void) ; // return float value of White 00055 00056 /** 00057 * get CCT(McCAMY FORMULA) value X 00058 * @param none 00059 * @returns float CCT value X 00060 */ 00061 float getX(void) ; // return float value of X 00062 00063 /** 00064 * get CCT(McCAMY FOMULA) value Y 00065 * @param none 00066 * @returns float CCT value Y 00067 */ 00068 float getY(void) ; // return float value of Y 00069 00070 /** 00071 * get CCT(McCAMY FOMULA) value Z 00072 * @param none 00073 * @returns float CCT value Z 00074 */ 00075 float getZ(void) ; // return float value of Z 00076 00077 /** 00078 * get CIE1931 X 00079 * @param none 00080 * @returns float CIE1931 X 00081 */ 00082 float getCIEX(void) ; // return float value of CIE1931_x 00083 00084 /** 00085 * get CIE1931 Y 00086 * @param none 00087 * @returns float CIE1931 Y 00088 */ 00089 float getCIEY(void) ; // return float value of CIE1931_y 00090 00091 /** 00092 * get color config data 00093 * @param *colorconf uint8_t 00094 * @reutns 0: success non-0: failure 00095 */ 00096 int getCOLORConf(uint8_t *colorconf) ; 00097 00098 /** 00099 * set color config data 00100 * @param *colorconf uint8_t 00101 * @returns 0: success non-0: failure 00102 */ 00103 int setCOLORConf(uint8_t colorconf) ; 00104 00105 /** 00106 * get raw Red data 00107 * @param uint16_t *rdata 00108 * @returns i2c status 0: success non-0: failure 00109 */ 00110 int getRData(uint16_t *rdata) ; 00111 00112 /** 00113 * get raw Green data 00114 * @param uint16_t *gdata 00115 * @returns i2c status 0: success non-0: failure 00116 */ 00117 int getGData(uint16_t *gdata) ; 00118 00119 /** 00120 * get raw Blue data 00121 * @param uint16_t *bdata 00122 * @returns i2c status 0: success non-0: failure 00123 */ 00124 int getBData(uint16_t *bdata) ; 00125 00126 /** 00127 * get raw White data 00128 * @param uint16_t *wdata 00129 * @returns i2c status 0: success non-0: failure 00130 */ 00131 int getWData(uint16_t *wdata) ; 00132 00133 // void getCCTiData(uint16_t *cctidata) ; 00134 /** 00135 * get CCTi data for CCT (EMPIRICAL APPROACH) 00136 * @param none 00137 * @returns float CCTi data 00138 */ 00139 float getCCTiData(void) ; 00140 // void getCCTData(uint16_t *cctdata) ; 00141 00142 /** 00143 * get CCT data (EMPIRICAL APPROACH) 00144 * @param none 00145 * @returns float CCD data 00146 */ 00147 float getCCTData(void) ; 00148 00149 private: 00150 I2C *p_i2c; 00151 int m_addr; 00152 int readRegs(int addr, uint8_t * data, int len); 00153 int writeRegs(uint8_t * data, int len); 00154 } ; 00155 #endif /* _VEML6040_H_ */
Generated on Fri Jul 15 2022 06:01:06 by
1.7.2