PX4 Firmware
PX4 Autopilot Software http://px4.io
VOXLPM Class Reference

#include <voxlpm.hpp>

Inheritance diagram for VOXLPM:
Collaboration diagram for VOXLPM:

Public Member Functions

 VOXLPM (const char *path, int bus, int address, VOXLPM_CH_TYPE ch_type)
 
virtual ~VOXLPM ()
 
virtual int init ()
 
void print_info ()
 

Private Member Functions

void Run () override
 
void start ()
 
void stop ()
 
int measure ()
 
uint8_t read_reg (uint8_t addr)
 
int read_reg_buf (uint8_t addr, uint8_t *buf, uint8_t len)
 
int write_reg (uint8_t value, uint8_t addr)
 

Private Attributes

unsigned _meas_interval {100000}
 
perf_counter_t _sample_perf
 
orb_advert_t _bat_pub_topic
 
orb_advert_t _pm_pub_topic
 
struct battery_status_s _bat_status
 
struct power_monitor_s _pm_status
 
VOXLPM_CH_TYPE _ch_type
 
float _voltage
 
float _amperage
 
float _rsense
 
Battery _battery
 

Detailed Description

Definition at line 145 of file voxlpm.hpp.

Constructor & Destructor Documentation

◆ VOXLPM()

VOXLPM::VOXLPM ( const char *  path,
int  bus,
int  address,
VOXLPM_CH_TYPE  ch_type 
)

◆ ~VOXLPM()

VOXLPM::~VOXLPM ( )
virtual

Definition at line 65 of file voxlpm.cpp.

References _sample_perf, perf_free(), and stop().

Here is the call graph for this function:

Member Function Documentation

◆ init()

int VOXLPM::init ( )
virtual

Definition at line 73 of file voxlpm.cpp.

References _bat_status, _battery, DEFAULT_CTRLA_REG_VAL, DEFAULT_CTRLB_REG_VAL, ToneAlarmInterface::init(), OK, Battery::reset(), start(), VOXLPM_LTC2946_CTRLA_REG, VOXLPM_LTC2946_CTRLB_REG, and write_reg().

Referenced by voxlpm::start_bus().

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

◆ measure()

int VOXLPM::measure ( )
private

Definition at line 134 of file voxlpm.cpp.

References _amperage, _bat_pub_topic, _bat_status, _battery, _ch_type, _pm_pub_topic, _pm_status, _rsense, _sample_perf, _voltage, power_monitor_s::current_a, hrt_absolute_time(), hrt_abstime, OK, orb_advertise(), ORB_ID, orb_publish(), perf_begin(), perf_end(), read_reg_buf(), power_monitor_s::timestamp, Battery::updateBatteryStatus(), power_monitor_s::voltage_v, VOXLPM_CH_TYPE_P5VDC, VOXLPM_CH_TYPE_VBATT, VOXLPM_LTC2946_DELTA_SENSE_MSB_REG, VOXLPM_LTC2946_RESOLUTION, VOXLPM_LTC2946_VFS_DELTA_SENSE, VOXLPM_LTC2946_VFS_SENSE, and VOXLPM_LTC2946_VIN_MSB_REG.

Referenced by Run().

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

◆ print_info()

void VOXLPM::print_info ( )

Definition at line 93 of file voxlpm.cpp.

References _amperage, _ch_type, _meas_interval, _rsense, _sample_perf, _voltage, perf_print_counter(), and VOXLPM_CH_TYPE_VBATT.

Here is the call graph for this function:

◆ read_reg()

uint8_t VOXLPM::read_reg ( uint8_t  addr)
private

Definition at line 216 of file voxlpm.cpp.

◆ read_reg_buf()

int VOXLPM::read_reg_buf ( uint8_t  addr,
uint8_t *  buf,
uint8_t  len 
)
private

Definition at line 225 of file voxlpm.cpp.

Referenced by measure().

Here is the caller graph for this function:

◆ Run()

void VOXLPM::Run ( )
overrideprivate

Definition at line 128 of file voxlpm.cpp.

References measure().

Here is the call graph for this function:

◆ start()

void VOXLPM::start ( )
private

Definition at line 111 of file voxlpm.cpp.

References _meas_interval, and stop().

Referenced by init().

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

◆ stop()

void VOXLPM::stop ( )
private

Definition at line 122 of file voxlpm.cpp.

Referenced by start(), and ~VOXLPM().

Here is the caller graph for this function:

◆ write_reg()

int VOXLPM::write_reg ( uint8_t  value,
uint8_t  addr 
)
private

Definition at line 232 of file voxlpm.cpp.

Referenced by init().

Here is the caller graph for this function:

Member Data Documentation

◆ _amperage

float VOXLPM::_amperage
private

Definition at line 171 of file voxlpm.hpp.

Referenced by measure(), and print_info().

◆ _bat_pub_topic

orb_advert_t VOXLPM::_bat_pub_topic
private

Definition at line 163 of file voxlpm.hpp.

Referenced by measure().

◆ _bat_status

struct battery_status_s VOXLPM::_bat_status
private

Definition at line 166 of file voxlpm.hpp.

Referenced by init(), and measure().

◆ _battery

Battery VOXLPM::_battery
private

Definition at line 174 of file voxlpm.hpp.

Referenced by init(), and measure().

◆ _ch_type

VOXLPM_CH_TYPE VOXLPM::_ch_type
private

Definition at line 169 of file voxlpm.hpp.

Referenced by measure(), print_info(), and VOXLPM().

◆ _meas_interval

unsigned VOXLPM::_meas_interval {100000}
private

Definition at line 155 of file voxlpm.hpp.

Referenced by print_info(), and start().

◆ _pm_pub_topic

orb_advert_t VOXLPM::_pm_pub_topic
private

Definition at line 164 of file voxlpm.hpp.

Referenced by measure().

◆ _pm_status

struct power_monitor_s VOXLPM::_pm_status
private

Definition at line 167 of file voxlpm.hpp.

Referenced by measure().

◆ _rsense

float VOXLPM::_rsense
private

Definition at line 172 of file voxlpm.hpp.

Referenced by measure(), print_info(), and VOXLPM().

◆ _sample_perf

perf_counter_t VOXLPM::_sample_perf
private

Definition at line 161 of file voxlpm.hpp.

Referenced by measure(), print_info(), and ~VOXLPM().

◆ _voltage

float VOXLPM::_voltage
private

Definition at line 170 of file voxlpm.hpp.

Referenced by measure(), and print_info().


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