ARCS6 AR6-REV.24062600
読み取り中…
検索中…
一致する文字列を見つけられません
PCI-46610x.hh
[詳解]
1
9//
10// Copyright (C) 2011-2021 Yokokura, Yuki
11// This program is free software;
12// you can redistribute it and/or modify it under the terms of the FreeBSD License.
13// For details, see the License.txt file.
14
15#ifndef PCI_46610X
16#define PCI_46610X
17
18#include <stdint.h>
19#include <string>
20
21namespace ARCS { // ARCS名前空間
23 class PCI46610x {
24 public:
25 explicit PCI46610x(unsigned long Addr0);
26 PCI46610x(PCI46610x&& right);
27 ~PCI46610x();
28
34
36 enum Wire {
39 };
40
47
53
61
62 static const std::string STR_CR;
63 static const std::string STR_LF;
64
65 void SetConfig(
66 enum BaudRate rate, enum Wire wir, enum Parity par,
67 enum StopBit stpbit, enum WordLength wlen
68 );
69 void SetTransData(uint8_t TxData);
70 uint8_t GetRecvData(void) const;
71 void GetAllRecvData(std::string& RxData) const;
72 unsigned int GetReceiveCount(void) const;
73 void ClearFIFOMemory(void);
74 void ClearAllSettings(void);
75
76 private:
77 PCI46610x(const PCI46610x&) = delete;
78 const PCI46610x& operator=(const PCI46610x&) = delete;
79 static constexpr int IOREG_SIZE = 64;
80 static constexpr unsigned int ADDR_HOLDREG = 0x00;
81 static constexpr unsigned int ADDR_FIFO_CTRL = 0x02;
82 static constexpr unsigned int ADDR_LINE_CTRL = 0x03;
83 static constexpr unsigned int ADDR_LINE_STATUS = 0x05;
84 static constexpr unsigned int ADDR_RXFIFO_CNT_LO = 0x10;
85 static constexpr unsigned int ADDR_RXFIFO_CNT_HI = 0x11;
86 static constexpr unsigned int ADDR_BASECLOCK = 0x20;
87 static constexpr unsigned int ADDR_RESET_REG = 0x21;
88 static constexpr unsigned int ADDR_PRESCALER_DLL = 0x28;
89 static constexpr unsigned int ADDR_PRESCALER_DLM = 0x29;
90 static constexpr unsigned int ADDR_DRIVE_CTRL = 0x30;
91 int fd;
92 uint8_t* IOptr;
93 unsigned long ADDR_BASE;
94 };
95}
96
97#endif
98
PCI-466102~466108用クラス(RS485/422シリアル通信ボード)
Definition PCI-46610x.hh:23
BaudRate
ボーレートの定義
Definition PCI-46610x.hh:30
@ RATE_921_6kbps
921.6kbps
Definition PCI-46610x.hh:32
@ RATE_2Mbps
2Mbps
Definition PCI-46610x.hh:31
WordLength
ワード長の定義
Definition PCI-46610x.hh:55
@ WORDLENG_5
ワード長 5bit
Definition PCI-46610x.hh:56
@ WORDLENG_8
ワード長 8bit
Definition PCI-46610x.hh:59
@ WORDLENG_6
ワード長 6bit
Definition PCI-46610x.hh:57
@ WORDLENG_7
ワード長 7bit
Definition PCI-46610x.hh:58
uint8_t GetRecvData(void) const
受信データ1byte分を取得する関数
Definition PCI-46610x.cc:188
PCI46610x(unsigned long Addr0)
コンストラクタ
Definition PCI-46610x.cc:29
void SetConfig(enum BaudRate rate, enum Wire wir, enum Parity par, enum StopBit stpbit, enum WordLength wlen)
通信設定の関数
Definition PCI-46610x.cc:63
Parity
パリティの定義
Definition PCI-46610x.hh:42
@ PARITY_EVEN
偶数パリティ
Definition PCI-46610x.hh:45
@ PARITY_DISABLE
パリティ無効
Definition PCI-46610x.hh:43
@ PARITY_ODD
奇数パリティ
Definition PCI-46610x.hh:44
unsigned int GetReceiveCount(void) const
受信カウント数を返す関数
Definition PCI-46610x.cc:206
static const std::string STR_LF
ラインフィード文字のアスキーコードの定義
Definition PCI-46610x.hh:63
void GetAllRecvData(std::string &RxData) const
全受信データを取得する関数
Definition PCI-46610x.cc:194
static const std::string STR_CR
キャリッジリターン文字のアスキーコードの定義
Definition PCI-46610x.hh:62
void SetTransData(uint8_t TxData)
送信データ1byte分をセットする関数
Definition PCI-46610x.cc:182
~PCI46610x()
デストラクタ
Definition PCI-46610x.cc:56
Wire
2線式/4線式の定義
Definition PCI-46610x.hh:36
@ WIRE_4
4線式
Definition PCI-46610x.hh:38
@ WIRE_2
2線式
Definition PCI-46610x.hh:37
StopBit
ストップビットの定義
Definition PCI-46610x.hh:49
@ STOPBIT_1
ストップビット1
Definition PCI-46610x.hh:50
@ STOPBIT_2
ストップビット2
Definition PCI-46610x.hh:51
void ClearAllSettings(void)
すべての設定レジスタをクリアする関数
Definition PCI-46610x.cc:220
void ClearFIFOMemory(void)
送受信FIFOメモリをクリアする関数
Definition PCI-46610x.cc:213