-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperator.h
More file actions
61 lines (47 loc) · 3.39 KB
/
operator.h
File metadata and controls
61 lines (47 loc) · 3.39 KB
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
/********************************************************************/
/* Description: オペレータ入出力の初期設定および状態取得 */
/* File: operator.h */
/* Date: 2024/07/21 */
/* Author: Takashi YOSHIOKA */
/********************************************************************/
/********************************************************************/
/* 多重インクルード防止 */
/********************************************************************/
#ifndef _OPERATOR_H_
#define _OPERATOR_H_
/********************************************************************/
/* ヘッダファイルのインクルード */
/********************************************************************/
#include <Arduino.h>
/********************************************************************/
/* マクロ定義 */
/********************************************************************/
#define OPR_INV_ON (R_PFS->PORT[0].PIN[4].PmnPFS_b) // invOnのピンアサイン: P004
#define OPR_INV_OFF (R_PFS->PORT[0].PIN[5].PmnPFS_b) // invOffのピンアサイン:P005
#define OPR_INV_RST (R_PFS->PORT[0].PIN[6].PmnPFS_b) // invRstのピンアサイン:P006
#define OPR_RUN_MON (R_PFS->PORT[0].PIN[11].PmnPFS_b) // runMonのピンアサイン:P011
#define OPR_RUN_MON_PODR (R_PORT0->PODR_b.PODR11) // runMonのピンアサイン:P011 (ロック解除しないとPFSへの書き込みができないため,解除不要のエイリアスを設定)
#define OPR_ERR_MON (R_PFS->PORT[0].PIN[12].PmnPFS_b) // errMonのピンアサイン:P012
#define OPR_ERR_MON_PODR (R_PORT0->PODR_b.PODR12) // errMonのピンアサイン:P012 (ロック解除しないとPFSへの書き込みができないため,解除不要のエイリアスを設定)
#define OPR_REFIN (R_PFS->PORT[0].PIN[0].PmnPFS_b) // refInのピンアサイン: P000
/********************************************************************/
/* オペレータ入出力状態構造体の定義 */
/********************************************************************/
typedef struct {
uint8_t invOn : 1; // オペレータ入力 INV_ONフラグ (正論理)
uint8_t invOff : 1; // オペレータ入力 INV_OFFフラグ (正論理)
uint8_t invRst : 1; // オペレータ入力 INV_RSTフラグ (正論理)
uint8_t invErr : 1; // インバータ入力 INV_ERRフラグ (正論理)
uint8_t runMon : 1; // オペレータ出力 RUN_MONフラグ (正論理)
uint8_t errMon : 1; // オペレータ出力 ERR_MONフラグ (正論理)
uint8_t : 2; // for bit alignment
uint8_t dummyByte; // for byte alignment
int16_t refIn; // オペレータから入力されるアナログVR信号 (0~1023)
}oprSts_t;
/********************************************************************/
/* 外部公開関数のプロトタイプ宣言 */
/********************************************************************/
void setup_operator(void);
void get_opr_status(oprSts_t *oprStsArg);
void set_opr_status(oprSts_t *oprStsArg);
#endif /* END _OPERATOR_H_ */