REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
leds.cpp
Go to the documentation of this file.
1
2#include "native/leds.h"
3
5
6bool platform::NativeLEDs::set(const uint8_t led, bool on) {
7 if (led > 7)
8 return false;
9
10 if (on)
11 led_states |= (1 << led);
12 else
13 led_states &= ~(1 << led);
14
15 return true;
16}
17
18void platform::NativeLEDs::set_all(const uint8_t states) { led_states = states; }
19
20void platform::NativeLEDs::reset() { led_states = 0; }
21
22uint8_t platform::NativeLEDs::get_all() const { return led_states; }
23
24utils::status platform::NativeLEDs::write_to_hardware() const { return utils::status::success(); }
uint8_t get_all() const override
Returns the current state of the front leds.
Definition leds.cpp:22
bool set(const uint8_t led, bool on) override
Sets specified front led to the specified value.
Definition leds.cpp:6
utils::status write_to_hardware() const override
Definition leds.cpp:24
void set_all(const uint8_t states) override
Sets all eight front leds at once.
Definition leds.cpp:18
void reset() override
Disables all eight front leds.
Definition leds.cpp:20