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

Public Member Functions

 RGBLED_NPC5623C (int bus, int rgbled)
 
virtual ~RGBLED_NPC5623C ()
 
virtual int init ()
 
virtual int probe ()
 

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...
 
void update_params ()
 
int write (uint8_t reg, uint8_t data)
 

Private Attributes

float _brightness {1.0f}
 
float _max_brightness {1.0f}
 
uint8_t _r {0}
 
uint8_t _g {0}
 
uint8_t _b {0}
 
volatile bool _running {false}
 
volatile bool _should_run {true}
 
bool _leds_enabled {true}
 
uORB::Subscription _parameter_update_sub {ORB_ID(parameter_update)}
 
LedController _led_controller
 

Detailed Description

Definition at line 64 of file rgbled_ncp5623c.cpp.

Constructor & Destructor Documentation

◆ RGBLED_NPC5623C()

RGBLED_NPC5623C::RGBLED_NPC5623C ( int  bus,
int  rgbled 
)

Definition at line 107 of file rgbled_ncp5623c.cpp.

Referenced by rgbled_ncp5623c_main().

Here is the caller graph for this function:

◆ ~RGBLED_NPC5623C()

RGBLED_NPC5623C::~RGBLED_NPC5623C ( )
virtual

Definition at line 113 of file rgbled_ncp5623c.cpp.

References _running, _should_run, and counter.

Member Function Documentation

◆ init()

int RGBLED_NPC5623C::init ( )
virtual

Definition at line 135 of file rgbled_ncp5623c.cpp.

References _running, ToneAlarmInterface::init(), OK, and update_params().

Here is the call graph for this function:

◆ probe()

int RGBLED_NPC5623C::probe ( )
virtual

Definition at line 153 of file rgbled_ncp5623c.cpp.

References NCP5623_LED_CURRENT, and write().

Here is the call graph for this function:

◆ Run()

void RGBLED_NPC5623C::Run ( )
overrideprivate

Main loop function.

Definition at line 164 of file rgbled_ncp5623c.cpp.

References _b, _brightness, _g, _led_controller, _parameter_update_sub, _r, _running, _should_run, LedControlDataSingle::brightness, LedControlDataSingle::color, uORB::Subscription::copy(), LedControlData::leds, LedController::maximum_update_interval(), NCP5623_LED_BRIGHT, send_led_rgb(), LedController::update(), update_params(), and uORB::Subscription::updated().

Here is the call graph for this function:

◆ send_led_rgb()

int RGBLED_NPC5623C::send_led_rgb ( )
private

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

Definition at line 235 of file rgbled_ncp5623c.cpp.

References _b, _brightness, _g, _max_brightness, _r, msg, NCP5623_LED_CURRENT, NCP5623_LED_PWM0, NCP5623_LED_PWM1, and NCP5623_LED_PWM2.

Referenced by Run().

Here is the caller graph for this function:

◆ update_params()

void RGBLED_NPC5623C::update_params ( )
private

Definition at line 250 of file rgbled_ncp5623c.cpp.

References _max_brightness, param_find(), and param_get().

Referenced by init(), and Run().

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

◆ write()

int RGBLED_NPC5623C::write ( uint8_t  reg,
uint8_t  data 
)
private

Definition at line 124 of file rgbled_ncp5623c.cpp.

References msg.

Referenced by probe().

Here is the caller graph for this function:

Member Data Documentation

◆ _b

uint8_t RGBLED_NPC5623C::_b {0}
private

Definition at line 80 of file rgbled_ncp5623c.cpp.

Referenced by Run(), and send_led_rgb().

◆ _brightness

float RGBLED_NPC5623C::_brightness {1.0f}
private

Definition at line 75 of file rgbled_ncp5623c.cpp.

Referenced by Run(), and send_led_rgb().

◆ _g

uint8_t RGBLED_NPC5623C::_g {0}
private

Definition at line 79 of file rgbled_ncp5623c.cpp.

Referenced by Run(), and send_led_rgb().

◆ _led_controller

LedController RGBLED_NPC5623C::_led_controller
private

Definition at line 87 of file rgbled_ncp5623c.cpp.

Referenced by Run().

◆ _leds_enabled

bool RGBLED_NPC5623C::_leds_enabled {true}
private

Definition at line 83 of file rgbled_ncp5623c.cpp.

◆ _max_brightness

float RGBLED_NPC5623C::_max_brightness {1.0f}
private

Definition at line 76 of file rgbled_ncp5623c.cpp.

Referenced by send_led_rgb(), and update_params().

◆ _parameter_update_sub

uORB::Subscription RGBLED_NPC5623C::_parameter_update_sub {ORB_ID(parameter_update)}
private

Definition at line 85 of file rgbled_ncp5623c.cpp.

Referenced by Run().

◆ _r

uint8_t RGBLED_NPC5623C::_r {0}
private

Definition at line 78 of file rgbled_ncp5623c.cpp.

Referenced by Run(), and send_led_rgb().

◆ _running

volatile bool RGBLED_NPC5623C::_running {false}
private

Definition at line 81 of file rgbled_ncp5623c.cpp.

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

◆ _should_run

volatile bool RGBLED_NPC5623C::_should_run {true}
private

Definition at line 82 of file rgbled_ncp5623c.cpp.

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


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