-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlcNano.h
61 lines (52 loc) · 1.14 KB
/
PlcNano.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
#if !defined(__PLCNANO_HPP__)
#define __PLCNANO_HPP__
#include "Arduino.h"
#include "PlcNanoDigitalOut.hpp"
#include <Adafruit_PCF8574.h>
class PlcNano
{
private:
struct PlcNanoHwIo
{
PlcNanoHwIo(uint8_t pinO0) : PinO0(pinO0)
{
}
PlcNanoDigitalOut PinO0;
};
public:
/**
* @brief begin low level structures.
*/
static void begin(void)
{
getInstance().bBegin();
}
/**
* @brief Get the Pin object
* @return PlcNanoHwIo const& option pins.
*/
static PlcNanoHwIo const& getPin(void)
{
return getInstance().m_plcNanoHwIo;
}
private:
/**
* @brief Get the Instance object
* @return PlcNano const& reference.
*/
static PlcNano const& getInstance(void)
{
static PlcNano const instance;
return instance;
}
/**
* @brief Begins lower level peripherals for PLC Nano.
* @return true if succeed, false otherwise.
*/
bool bBegin(void);
PlcNano() : m_plcNanoHwIo(0) {}
~PlcNano() {}
Adafruit_PCF8574 m_pcf;
PlcNanoHwIo const m_plcNanoHwIo;
};
#endif // __PLCNANO_HPP__