APM:Libraries
Led_Sysfs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 Mathieu Othacehe. 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 #include "AP_HAL_Linux.h"
22 #include "Util.h"
23 
24 namespace Linux {
25 
26 class Led_Sysfs {
27 public:
28  bool init();
29  bool set_brightness(uint8_t brightness);
30 
31  Led_Sysfs(const char* led_name);
32  ~Led_Sysfs();
33 
34 private:
35  int _brightness_fd = -1;
36  int _max_brightness = 0;
37  const char *_led_name = nullptr;
38 };
39 
40 }
bool set_brightness(uint8_t brightness)
Definition: Led_Sysfs.cpp:76
const char * _led_name
Definition: Led_Sysfs.h:37
Led_Sysfs(const char *led_name)
Definition: Led_Sysfs.cpp:33