-
Notifications
You must be signed in to change notification settings - Fork 0
/
ABTPort.h
73 lines (50 loc) · 995 Bytes
/
ABTPort.h
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
/**
* \class ABTPort
* \brief Port Mapping for RJ25
* @file ABTPort.h
* @author ANTBOT
* @version V1.0.1
* @date 2017/09/10
* @brief Header for ABTPort.cpp module
*/
#ifndef ABTPORT_H_
#define ABTPORT_H_
#include <Arduino.h>
/**
* A structure to represent MePort Signal.
*/
typedef struct
{
uint8_t s1;
uint8_t s2;
} ABTPorts;
extern ABTPorts _abtPort[6]; //
#define PORT_1 (0x00)
#define PORT_2 (0x01)
#define PORT_3 (0x02)
#define PORT_4 (0x03)
#define PORT_5 (0x04)
#define PORT_6 (0x05)
#define FALSE (0)
#define TRUE (1)
class ABTPort
{
public:
ABTPort(void);
ABTPort(unsigned char port);
bool dRead1(void);
bool dRead2(void);
void dWrite1(bool value);
void dWrite2(bool value);
int aRead1(void);
int aRead2(void);
void aWrite1(int value);
void aWrite2(int value);
unsigned char pin1(void);
unsigned char pin2(void);
protected:
unsigned char s1;
unsigned char s2;
unsigned char _port;
};
#endif