PX4 Firmware
PX4 Autopilot Software http://px4.io
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 
34 /**
35  * @file commander_helper.h
36  * Commander helper functions definitions
37  *
38  * @author Thomas Gubler <thomasgubler@student.ethz.ch>
39  * @author Julian Oes <julian@oes.ch>
40  */
41 
42 #ifndef COMMANDER_HELPER_H_
43 #define COMMANDER_HELPER_H_
44 
45 #include <uORB/uORB.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 bool is_vtol_tailsitter(const struct vehicle_status_s *current_status);
57 bool is_fixed_wing(const struct vehicle_status_s *current_status);
58 bool is_ground_rover(const struct vehicle_status_s *current_status);
59 
60 int buzzer_init(void);
61 void buzzer_deinit(void);
62 
63 void set_tune_override(int tune);
64 void set_tune(int tune);
65 void tune_home_set(bool use_buzzer);
66 void tune_mission_ok(bool use_buzzer);
67 void tune_mission_fail(bool use_buzzer);
68 void tune_positive(bool use_buzzer);
69 void tune_neutral(bool use_buzzer);
70 void tune_negative(bool use_buzzer);
71 void tune_failsafe(bool use_buzzer);
72 
73 int blink_msg_state();
74 
75 /* methods to control the onboard LED(s) */
76 int led_init(void);
77 void led_deinit(void);
78 int led_toggle(int led);
79 int led_on(int led);
80 int led_off(int led);
81 
82 /**
83  * set the LED color & mode
84  * @param color @see led_control_s::COLOR_*
85  * @param mode @see led_control_s::MODE_*
86  */
87 void rgbled_set_color_and_mode(uint8_t color, uint8_t mode);
88 
89 void rgbled_set_color_and_mode(uint8_t color, uint8_t mode, uint8_t blinks, uint8_t prio);
90 
91 #endif /* COMMANDER_HELPER_H_ */
int buzzer_init(void)
bool is_multirotor(const struct vehicle_status_s *current_status)
bool is_fixed_wing(const struct vehicle_status_s *current_status)
void set_tune(int tune)
API for the uORB lightweight object broker.
void tune_failsafe(bool use_buzzer)
int led_off(int led)
LED driver API to control the onboard LED(s) via ioctl() interface.
bool is_vtol(const struct vehicle_status_s *current_status)
int led_toggle(int led)
void set_tune_override(int tune)
int led_init(void)
void tune_neutral(bool use_buzzer)
Blink white LED and play neutral tune (if use_buzzer == true).
void buzzer_deinit(void)
void tune_positive(bool use_buzzer)
Blink green LED and play positive tune (if use_buzzer == true).
Led device API to control the external LED(s) via uORB interface.
bool is_vtol_tailsitter(const struct vehicle_status_s *current_status)
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode)
set the LED color & mode
void tune_negative(bool use_buzzer)
Blink red LED and play negative tune (if use_buzzer == true).
bool is_rotary_wing(const struct vehicle_status_s *current_status)
void tune_mission_fail(bool use_buzzer)
int blink_msg_state()
void led_deinit(void)
void tune_mission_ok(bool use_buzzer)
bool is_ground_rover(const struct vehicle_status_s *current_status)
void tune_home_set(bool use_buzzer)
int led_on(int led)
mode
Definition: vtol_type.h:76