APM:Libraries
Led_Sysfs.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 Emlid Ltd. All rights reserved.
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #include <AP_HAL/AP_HAL.h>
18 
19 #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
20 #include "Led_Sysfs.h"
21 
22 #include <AP_HAL_Linux/Led_Sysfs.h>
23 
24 Led_Sysfs::Led_Sysfs(const char *red, const char *green, const char *blue,
25  uint8_t off_brightness, uint8_t low_brightness, uint8_t medium_brightness, uint8_t high_brightness):
26  RGBLed(off_brightness, high_brightness, medium_brightness, low_brightness),
27  red_led(red),
28  green_led(green),
29  blue_led(blue)
30 {
31 }
32 
34 {
35  if (red_led.init() && green_led.init() && blue_led.init()) {
36  return true;
37  }
38 
39  return false;
40 }
41 
42 bool Led_Sysfs::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
43 {
47 
48  return true;
49 }
50 #endif
Definition: RGBLed.h:25
bool set_brightness(uint8_t brightness)
Definition: Led_Sysfs.cpp:76
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override
Definition: Led_Sysfs.cpp:42
bool hw_init(void) override
Definition: Led_Sysfs.cpp:33
Linux::Led_Sysfs blue_led
Definition: Led_Sysfs.h:40
Linux::Led_Sysfs red_led
Definition: Led_Sysfs.h:38
Linux::Led_Sysfs green_led
Definition: Led_Sysfs.h:39
Led_Sysfs(const char *red, const char *green, const char *blue, uint8_t off_brightness=0xff, uint8_t low_brightness=0x00, uint8_t medium_brightness=0x00, uint8_t high_brightness=0x00)
Definition: Led_Sysfs.cpp:24