123456789101112131415161718192021222324252627 |
- #pragma once
- // uint8_t
- #include <stdint.h>
- enum LedState {
- LS_Off = 0,
- LS_On = 1,
- };
- constexpr LedState operator~(LedState const state) noexcept {
- return state == LS_On ? LS_Off : LS_On;
- }
- class Led final {
- public:
- explicit Led(uint8_t pin);
- void init() noexcept;
- void setState(LedState state) noexcept;
- LedState getState() const noexcept;
- void toggleState() noexcept;
- private:
- uint8_t pin_;
- };
|