-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsci_io_base.hpp
82 lines (75 loc) · 3.04 KB
/
sci_io_base.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once
//=========================================================================//
/*! @file
@brief RX グループ・SCI I/O 制御ベースクラス @n
SCI I/O、SCIF I/O、RSCI I/O 共通定義
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 2023 Kunihito Hiramatsu @n
Released under the MIT license @n
https://github.com/hirakuni45/RX/blob/master/LICENSE
*/
//=========================================================================//
#include "common/renesas.hpp"
#include "common/vect.h"
namespace device {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief SCI/SCIF/RSCI I/O ベース・クラス
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
class sci_io_base {
public:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 通信プロトコル型
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
enum class PROTOCOL : uint8_t {
B7_N_1S, ///< 7 ビット、No-Parity、 1 Stop Bit
B7_E_1S, ///< 7 ビット、Even(偶数)、1 Stop Bit
B7_O_1S, ///< 7 ビット、Odd (奇数)、1 Stop Bit
B7_N_2S, ///< 7 ビット、No-Parity、 2 Stop Bits
B7_E_2S, ///< 7 ビット、Even(偶数)、2 Stop Bits
B7_O_2S, ///< 7 ビット、Odd (奇数)、2 Stop Bits
B8_N_1S, ///< 8 ビット、No-Parity、 1 Stop Bit
B8_E_1S, ///< 8 ビット、Even(偶数)、1 Stop Bit
B8_O_1S, ///< 8 ビット、Odd (奇数)、1 Stop Bit
B8_N_2S, ///< 8 ビット、No-Parity、 2 Stop Bits
B8_E_2S, ///< 8 ビット、Even(偶数)、2 Stop Bits
B8_O_2S, ///< 8 ビット、Odd (奇数)、2 Stop Bits
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief ボーレート型(シリアル通信で標準的に指定する定型値)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
enum class BAUDRATE : uint32_t {
B110 = 110, ///< 110 B.P.S.
B150 = 150, ///< 150 B.P.S.
B300 = 300, ///< 300 B.P.S.
B600 = 600, ///< 600 B.P.S.
B1200 = 1200, ///< 1200 B.P.S.
B2400 = 2400, ///< 2400 B.P.S.
B4800 = 4800, ///< 4800 B.P.S.
B9600 = 9600, ///< 9600 B.P.S.
B19200 = 19200, ///< 19200 B.P.S.
B38400 = 38400, ///< 38400 B.P.S.
B57600 = 57600, ///< 57600 B.P.S.
B76800 = 76800, ///< 76800 B.P.S.
B96000 = 96000, ///< 96000 B.P.S.
B115200 = 115200, ///< 115200 B.P.S.
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief フロー制御型
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
enum class FLOW_CTRL : uint8_t {
NONE, ///< フロー制御をしない
SOFT, ///< ソフトフロー制御
HARD, ///< ハードフロー制御(RTS ポートを使う)
SOFT_HARD, ///< ソフトフローとハードフロー制御
RS485, ///< ポートを使い、RS485 レシーバーの DE を制御(送信時「1」となる)
};
};
}