APM:Libraries
Led_Sysfs.h
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 #pragma once
18 
19 #include <AP_HAL/AP_HAL.h>
20 
21 #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
22 #include <AP_HAL_Linux/Led_Sysfs.h>
23 
24 #include "RGBLed.h"
25 
26 class Led_Sysfs: public RGBLed
27 {
28 public:
29  Led_Sysfs(const char *red, const char *green, const char *blue,
30  uint8_t off_brightness = 0xff , uint8_t low_brightness = 0x00,
31  uint8_t medium_brightness = 0x00, uint8_t high_brightness = 0x00);
32 
33 protected:
34  bool hw_init(void) override;
35  bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
36 
37 private:
41 };
42 #endif
uint8_t b
Definition: RGBLed.h:67
Definition: RGBLed.h:25
uint8_t g
Definition: RGBLed.h:67
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override
Definition: Led_Sysfs.cpp:42
uint8_t r
Definition: RGBLed.h:67
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