FastLED 3.10.8
Loading...
Searching...
No Matches
digital_pin.cpp.hpp
Go to the documentation of this file.
1
2#include "fl/stl/stdint.h"
3
4#include "fl/ui/ui.h"
5#include "fl/stl/shared_ptr.h" // For make_shared
6
8
9// Include fl/pin.h for pin API (includes platform implementations)
10#include "fl/system/pin.h"
11#include "fl/stl/noexcept.h"
12
13namespace fl {
14
16 public:
17 DigitalPinImpl(int pin) FL_NO_EXCEPT : mPin(pin) {}
19
22 switch (mode) {
25 break;
28 break;
31 break;
34 break;
35 default:
36 return;
37 }
39 }
40
44
48
49 private:
50 int mPin;
51};
52
53
58DigitalPin::DigitalPin(const DigitalPin &other) FL_NO_EXCEPT = default;
59
60DigitalPin& DigitalPin::operator=(const DigitalPin &other) FL_NO_EXCEPT = default;
61
63 mImpl->setPinMode(mode);
64}
65
67 return mImpl->high();
68}
69
70void DigitalPin::write(bool is_high) FL_NO_EXCEPT {
71 mImpl->write(is_high);
72}
73
74} // namespace fl
DigitalPin(int pin) FL_NO_EXCEPT
bool high() const FL_NO_EXCEPT
~DigitalPin() FL_NO_EXCEPT
DigitalPinImplPtr mImpl
Definition digital_pin.h:33
void write(bool is_high) FL_NO_EXCEPT
void setPinMode(Mode mode) FL_NO_EXCEPT
void setPinMode(DigitalPin::Mode mode) FL_NO_EXCEPT
void write(bool value) FL_NO_EXCEPT
DigitalPinImpl(int pin) FL_NO_EXCEPT
bool high() FL_NO_EXCEPT
~DigitalPinImpl() FL_NO_EXCEPT=default
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
constexpr int type_rank< T >::value
@ Low
Logic low (0V / GND)
Definition pin.h:51
@ High
Logic high (3.3V / 5V, platform-dependent)
Definition pin.h:52
void digitalWrite(int pin, PinValue val) FL_NO_EXCEPT
Write digital value to pin.
Definition pin.cpp.hpp:51
PinValue digitalRead(int pin) FL_NO_EXCEPT
Read digital value from pin.
Definition pin.cpp.hpp:55
PinMode
Pin mode configuration.
Definition pin.h:42
@ Output
Digital output (push-pull)
Definition pin.h:44
@ Input
Digital input (high impedance)
Definition pin.h:43
@ InputPullup
Digital input with internal pull-up resistor.
Definition pin.h:45
@ InputPulldown
Digital input with internal pull-down resistor.
Definition pin.h:46
void pinMode(int pin, PinMode mode) FL_NO_EXCEPT
Set pin mode (input, output, pull-up, pull-down)
Definition pin.cpp.hpp:394
Base definition for an LED controller.
Aggregator header for the fl/ui/ family of per-element UI types.