- メインページ
- ネームスペース
- クラス
- ファイル

- ファイル一覧
- ファイルメンバ

# ad7998.cpp

## 説明

AD7998, AD7997制御プログラム

ad7998::initAndStartで変換を開始し、以後変換を続ける。 変換した値は ad7998::getValueで取得できる。

ad7998.cpp で定義されています。

`#include "ad7998.h"`
`#include "twi.h"`
`#include <ccblkfn.h>`

ソースコードを見る。

## ネームスペース
namespace | ad7998
## 関数
void | ad7998::callBack (bool rcv)
| コールバック関数
void | ad7998::init (void)
| AD7998 初期化
void | ad7998::start (void)
| AD7998 変換開始
shortfract | ad7998::getValue (adcChannel vin)
| AD7998から取得したデータを獲得
## 変数
const unsigned int | ad7998::CRR = 0
| Conversion Result Register (Read)
const unsigned int | ad7998::ASR = 1
| Alert Status Register (Read/Write)
const unsigned int | ad7998::CR = 2
| Configuration Register (Read/Write)
const unsigned int | ad7998::CTR = 3
| Cycle Timer Register (Read/Write)
const unsigned int | ad7998::DLR1 = 4
| DATALOW Reg CH1 (Read/Write)
const unsigned int | ad7998::DHR1 = 5
| DATAHIGH Reg CH1 (Read/Write)
const unsigned int | ad7998::HR1 = 6
| Hysteresis Reg CH1 (Read/Write)
const unsigned int | ad7998::DLR2 = 7
| DATALOW Reg CH2 (Read/Write)
const unsigned int | ad7998::DHR2 = 8
| DATAHIGH Reg CH2 (Read/Write)
const unsigned int | ad7998::HR2 = 9
| Hysteresis Reg CH2 (Read/Write)
const unsigned int | ad7998::DLR3 = 10
| DATALOW Reg CH3 (Read/Write)
const unsigned int | ad7998::DHR3 = 11
| DATAHIGH Reg CH3 (Read/Write)
const unsigned int | ad7998::HR3 = 12
| Hysteresis Reg CH3 (Read/Write)
const unsigned int | ad7998::DLR4 = 13
| DATALOW Reg CH4 (Read/Write)
const unsigned int | ad7998::DHR4 = 14
| DATAHIGH Reg CH4 (Read/Write)
const unsigned int | ad7998::HR4 = 15
| Hysteresis Reg CH4 (Read/Write)
const unsigned int | ad7998::ch1 = 0x0010
| ad7998::CRのチャンネル指定用。Vin1
const unsigned int | ad7998::ch2 = 0x0020
| ad7998::CRのチャンネル指定用。Vin2
const unsigned int | ad7998::ch3 = 0x0040
| ad7998::CRのチャンネル指定用。Vin3
const unsigned int | ad7998::ch4 = 0x0080
| ad7998::CRのチャンネル指定用。Vin4
const unsigned int | ad7998::ch5 = 0x0100
| ad7998::CRのチャンネル指定用。Vin5
const unsigned int | ad7998::ch6 = 0x0200
| ad7998::CRのチャンネル指定用。Vin6
const unsigned int | ad7998::ch7 = 0x0400
| ad7998::CRのチャンネル指定用。Vin7
const unsigned int | ad7998::ch8 = 0x0800
| ad7998::CRのチャンネル指定用。Vin8
const unsigned int | ad7998::fltr = 0x0008
| ad7998::CRの設定用。フィルタを使う
const unsigned int | ad7998::VinSeq = 0x70
| Mode2コマンド。 ad7998::CRで指定した入力からデータを連続取得
const int | ad7998::AD7998 = 0x20
| AD7997デバイスアドレス
const int | ad7998::initLen = 3
| 初期化文字列の長さ
const int | ad7998::cmdLen = 1
| コマンド文字列の長さ
const unsigned char | ad7998::initAD7998Str [initLen] = { ad7998::CR , 0x0F, 0xF0 | ad7998::fltr }
| AD7998初期化文字列
const unsigned char | ad7998::cmdAD7998Read [cmdLen] = { ad7998::VinSeq }
| AD7998コマンド文字列
const int | ad7998::chNum = 8
| ADCチャンネル数
unsigned char | ad7998::rxBuffer [chNum *2] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
| データ受信バッファ
unsigned char | ad7998::rxValue [chNum *2]
| データ受信バッファ