Gas Pressure Display Updated Power control for Pressure sensor added

Dependencies:   UniGraphic mbed vt100

Committer:
Rhyme
Date:
Fri Feb 16 08:27:50 2018 +0000
Revision:
0:37c8ecde13c2
control PSE530 power via PTC5 (pse530_en)

Who changed what in which revision?

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