ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
onboard_led.hpp
Go to the documentation of this file.
1
10#ifndef TEMPLATE_BOARD_LED_HPP
11#define TEMPLATE_BOARD_LED_HPP
12
13#include <memory>
14
15#include "non_copyable.hpp"
16namespace c7222 {
17
35 public:
40
47 bool Initialize();
52 void Set(bool on);
56 void On();
60 void Off();
64 void Toggle();
70 ~OnBoardLED() = default;
71 private:
75 OnBoardLED();
77 static std::unique_ptr<OnBoardLED> instance_;
79 bool initialized_{false};
81 bool state_{false};
82};
83
84} // namespace c7222
85
86#endif // TEMPLATE_BOARD_LED_HPP
Disable both copy and move operations.
Definition non_copyable.hpp:75
Simple on-board LED controller.
Definition onboard_led.hpp:34
~OnBoardLED()=default
Destructor.
void Set(bool on)
Set the LED state.
bool Initialize()
Initialize the on-board LED hardware.
static OnBoardLED * GetInstance()
Get the singleton instance.
void On()
Turn the LED on.
void Off()
Turn the LED off.
void Toggle()
Toggle the LED state.
C7222 course abstractions namespace.
Definition ble.hpp:20
Base classes to control copy/move semantics.