ArdEV3
Use EV3 peripherals from Arduino microcontrollers.
Toggle main menu visibility
Loading...
Searching...
No Matches
EV3Peripheral.h
1
#pragma once
2
3
#define EV3_PERIPHERAL_CONSTRUCT(cls) cls(cls##PortConfig ports) : Peripheral(ports) {}
4
5
namespace
ev3 {
6
namespace
_ {
7
8
template
<
class
PortConfig>
9
class
Peripheral
{
10
protected
:
11
PortConfig ports;
12
public
:
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
}
ev3::_::Peripheral::Peripheral
Peripheral(PortConfig ports)
Initialize this peripheral from the specified port configuration.
Definition
EV3Peripheral.h:13
ev3::_::Peripheral::Ports
auto Ports() -> PortConfig const &
Get the port configuration for this peripheral.
Definition
EV3Peripheral.h:15
src
EV3Peripheral.h
Generated by
1.17.0