Release candidate version. The pointer in GAS Pressure display is changed to a triangle.

Dependencies:   UniGraphic mbed vt100

Please note, at 2-Mar-2018 the current version of mbed-lib has a defect in Ticker.
https://os.mbed.com/forum/bugs-suggestions/topic/29287/

So, mbed lib version 157 is intentionally being used.
Please do not update mbed library until the problem in the above URL is fixed.

In this version, format of GAS Pressure Display has been changed.
/media/uploads/Rhyme/low.jpg

/media/uploads/Rhyme/good.jpg

/media/uploads/Rhyme/high.jpg

moto

Committer:
Rhyme
Date:
Fri Mar 02 07:56:09 2018 +0000
Revision:
0:774324cbc5a6
Release candidate version. GAS Pressure pointer is now a triangle.; Some source file clean-up was done.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:774324cbc5a6 1 #ifndef _VEML6040_H_
Rhyme 0:774324cbc5a6 2 #define _VEML6040_H_
Rhyme 0:774324cbc5a6 3
Rhyme 0:774324cbc5a6 4 #include "mbed.h"
Rhyme 0:774324cbc5a6 5
Rhyme 0:774324cbc5a6 6 /**
Rhyme 0:774324cbc5a6 7 * RGBW Color Sensor with I2C Interface
Rhyme 0:774324cbc5a6 8 * I2C 7bit address: 0x10
Rhyme 0:774324cbc5a6 9 *
Rhyme 0:774324cbc5a6 10 */
Rhyme 0:774324cbc5a6 11
Rhyme 0:774324cbc5a6 12 class VEML6040
Rhyme 0:774324cbc5a6 13 {
Rhyme 0:774324cbc5a6 14 public:
Rhyme 0:774324cbc5a6 15 /**
Rhyme 0:774324cbc5a6 16 * constructor
Rhyme 0:774324cbc5a6 17 *
Rhyme 0:774324cbc5a6 18 * @param i2c Pointer of the I2C object
Rhyme 0:774324cbc5a6 19 * @param addr address of the I2C peripheral
Rhyme 0:774324cbc5a6 20 */
Rhyme 0:774324cbc5a6 21 VEML6040(I2C *i2c, int addr) ;
Rhyme 0:774324cbc5a6 22
Rhyme 0:774324cbc5a6 23 /**
Rhyme 0:774324cbc5a6 24 * destructor
Rhyme 0:774324cbc5a6 25 */
Rhyme 0:774324cbc5a6 26 ~VEML6040() ;
Rhyme 0:774324cbc5a6 27
Rhyme 0:774324cbc5a6 28 /**
Rhyme 0:774324cbc5a6 29 * get Red
Rhyme 0:774324cbc5a6 30 * @param none
Rhyme 0:774324cbc5a6 31 * @returns float value of Red
Rhyme 0:774324cbc5a6 32 */
Rhyme 0:774324cbc5a6 33 float getR(void) ; // return float value of Red
Rhyme 0:774324cbc5a6 34
Rhyme 0:774324cbc5a6 35 /**
Rhyme 0:774324cbc5a6 36 * get Green
Rhyme 0:774324cbc5a6 37 * @param none
Rhyme 0:774324cbc5a6 38 * @returns float value of Green
Rhyme 0:774324cbc5a6 39 */
Rhyme 0:774324cbc5a6 40 float getG(void) ; // return float value of Green
Rhyme 0:774324cbc5a6 41
Rhyme 0:774324cbc5a6 42 /**
Rhyme 0:774324cbc5a6 43 * get Blue
Rhyme 0:774324cbc5a6 44 * @param none
Rhyme 0:774324cbc5a6 45 * @returns float value of Blue
Rhyme 0:774324cbc5a6 46 */
Rhyme 0:774324cbc5a6 47 float getB(void) ; // return float value of Blue
Rhyme 0:774324cbc5a6 48
Rhyme 0:774324cbc5a6 49 /**
Rhyme 0:774324cbc5a6 50 * get White
Rhyme 0:774324cbc5a6 51 * @param none
Rhyme 0:774324cbc5a6 52 * @returns float value of White
Rhyme 0:774324cbc5a6 53 */
Rhyme 0:774324cbc5a6 54 float getW(void) ; // return float value of White
Rhyme 0:774324cbc5a6 55
Rhyme 0:774324cbc5a6 56 /**
Rhyme 0:774324cbc5a6 57 * get CCT(McCAMY FORMULA) value X
Rhyme 0:774324cbc5a6 58 * @param none
Rhyme 0:774324cbc5a6 59 * @returns float CCT value X
Rhyme 0:774324cbc5a6 60 */
Rhyme 0:774324cbc5a6 61 float getX(void) ; // return float value of X
Rhyme 0:774324cbc5a6 62
Rhyme 0:774324cbc5a6 63 /**
Rhyme 0:774324cbc5a6 64 * get CCT(McCAMY FOMULA) value Y
Rhyme 0:774324cbc5a6 65 * @param none
Rhyme 0:774324cbc5a6 66 * @returns float CCT value Y
Rhyme 0:774324cbc5a6 67 */
Rhyme 0:774324cbc5a6 68 float getY(void) ; // return float value of Y
Rhyme 0:774324cbc5a6 69
Rhyme 0:774324cbc5a6 70 /**
Rhyme 0:774324cbc5a6 71 * get CCT(McCAMY FOMULA) value Z
Rhyme 0:774324cbc5a6 72 * @param none
Rhyme 0:774324cbc5a6 73 * @returns float CCT value Z
Rhyme 0:774324cbc5a6 74 */
Rhyme 0:774324cbc5a6 75 float getZ(void) ; // return float value of Z
Rhyme 0:774324cbc5a6 76
Rhyme 0:774324cbc5a6 77 /**
Rhyme 0:774324cbc5a6 78 * get CIE1931 X
Rhyme 0:774324cbc5a6 79 * @param none
Rhyme 0:774324cbc5a6 80 * @returns float CIE1931 X
Rhyme 0:774324cbc5a6 81 */
Rhyme 0:774324cbc5a6 82 float getCIEX(void) ; // return float value of CIE1931_x
Rhyme 0:774324cbc5a6 83
Rhyme 0:774324cbc5a6 84 /**
Rhyme 0:774324cbc5a6 85 * get CIE1931 Y
Rhyme 0:774324cbc5a6 86 * @param none
Rhyme 0:774324cbc5a6 87 * @returns float CIE1931 Y
Rhyme 0:774324cbc5a6 88 */
Rhyme 0:774324cbc5a6 89 float getCIEY(void) ; // return float value of CIE1931_y
Rhyme 0:774324cbc5a6 90
Rhyme 0:774324cbc5a6 91 /**
Rhyme 0:774324cbc5a6 92 * get color config data
Rhyme 0:774324cbc5a6 93 * @param *colorconf uint8_t
Rhyme 0:774324cbc5a6 94 * @reutns 0: success non-0: failure
Rhyme 0:774324cbc5a6 95 */
Rhyme 0:774324cbc5a6 96 int getCOLORConf(uint8_t *colorconf) ;
Rhyme 0:774324cbc5a6 97
Rhyme 0:774324cbc5a6 98 /**
Rhyme 0:774324cbc5a6 99 * set color config data
Rhyme 0:774324cbc5a6 100 * @param *colorconf uint8_t
Rhyme 0:774324cbc5a6 101 * @returns 0: success non-0: failure
Rhyme 0:774324cbc5a6 102 */
Rhyme 0:774324cbc5a6 103 int setCOLORConf(uint8_t colorconf) ;
Rhyme 0:774324cbc5a6 104
Rhyme 0:774324cbc5a6 105 /**
Rhyme 0:774324cbc5a6 106 * get raw Red data
Rhyme 0:774324cbc5a6 107 * @param uint16_t *rdata
Rhyme 0:774324cbc5a6 108 * @returns i2c status 0: success non-0: failure
Rhyme 0:774324cbc5a6 109 */
Rhyme 0:774324cbc5a6 110 int getRData(uint16_t *rdata) ;
Rhyme 0:774324cbc5a6 111
Rhyme 0:774324cbc5a6 112 /**
Rhyme 0:774324cbc5a6 113 * get raw Green data
Rhyme 0:774324cbc5a6 114 * @param uint16_t *gdata
Rhyme 0:774324cbc5a6 115 * @returns i2c status 0: success non-0: failure
Rhyme 0:774324cbc5a6 116 */
Rhyme 0:774324cbc5a6 117 int getGData(uint16_t *gdata) ;
Rhyme 0:774324cbc5a6 118
Rhyme 0:774324cbc5a6 119 /**
Rhyme 0:774324cbc5a6 120 * get raw Blue data
Rhyme 0:774324cbc5a6 121 * @param uint16_t *bdata
Rhyme 0:774324cbc5a6 122 * @returns i2c status 0: success non-0: failure
Rhyme 0:774324cbc5a6 123 */
Rhyme 0:774324cbc5a6 124 int getBData(uint16_t *bdata) ;
Rhyme 0:774324cbc5a6 125
Rhyme 0:774324cbc5a6 126 /**
Rhyme 0:774324cbc5a6 127 * get raw White data
Rhyme 0:774324cbc5a6 128 * @param uint16_t *wdata
Rhyme 0:774324cbc5a6 129 * @returns i2c status 0: success non-0: failure
Rhyme 0:774324cbc5a6 130 */
Rhyme 0:774324cbc5a6 131 int getWData(uint16_t *wdata) ;
Rhyme 0:774324cbc5a6 132
Rhyme 0:774324cbc5a6 133 // void getCCTiData(uint16_t *cctidata) ;
Rhyme 0:774324cbc5a6 134 /**
Rhyme 0:774324cbc5a6 135 * get CCTi data for CCT (EMPIRICAL APPROACH)
Rhyme 0:774324cbc5a6 136 * @param none
Rhyme 0:774324cbc5a6 137 * @returns float CCTi data
Rhyme 0:774324cbc5a6 138 */
Rhyme 0:774324cbc5a6 139 float getCCTiData(void) ;
Rhyme 0:774324cbc5a6 140 // void getCCTData(uint16_t *cctdata) ;
Rhyme 0:774324cbc5a6 141
Rhyme 0:774324cbc5a6 142 /**
Rhyme 0:774324cbc5a6 143 * get CCT data (EMPIRICAL APPROACH)
Rhyme 0:774324cbc5a6 144 * @param none
Rhyme 0:774324cbc5a6 145 * @returns float CCD data
Rhyme 0:774324cbc5a6 146 */
Rhyme 0:774324cbc5a6 147 float getCCTData(void) ;
Rhyme 0:774324cbc5a6 148
Rhyme 0:774324cbc5a6 149 private:
Rhyme 0:774324cbc5a6 150 I2C *p_i2c;
Rhyme 0:774324cbc5a6 151 int m_addr;
Rhyme 0:774324cbc5a6 152 int readRegs(int addr, uint8_t * data, int len);
Rhyme 0:774324cbc5a6 153 int writeRegs(uint8_t * data, int len);
Rhyme 0:774324cbc5a6 154 } ;
Rhyme 0:774324cbc5a6 155 #endif /* _VEML6040_H_ */