Temporary Connector Reversed Version

Dependencies:   UniGraphic mbed vt100

afero_poc15_180403R , J1 のピン配置を反転させたヴァージョンです。

Color2系を使用するためには以下のピンをジャンパで接続してください。
J1-D7 <-> J1-D0
J1-D6 <-> J1-D1

(調査中) また、こちらでテストした範囲では、
FRDM-KL25Z の V3.3 を、Modulo2 の VCC_3V3 ピンに接続してやる必要がありました。

尚、J1-D1, D0 を使用するために UART を無効にしているため
ログは表示されません。

TFTモジュールについて 
aitendoのTFTモジュールはデフォルトでは8bit bus モードになっています。
/media/uploads/Rhyme/img_2364.jpg

半田のジャンパを変えて、SPIの設定にしてください。
/media/uploads/Rhyme/img_2363.jpg

サーミスタについて
POC1.5 では サーミスタは 25℃の時に抵抗値が 50.0kΩになる502AT-11 が
4.95kΩのプルアップ(実際は10kΩx2の並列)で使用されていました。

今回の試作では抵抗値が 10.0kΩの 103AT-11 が
5.1kΩのプルアップで使用されていますので、係数を合わせるために
SMTC502AT-11 のコンストラクタを 
R0 = 10.0
R1 = 5.1
B = 3435
T0 = 298.15
で呼ぶように変更しました。

Committer:
Rhyme
Date:
Tue Apr 24 12:18:10 2018 +0000
Revision:
1:6c54dc8acf96
Parent:
0:0b6732b53bf4
to adjust with 103AT-11 with 5.1k pull-up, the constructor of 502AT-11 is called with R0=10.0, R1=5.1, B=3435, T0=298.15

Who changed what in which revision?

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