ArdEV3
Use EV3 peripherals from Arduino microcontrollers.
Loading...
Searching...
No Matches
EV3Peripheral.h
1#pragma once
2
3#define EV3_PERIPHERAL_CONSTRUCT(cls) cls(cls##PortConfig ports) : Peripheral(ports) {}
4
5namespace ev3 {
6namespace _ {
7
8template <class PortConfig>
9class Peripheral {
10protected:
11 PortConfig ports;
12public:
13 Peripheral(PortConfig ports) : ports(ports) {}
14
15 auto Ports() -> PortConfig const& {return ports;}
16
17 virtual void Setup() {}
18 virtual void Loop() {}
19};
20
21}
22}
Peripheral(PortConfig ports)
Initialize this peripheral from the specified port configuration.
Definition EV3Peripheral.h:13
auto Ports() -> PortConfig const &
Get the port configuration for this peripheral.
Definition EV3Peripheral.h:15