FastLED
3.9.15
Loading...
Searching...
No Matches
digital_pin.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
stdint.h
>
4
5
#include "
fl/ptr.h
"
6
7
8
namespace
fl
{
9
10
FASTLED_SMART_PTR
(
DigitalPinImpl
);
11
12
13
// A simple digital pin. If we are compiling in an Arduino environment, then
14
// this class will bind to that. Otherwise it will fall back to the platform api.
15
// Note that this class does not support analog mode nor pullups/pulldowns.
16
class
DigitalPin
{
17
public
:
18
enum
Mode
{
19
kInput
= 0,
20
kOutput
,
21
kInputPullup
,
22
// kInputPulldown, Not implemented in Arduino.h
23
};
24
25
DigitalPin
(
int
pin);
26
~DigitalPin
();
27
DigitalPin
(
const
DigitalPin
&other);
28
DigitalPin
&
operator=
(
const
DigitalPin
&other);
29
30
DigitalPin
(
DigitalPin
&&other) =
delete
;
31
32
void
setPinMode
(
Mode
mode);
33
bool
high
()
const
;
// true if high, false if low
34
void
write
(
bool
is_high);
35
private
:
36
DigitalPinImplPtr
mImpl
;
37
};
38
39
}
// namespace fl
fl::DigitalPin::~DigitalPin
~DigitalPin()
fl::DigitalPin::write
void write(bool is_high)
Definition
digital_pin.cpp:102
fl::DigitalPin::DigitalPin
DigitalPin(DigitalPin &&other)=delete
fl::DigitalPin::Mode
Mode
Definition
digital_pin.h:18
fl::DigitalPin::kInput
@ kInput
Definition
digital_pin.h:19
fl::DigitalPin::kOutput
@ kOutput
Definition
digital_pin.h:20
fl::DigitalPin::kInputPullup
@ kInputPullup
Definition
digital_pin.h:21
fl::DigitalPin::setPinMode
void setPinMode(Mode mode)
Definition
digital_pin.cpp:94
fl::DigitalPin::operator=
DigitalPin & operator=(const DigitalPin &other)
fl::DigitalPin::mImpl
DigitalPinImplPtr mImpl
Definition
digital_pin.h:36
fl::DigitalPin::high
bool high() const
Definition
digital_pin.cpp:98
fl::DigitalPin::DigitalPin
DigitalPin(int pin)
Definition
digital_pin.cpp:86
fl::DigitalPin::DigitalPin
DigitalPin(const DigitalPin &other)
fl::DigitalPinImpl
Definition
digital_pin.cpp:59
fl
Implements a simple red square effect for 2D LED grids.
Definition
crgb.h:16
FASTLED_SMART_PTR
#define FASTLED_SMART_PTR(type)
Definition
ptr.h:31
ptr.h
stdint.h
sensors
digital_pin.h
Generated on Tue Jun 24 2025 00:58:14 for FastLED by
1.13.2