MAV'RIC
Public Member Functions
Battery Class Reference

Battery voltage monitor. More...

#include <battery.hpp>

List of all members.

Public Member Functions

 Battery (Adc &adc, battery_conf_t config=battery_default_config())
 Constructor.
bool update (void)
 Updates the battery voltage level.
const float & voltage (void) const
 Returns the level of the battery in volts.
const float & level (void) const
 Returns the level of the battery in percents (from 0 to 100)
bool is_low (void) const
 Indicates if the battery is low.

Detailed Description

Battery voltage monitor.


Constructor & Destructor Documentation

Battery::Battery ( Adc adc,
battery_conf_t  config = battery_default_config() 
)

Constructor.

Parameters:
adcReference to analog to digital converter
configConfiguration

Member Function Documentation

bool Battery::is_low ( void  ) const

Indicates if the battery is low.

Returns:
True if low

Here is the caller graph for this function:

const float & Battery::level ( void  ) const

Returns the level of the battery in percents (from 0 to 100)

Returns:
Level of the battery
bool Battery::update ( void  )

Updates the battery voltage level.

Parameters:
batteryPointer to the battery structure
voltageUpdate measured battery voltage
Returns:
Success

Here is the call graph for this function:

Here is the caller graph for this function:

const float & Battery::voltage ( void  ) const

Returns the level of the battery in volts.

Returns:
Voltage of the battery

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines