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 08:58:33 2018 +0000
Revision:
0:0b6732b53bf4
Temporary Connector Reversed Version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:0b6732b53bf4 1 /**
Rhyme 0:0b6732b53bf4 2 * Copyright 2015 Afero, Inc.
Rhyme 0:0b6732b53bf4 3 *
Rhyme 0:0b6732b53bf4 4 * Licensed under the Apache License, Version 2.0 (the "License");
Rhyme 0:0b6732b53bf4 5 * you may not use this file except in compliance with the License.
Rhyme 0:0b6732b53bf4 6 * You may obtain a copy of the License at
Rhyme 0:0b6732b53bf4 7 *
Rhyme 0:0b6732b53bf4 8 * http://www.apache.org/licenses/LICENSE-2.0
Rhyme 0:0b6732b53bf4 9 *
Rhyme 0:0b6732b53bf4 10 * Unless required by applicable law or agreed to in writing, software
Rhyme 0:0b6732b53bf4 11 * distributed under the License is distributed on an "AS IS" BASIS,
Rhyme 0:0b6732b53bf4 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Rhyme 0:0b6732b53bf4 13 * See the License for the specific language governing permissions and
Rhyme 0:0b6732b53bf4 14 * limitations under the License.
Rhyme 0:0b6732b53bf4 15 */
Rhyme 0:0b6732b53bf4 16
Rhyme 0:0b6732b53bf4 17 #ifndef COMMAND_H__
Rhyme 0:0b6732b53bf4 18 #define COMMAND_H__
Rhyme 0:0b6732b53bf4 19
Rhyme 0:0b6732b53bf4 20 #include "mbed.h" //wsugi
Rhyme 0:0b6732b53bf4 21 #include <string> //wsugi
Rhyme 0:0b6732b53bf4 22
Rhyme 0:0b6732b53bf4 23 using namespace std; //wsugi
Rhyme 0:0b6732b53bf4 24
Rhyme 0:0b6732b53bf4 25 #define SPI_CMD_MAX_LEN 256
Rhyme 0:0b6732b53bf4 26
Rhyme 0:0b6732b53bf4 27 #define UPDATE_REASON_UNKNOWN 0
Rhyme 0:0b6732b53bf4 28 #define UPDATE_REASON_LOCAL_UPDATE 1
Rhyme 0:0b6732b53bf4 29 #define UPDATE_REASON_SERVICE_SET 2
Rhyme 0:0b6732b53bf4 30 #define UPDATE_REASON_MCU_SET 3
Rhyme 0:0b6732b53bf4 31 #define UPDATE_REASON_RELINK 4
Rhyme 0:0b6732b53bf4 32 #define UPDATE_REASON_REBOOT 5
Rhyme 0:0b6732b53bf4 33
Rhyme 0:0b6732b53bf4 34 class Command {
Rhyme 0:0b6732b53bf4 35 public:
Rhyme 0:0b6732b53bf4 36 Command(uint16_t len, uint8_t *bytes);
Rhyme 0:0b6732b53bf4 37
Rhyme 0:0b6732b53bf4 38 Command(uint8_t requestId, const char *str);
Rhyme 0:0b6732b53bf4 39
Rhyme 0:0b6732b53bf4 40 Command(uint8_t requestId, uint8_t cmd, uint16_t attrId);
Rhyme 0:0b6732b53bf4 41
Rhyme 0:0b6732b53bf4 42 Command(uint8_t requestId, uint8_t cmd, uint16_t attrId, uint16_t valueLen, uint8_t *value);
Rhyme 0:0b6732b53bf4 43
Rhyme 0:0b6732b53bf4 44 Command(uint8_t requestId, uint8_t cmd, uint16_t attrId, uint8_t status, uint8_t reason, uint16_t valueLen,
Rhyme 0:0b6732b53bf4 45 uint8_t *value);
Rhyme 0:0b6732b53bf4 46
Rhyme 0:0b6732b53bf4 47 Command();
Rhyme 0:0b6732b53bf4 48
Rhyme 0:0b6732b53bf4 49 ~Command();
Rhyme 0:0b6732b53bf4 50
Rhyme 0:0b6732b53bf4 51 uint8_t getCommand();
Rhyme 0:0b6732b53bf4 52
Rhyme 0:0b6732b53bf4 53 uint8_t getReqId();
Rhyme 0:0b6732b53bf4 54
Rhyme 0:0b6732b53bf4 55 uint16_t getAttrId();
Rhyme 0:0b6732b53bf4 56
Rhyme 0:0b6732b53bf4 57 uint16_t getValueLen();
Rhyme 0:0b6732b53bf4 58
Rhyme 0:0b6732b53bf4 59 void getValue(uint8_t *value);
Rhyme 0:0b6732b53bf4 60
Rhyme 0:0b6732b53bf4 61 uint8_t *getValueP();
Rhyme 0:0b6732b53bf4 62
Rhyme 0:0b6732b53bf4 63 uint16_t getSize();
Rhyme 0:0b6732b53bf4 64
Rhyme 0:0b6732b53bf4 65 uint16_t getBytes(uint8_t *bytes);
Rhyme 0:0b6732b53bf4 66
Rhyme 0:0b6732b53bf4 67 bool isValid();
Rhyme 0:0b6732b53bf4 68
Rhyme 0:0b6732b53bf4 69 void dump();
Rhyme 0:0b6732b53bf4 70
Rhyme 0:0b6732b53bf4 71 void dumpBytes();
Rhyme 0:0b6732b53bf4 72
Rhyme 0:0b6732b53bf4 73 private:
Rhyme 0:0b6732b53bf4 74 uint8_t getVal(char c);
Rhyme 0:0b6732b53bf4 75 int strToValue(char *valueStr, uint8_t *value);
Rhyme 0:0b6732b53bf4 76
Rhyme 0:0b6732b53bf4 77 uint8_t strToCmd(char *cmdStr);
Rhyme 0:0b6732b53bf4 78
Rhyme 0:0b6732b53bf4 79 uint16_t strToAttrId(char *attrIdStr);
Rhyme 0:0b6732b53bf4 80
Rhyme 0:0b6732b53bf4 81 uint16_t _len;
Rhyme 0:0b6732b53bf4 82 uint8_t _cmd;
Rhyme 0:0b6732b53bf4 83 uint8_t _requestId;
Rhyme 0:0b6732b53bf4 84 uint16_t _attrId;
Rhyme 0:0b6732b53bf4 85 uint8_t _status;
Rhyme 0:0b6732b53bf4 86 uint8_t _reason;
Rhyme 0:0b6732b53bf4 87 uint16_t _valueLen;
Rhyme 0:0b6732b53bf4 88 uint8_t *_value;
Rhyme 0:0b6732b53bf4 89
Rhyme 0:0b6732b53bf4 90 char _printBuf[256];
Rhyme 0:0b6732b53bf4 91
Rhyme 0:0b6732b53bf4 92 };
Rhyme 0:0b6732b53bf4 93
Rhyme 0:0b6732b53bf4 94 #endif // COMMAND_H__