blob: 8ea23c3bdd0bebc9bcad8f36b0a73ab2bc5512a5 (
plain)
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
|
/*
* PortControl.h
*
* Created on: 15 Jun 2017
* Author: David
*/
#ifndef SRC_PORTCONTROL_H_
#define SRC_PORTCONTROL_H_
#include "RepRapFirmware.h"
#include "Hardware/IoPorts.h"
class GCodeBuffer;
#if SUPPORT_IOBITS
class PortControl
{
public:
PortControl() noexcept;
void Init() noexcept;
void Exit() noexcept;
uint32_t UpdatePorts() noexcept;
bool Configure(GCodeBuffer& gb, const StringRef& reply);
private:
void UpdatePorts(IoBits_t newPortState) noexcept;
static const size_t MaxPorts = 16; // the port bitmap is currently a 16-bit word
IoPort portMap[MaxPorts];
size_t numConfiguredPorts;
unsigned int advanceMillis;
uint32_t advanceClocks;
IoBits_t currentPortState;
};
#endif
#endif /* SRC_PORTCONTROL_H_ */
|