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 モードになっています。

半田のジャンパを変えて、SPIの設定にしてください。

サーミスタについて
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
で呼ぶように変更しました。
Diff: afLib/iafLib.h
- Revision:
- 0:0b6732b53bf4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/afLib/iafLib.h Tue Apr 24 08:58:33 2018 +0000
@@ -0,0 +1,126 @@
+/**
+ * Copyright 2015 Afero, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * afLib public interface
+ *
+ * This file defines everything your application should need for commuinicating with the Afero ASR-1 radio module.
+ * Is there is anything missing from this file, please post a request on the developer forum and we will see what
+ * we can do.
+ */
+#ifndef AFLIB_IAFLIB_H
+#define AFLIB_IAFLIB_H
+
+#include "mbed.h"
+#include <string>
+using namespace std;
+#include "afErrors.h"
+#include "afSPI.h"
+
+#if defined (TARGET_TEENSY3_1)
+ #include "USBSerial.h"
+#endif
+
+#define afMINIMUM_TIME_BETWEEN_REQUESTS 1000
+
+#define MAX_ATTRIBUTE_SIZE 255
+
+typedef void (*isr)();
+typedef void (*onAttributeSet)(const uint8_t requestId, const uint16_t attributeId, const uint16_t valueLen, const uint8_t *value);
+typedef void (*onAttributeSetComplete)(const uint8_t requestId, const uint16_t attributeId, const uint16_t valueLen, const uint8_t *value);
+
+class iafLib {
+public:
+ /**
+ * create
+ *
+ * Create an instance of the afLib object. The afLib is a singleton. Calling this method multiple
+ * times will return the same instance.
+ *
+ * @param mcuInterrupt The Arduino interrupt to be used (returned from digitalPinToInterrupt)
+ * @param isrWrapper This is the isr method that must be defined in your sketch
+ * @param attrSet Callback for notification of attribute set requests
+ * @param attrSetComplete Callback for notification of attribute set request completions
+ * @return iafLib * Instance of iafLib
+ */
+ static iafLib * create(PinName mcuInterrupt, isr isrWrapper,
+ onAttributeSet attrSet, onAttributeSetComplete attrSetComplete, afSPI *theSPI);
+
+ //wsugi 20161128
+ static void destroy();
+
+ /**
+ * loop
+ *
+ * Called by the loop() method in your sketch to give afLib some CPU time
+ */
+ virtual void loop(void) = 0;
+
+ /**
+ * getAttribute
+ *
+ * Request the value of an attribute be returned from the ASR-1.
+ * Value will be returned in the attrSetComplete callback.
+ */
+ virtual int getAttribute(const uint16_t attrId) = 0;
+
+ /**
+ * setAttribute
+ *
+ * Request setting an attribute.
+ * For MCU attributes, the attribute value will be updated.
+ * For IO attributes, the attribute value will be updated, and then onAttrSetComplete will be called.
+ */
+ virtual int setAttributeBool(const uint16_t attrId, const bool value) = 0;
+
+ virtual int setAttribute8(const uint16_t attrId, const int8_t value) = 0;
+
+ virtual int setAttribute16(const uint16_t attrId, const int16_t value) = 0;
+
+ virtual int setAttribute32(const uint16_t attrId, const int32_t value) = 0;
+
+ virtual int setAttribute64(const uint16_t attrId, const int64_t value) = 0;
+
+ virtual int setAttribute(const uint16_t attrId, const string &value) = 0;
+
+ virtual int setAttribute(const uint16_t attrId, const uint16_t valueLen, const char *value) = 0;
+
+ virtual int setAttribute(const uint16_t attrId, const uint16_t valueLen, const uint8_t *value) = 0;
+
+ /**
+ * setAttributeComplete
+ *
+ * Call this in response to an onAttrSet. This lets the ASR-1 know that the set request has been handled.
+ */
+ virtual int setAttributeComplete(uint8_t requestId, const uint16_t attrId, const uint16_t valueLen, const uint8_t *value) = 0;
+
+ /**
+ * isIdle
+ *
+ * Call to find out of the ASR-1 is currently handling a request.
+ *
+ * @return true if an operation is in progress
+ */
+ virtual bool isIdle() = 0;
+
+ /**
+ * mcuISR
+ *
+ * Called by your sketch to pass the interrupt along to afLib.
+ */
+ virtual void mcuISR() = 0;
+};
+#endif //AFLIB_IAFLIB_H
\ No newline at end of file
La Suno