RXduino  1.20a
RXduinoマニュアル 最終更新日 平成26年6月29日
wire.h
説明を見る。
1 /*******************************************************************************
2 * RXduinoライブラリ & 特電HAL
3 *
4 * このソフトウェアは特殊電子回路株式会社によって開発されたものです。
5 * 当社Webサイトを通じてダウンロードすることによって使用許諾されます。
6 * このファイルを第三者へ開示・再配布・貸与・譲渡することはできません。
7 * このソフトウェアはあるがままの状態で提供され、内容および動作についての保障はあ
8 * りません。弊社はファイルの内容および実行結果についていかなる責任も負いません。
9 * お客様は、お客様の製品開発のために当ソフトウェアのソースコードを自由に参照し、
10 * 引用していただくことができます。
11 * コンパイル・リンク後のオブジェクトファイル(ELF ファイルまたはMOT,SRECファイル)
12 * であって、デバッグ情報が削除されている場合は第三者に再配布することができます。
13 * (C) Copyright 2011-2014 TokushuDenshiKairo Inc. 特殊電子回路株式会社
14 * http://rx.tokudenkairo.co.jp/
15 *******************************************************************************/
16 
17 #ifndef __H_RXDUINO_WIRE
18 #define __H_RXDUINO_WIRE
19 /**************************************************************************/
25 #include "rxduino.h"
26 #include "../tkdnhal/tkdn_i2c.h"
27 
28 #define WIRE_LIBRARY_VERSION 0x01200000 // Version 1.20
29 #define WIRE_LIBRARY_TIME 1402069288 // 2014/6/07 00:41:28
30 
31 #ifdef __cplusplus
32  extern "C" {
33 #endif
34 
35 /*********************************************************************/
46 class TwoWire {
47 private:
48  i2c_info i2c; // 実体を持つ
49 
50 public:
51 /*********************************************************************/
62  static unsigned long getVersion(version_info *vi);
63 
64 /*********************************************************************/
68  TwoWire();
69 
70 /*********************************************************************/
77  void assignSdaScl(int sda_pin, int scl_pin);
78 
79 /*********************************************************************/
83  void begin();
84 
85 /*********************************************************************/
91  void begin(int address);
92 
93 /*********************************************************************/
100  int requestFrom(unsigned char address, int count);
101 
102 /*********************************************************************/
106  int available();
107 
108 
109 /*********************************************************************/
113  int read();
114 
115 /*********************************************************************/
121  void beginTransmission(unsigned char address);
122 
123 /*********************************************************************/
129  int write(unsigned char data);
130 
131 /*********************************************************************/
137  int write(int data);
138 
139 /*********************************************************************/
145  int write(char *str);
146 
147 /*********************************************************************/
154  int write(unsigned char *data,int quantity);
155 
156 /*********************************************************************/
168  unsigned char endTransmission();
169 
170 /*********************************************************************/
176  void setFrequency(int freq);
177 
178 };
179 
180 extern TwoWire Wire;
181 
182 #ifdef __cplusplus
183  }
184 #endif
185 
186 #endif // __H_RXDUINO_TONE
187 
int requestFrom(unsigned char address, int count)
I2Cデバイスに対して受信シーケンスを発行し、データを読み出す
int write(unsigned char data)
送信バッファの末尾に1バイトのデータを追加する
unsigned char endTransmission()
ターゲットデバイスに対してI2Cの送信シーケンスを発行する
static unsigned long getVersion(version_info *vi)
ライブラリのバージョン情報を取得する
void begin()
I2Cマスターとして初期化する
void setFrequency(int freq)
I2Cの周波数を変更する
int read()
受信バッファからデータを1バイト取り出す
2線式シリアルインタフェース(Wire または I2Cと呼ばれる)を扱うためのライブラリ。 このライブラリは tkdn_i2c.h で定義されたライブラリをC++でラッパしたものである。 このライブ...
Definition: wire.h:46
void beginTransmission(unsigned char address)
I2Cデバイスに対して送信を開始するための準備をする
int available()
受信バッファ内に溜まっているデータ数を調べる
Renesas RX62N/63N用のArduino互換ライブラリ
void assignSdaScl(int sda_pin, int scl_pin)
SDA,SCLピンの割り当て任意のピンに変更する
TwoWire()
コンストラクタ。Wireクラスのオブジェクトを作成する。
バージョン情報構造体
Definition: tkdn_version.h:31