PX4 Firmware
PX4 Autopilot Software http://px4.io
RGBLED_PWM Class Reference
Inheritance diagram for RGBLED_PWM:
Collaboration diagram for RGBLED_PWM:

Public Member Functions

 RGBLED_PWM ()
 
virtual ~RGBLED_PWM ()
 
int init ()
 
int status ()
 

Private Member Functions

void Run () override
 Main loop function. More...
 
int send_led_rgb ()
 Send RGB PWM settings to LED driver according to current color and brightness. More...
 
int get (bool &on, bool &powersave, uint8_t &r, uint8_t &g, uint8_t &b)
 

Private Attributes

uint8_t _r {0}
 
uint8_t _g {0}
 
uint8_t _b {0}
 
volatile bool _running {false}
 
volatile bool _should_run {true}
 
LedController _led_controller
 

Detailed Description

Definition at line 48 of file rgbled_pwm.cpp.

Constructor & Destructor Documentation

◆ RGBLED_PWM()

RGBLED_PWM::RGBLED_PWM ( )

Definition at line 86 of file rgbled_pwm.cpp.

Referenced by rgbled_pwm_main().

Here is the caller graph for this function:

◆ ~RGBLED_PWM()

RGBLED_PWM::~RGBLED_PWM ( )
virtual

Definition at line 91 of file rgbled_pwm.cpp.

References _running, _should_run, and counter.

Member Function Documentation

◆ get()

int RGBLED_PWM::get ( bool &  on,
bool &  powersave,
uint8_t &  r,
uint8_t &  g,
uint8_t &  b 
)
private

Definition at line 216 of file rgbled_pwm.cpp.

References _b, _g, _r, and OK.

◆ init()

int RGBLED_PWM::init ( )

Definition at line 102 of file rgbled_pwm.cpp.

References _running, led_pwm_servo_init(), OK, and send_led_rgb().

Here is the call graph for this function:

◆ Run()

void RGBLED_PWM::Run ( )
overrideprivate

Main loop function.

Definition at line 140 of file rgbled_pwm.cpp.

References _b, _g, _led_controller, _r, _running, _should_run, LedControlDataSingle::brightness, LedControlDataSingle::color, LedControlData::leds, LedController::maximum_update_interval(), send_led_rgb(), and LedController::update().

Here is the call graph for this function:

◆ send_led_rgb()

int RGBLED_PWM::send_led_rgb ( )
private

Send RGB PWM settings to LED driver according to current color and brightness.

Definition at line 198 of file rgbled_pwm.cpp.

References _b, _g, _r, led_pwm_servo_set(), and OK.

Referenced by init(), and Run().

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

◆ status()

int RGBLED_PWM::status ( )

Definition at line 117 of file rgbled_pwm.cpp.

References OK.

Member Data Documentation

◆ _b

uint8_t RGBLED_PWM::_b {0}
private

Definition at line 61 of file rgbled_pwm.cpp.

Referenced by get(), Run(), and send_led_rgb().

◆ _g

uint8_t RGBLED_PWM::_g {0}
private

Definition at line 60 of file rgbled_pwm.cpp.

Referenced by get(), Run(), and send_led_rgb().

◆ _led_controller

LedController RGBLED_PWM::_led_controller
private

Definition at line 66 of file rgbled_pwm.cpp.

Referenced by Run().

◆ _r

uint8_t RGBLED_PWM::_r {0}
private

Definition at line 59 of file rgbled_pwm.cpp.

Referenced by get(), Run(), and send_led_rgb().

◆ _running

volatile bool RGBLED_PWM::_running {false}
private

Definition at line 63 of file rgbled_pwm.cpp.

Referenced by init(), Run(), and ~RGBLED_PWM().

◆ _should_run

volatile bool RGBLED_PWM::_should_run {true}
private

Definition at line 64 of file rgbled_pwm.cpp.

Referenced by Run(), and ~RGBLED_PWM().


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