Firmware
commander_helper.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
42 #ifndef COMMANDER_HELPER_H_
43 #define COMMANDER_HELPER_H_
44 
45 #include <uORB/uORB.h>
46 #include <uORB/topics/vehicle_status.h>
47 #include <uORB/topics/actuator_armed.h>
48 #include <uORB/topics/vehicle_control_mode.h>
49 #include <drivers/drv_led.h>
50 #include <drivers/drv_board_led.h>
51 
52 
53 bool is_multirotor(const struct vehicle_status_s *current_status);
54 bool is_rotary_wing(const struct vehicle_status_s *current_status);
55 bool is_vtol(const struct vehicle_status_s *current_status);
56 
57 int buzzer_init(void);
58 void buzzer_deinit(void);
59 
60 void set_tune_override(int tune);
61 void set_tune(int tune);
62 void tune_home_set(bool use_buzzer);
63 void tune_mission_ok(bool use_buzzer);
64 void tune_mission_fail(bool use_buzzer);
65 void tune_positive(bool use_buzzer);
66 void tune_neutral(bool use_buzzer);
67 void tune_negative(bool use_buzzer);
68 void tune_failsafe(bool use_buzzer);
69 
70 int blink_msg_state();
71 
72 /* methods to control the onboard LED(s) */
73 int led_init(void);
74 void led_deinit(void);
75 int led_toggle(int led);
76 int led_on(int led);
77 int led_off(int led);
78 
84 void rgbled_set_color_and_mode(uint8_t color, uint8_t mode);
85 
86 void rgbled_set_color_and_mode(uint8_t color, uint8_t mode, uint8_t blinks, uint8_t prio);
87 
88 #endif /* COMMANDER_HELPER_H_ */
LED driver API to control the onboard LED(s) via ioctl() interface.
int led_init(void)
Ideally we&#39;d be able to get these from up_internal.h, but since we want to be able to disable the Nut...
Definition: led.c:63
void tune_neutral(bool use_buzzer)
Blink white LED and play neutral tune (if use_buzzer == true).
Definition: commander_helper.cpp:226
void tune_positive(bool use_buzzer)
Blink green LED and play positive tune (if use_buzzer == true).
Definition: commander_helper.cpp:213
Led device API to control the external LED(s) via uORB interface.
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode)
set the LED color & mode
Definition: commander_helper.cpp:343
API for the uORB lightweight object broker.
void tune_negative(bool use_buzzer)
Blink red LED and play negative tune (if use_buzzer == true).
Definition: commander_helper.cpp:239