APM:Libraries
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
OreoLED_PX4 Class Reference

#include <OreoLED_PX4.h>

Inheritance diagram for OreoLED_PX4:
[legend]
Collaboration diagram for OreoLED_PX4:
[legend]

Classes

struct  oreo_state
 

Public Member Functions

 OreoLED_PX4 (uint8_t theme)
 
bool init (void)
 
void update ()
 
bool healthy () const
 
void handle_led_control (mavlink_message_t *msg)
 
- Public Member Functions inherited from NotifyDevice
virtual ~NotifyDevice ()
 
virtual void handle_play_tune (mavlink_message_t *msg)
 

Private Types

enum  oreoled_mode {
  OREOLED_MODE_NONE, OREOLED_MODE_MACRO, OREOLED_MODE_RGB, OREOLED_MODE_RGB_EXTENDED,
  OREOLED_MODE_SYNC
}
 
enum  Oreo_LED_Theme { OreoLED_Disabled = 0, OreoLED_Aircraft = 1, OreoLED_Automobile = 2 }
 

Private Member Functions

void update_timer (void)
 
void set_rgb (uint8_t instance, uint8_t red, uint8_t green, uint8_t blue)
 
void set_rgb (uint8_t instance, enum oreoled_pattern pattern, uint8_t red, uint8_t green, uint8_t blue)
 
void set_rgb (uint8_t instance, oreoled_pattern pattern, uint8_t red, uint8_t green, uint8_t blue, uint8_t amplitude_red, uint8_t amplitude_green, uint8_t amplitude_blue, uint16_t period, uint16_t phase_offset)
 
void set_macro (uint8_t instance, enum oreoled_macro macro)
 
void send_sync ()
 
bool slow_counter (void)
 
void sync_counter (void)
 
bool mode_firmware_update (void)
 
bool mode_init (void)
 
bool mode_failsafe_radio (void)
 
bool set_standard_colors (void)
 
bool mode_failsafe_batt (void)
 
bool mode_auto_flight (void)
 
bool mode_pilot_flight (void)
 
void clear_state (void)
 

Private Attributes

bool _overall_health
 
int _oreoled_fd
 
bool _send_required
 
volatile bool _state_desired_semaphore
 
oreo_state _state_desired [OREOLED_NUM_LEDS]
 
oreo_state _state_sent [OREOLED_NUM_LEDS]
 
uint8_t _pattern_override
 
uint8_t _oreo_theme
 
uint8_t _rear_color_r = 255
 
uint8_t _rear_color_g = 255
 
uint8_t _rear_color_b = 255
 

Additional Inherited Members

- Public Attributes inherited from NotifyDevice
const AP_NotifypNotify
 

Detailed Description

Definition at line 31 of file OreoLED_PX4.h.

Member Enumeration Documentation

◆ Oreo_LED_Theme

Enumerator
OreoLED_Disabled 
OreoLED_Aircraft 
OreoLED_Automobile 

Definition at line 95 of file OreoLED_PX4.h.

◆ oreoled_mode

Enumerator
OREOLED_MODE_NONE 
OREOLED_MODE_MACRO 
OREOLED_MODE_RGB 
OREOLED_MODE_RGB_EXTENDED 
OREOLED_MODE_SYNC 

Definition at line 86 of file OreoLED_PX4.h.

Constructor & Destructor Documentation

◆ OreoLED_PX4()

OreoLED_PX4::OreoLED_PX4 ( uint8_t  theme)

Definition at line 46 of file OreoLED_PX4.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ clear_state()

void OreoLED_PX4::clear_state ( void  )
private

Definition at line 448 of file OreoLED_PX4.cpp.

Referenced by handle_led_control(), healthy(), OreoLED_PX4::oreo_state::oreo_state(), OreoLED_PX4::oreo_state::send_sync(), OreoLED_PX4::oreo_state::set_macro(), and OreoLED_PX4::oreo_state::set_rgb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_led_control()

void OreoLED_PX4::handle_led_control ( mavlink_message_t *  msg)
virtual

Reimplemented from NotifyDevice.

Definition at line 544 of file OreoLED_PX4.cpp.

Referenced by healthy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ healthy()

bool OreoLED_PX4::healthy ( void  ) const
inline

Definition at line 45 of file OreoLED_PX4.h.

Here is the call graph for this function:

◆ init()

bool OreoLED_PX4::init ( void  )
virtual

Implements NotifyDevice.

Definition at line 65 of file OreoLED_PX4.cpp.

Here is the call graph for this function:

◆ mode_auto_flight()

bool OreoLED_PX4::mode_auto_flight ( void  )
private

Definition at line 254 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mode_failsafe_batt()

bool OreoLED_PX4::mode_failsafe_batt ( void  )
private

Definition at line 221 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mode_failsafe_radio()

bool OreoLED_PX4::mode_failsafe_radio ( void  )
private

Definition at line 180 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mode_firmware_update()

bool OreoLED_PX4::mode_firmware_update ( void  )
private

Definition at line 155 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mode_init()

bool OreoLED_PX4::mode_init ( void  )
private

Definition at line 167 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mode_pilot_flight()

bool OreoLED_PX4::mode_pilot_flight ( void  )
private

Definition at line 291 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_sync()

void OreoLED_PX4::send_sync ( )
private

Definition at line 424 of file OreoLED_PX4.cpp.

Referenced by handle_led_control(), healthy(), and sync_counter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_macro()

void OreoLED_PX4::set_macro ( uint8_t  instance,
enum oreoled_macro  macro 
)
private

Definition at line 392 of file OreoLED_PX4.cpp.

Referenced by handle_led_control(), healthy(), and mode_firmware_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_rgb() [1/3]

void OreoLED_PX4::set_rgb ( uint8_t  instance,
uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
private

Definition at line 327 of file OreoLED_PX4.cpp.

Referenced by handle_led_control(), healthy(), mode_auto_flight(), mode_failsafe_batt(), mode_failsafe_radio(), mode_init(), and mode_pilot_flight().

Here is the caller graph for this function:

◆ set_rgb() [2/3]

void OreoLED_PX4::set_rgb ( uint8_t  instance,
enum oreoled_pattern  pattern,
uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
private

Definition at line 334 of file OreoLED_PX4.cpp.

Here is the call graph for this function:

◆ set_rgb() [3/3]

void OreoLED_PX4::set_rgb ( uint8_t  instance,
oreoled_pattern  pattern,
uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  amplitude_red,
uint8_t  amplitude_green,
uint8_t  amplitude_blue,
uint16_t  period,
uint16_t  phase_offset 
)
private

Definition at line 362 of file OreoLED_PX4.cpp.

Here is the call graph for this function:

◆ set_standard_colors()

bool OreoLED_PX4::set_standard_colors ( void  )
private

Definition at line 195 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the caller graph for this function:

◆ slow_counter()

bool OreoLED_PX4::slow_counter ( void  )
private

Definition at line 124 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the caller graph for this function:

◆ sync_counter()

void OreoLED_PX4::sync_counter ( void  )
private

Definition at line 140 of file OreoLED_PX4.cpp.

Referenced by healthy(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void OreoLED_PX4::update ( void  )
virtual

Implements NotifyDevice.

Definition at line 95 of file OreoLED_PX4.cpp.

Here is the call graph for this function:

◆ update_timer()

void OreoLED_PX4::update_timer ( void  )
private

Definition at line 465 of file OreoLED_PX4.cpp.

Referenced by healthy(), and init().

Here is the caller graph for this function:

Member Data Documentation

◆ _oreo_theme

uint8_t OreoLED_PX4::_oreo_theme
private

Definition at line 141 of file OreoLED_PX4.h.

Referenced by mode_auto_flight(), mode_failsafe_batt(), and mode_pilot_flight().

◆ _oreoled_fd

int OreoLED_PX4::_oreoled_fd
private

Definition at line 135 of file OreoLED_PX4.h.

Referenced by init(), and update_timer().

◆ _overall_health

bool OreoLED_PX4::_overall_health
private

◆ _pattern_override

uint8_t OreoLED_PX4::_pattern_override
private

Definition at line 140 of file OreoLED_PX4.h.

Referenced by handle_led_control(), and update().

◆ _rear_color_b

uint8_t OreoLED_PX4::_rear_color_b = 255
private

◆ _rear_color_g

uint8_t OreoLED_PX4::_rear_color_g = 255
private

◆ _rear_color_r

uint8_t OreoLED_PX4::_rear_color_r = 255
private

◆ _send_required

bool OreoLED_PX4::_send_required
private

Definition at line 136 of file OreoLED_PX4.h.

Referenced by clear_state(), send_sync(), set_macro(), set_rgb(), and update_timer().

◆ _state_desired

oreo_state OreoLED_PX4::_state_desired[OREOLED_NUM_LEDS]
private

Definition at line 138 of file OreoLED_PX4.h.

Referenced by clear_state(), OreoLED_PX4(), send_sync(), set_macro(), set_rgb(), and update_timer().

◆ _state_desired_semaphore

volatile bool OreoLED_PX4::_state_desired_semaphore
private

Definition at line 137 of file OreoLED_PX4.h.

Referenced by clear_state(), send_sync(), set_macro(), set_rgb(), and update_timer().

◆ _state_sent

oreo_state OreoLED_PX4::_state_sent[OREOLED_NUM_LEDS]
private

Definition at line 139 of file OreoLED_PX4.h.

Referenced by OreoLED_PX4(), send_sync(), set_macro(), set_rgb(), and update_timer().


The documentation for this class was generated from the following files: