-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlcNanoDigitalOut.hpp
47 lines (38 loc) · 934 Bytes
/
PlcNanoDigitalOut.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
#if !defined(__PLCNANODIGITALOUTPUT_HPP__)
#define __PLCNANODIGITALOUTPUT_HPP__
#include <stdint.h>
#include <Adafruit_PCF8574.h>
class PlcNanoDigitalOut
{
static Adafruit_PCF8574 const * pPcf;
public:
/**
* @brief Initialize pcf pointer so it can
* be used across different functions.
*
* @param pcf pointer
* @return true if succeeded, false otherwise.
*/
static bool begin(Adafruit_PCF8574 const * const pcf);
/**
* @brief Sets the ouput pin.
*/
void set(void);
/**
* @brief Resets the ouput pin.
*/
void reset(void);
/**
* @brief Toggle the ouput pin.
*/
void toggle(void);
/**
* @brief Construct a new Plc Nano Digital Out object
* @param pin number
*/
PlcNanoDigitalOut(uint8_t const pin);
~PlcNanoDigitalOut();
private:
uint8_t const m_pin;
};
#endif // __PLCNANODIGITALOUTPUT_HPP__