RBCX
Library for the RB3204-RBCX board with the ESP32 by RoboticsBrno.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Friends | List of all members
rb::Battery Class Reference

Contains the battery state and can control the robot's power. More...

#include <RBCXBattery.h>

Public Member Functions

uint32_t pct () const
 returns current battery percentage (0-100) More...
 
uint32_t voltageMv () const
 returns battery Mid point voltage in mV More...
 
uint32_t bMidVoltageMv () const
 returns current temperature as measured by the STM32 coprocessor in °C More...
 
int32_t temperatureC () const
 
void shutdown ()
 shuts the robot's battery power More...
 
bool isPoweredByBattery () const
 

Static Public Attributes

static constexpr uint32_t VOLTAGE_MIN
 Minimal battery voltage, in mV, at which the robot shuts down. More...
 
static constexpr uint32_t VOLTAGE_MAX = 4200 * 2
 Maximal battery voltage, in mV. More...
 
static constexpr uint32_t BATTERY_IN_THRESHOLD = 5000
 

Friends

class Manager
 

Detailed Description

Contains the battery state and can control the robot's power.

Member Function Documentation

◆ bMidVoltageMv()

uint32_t rb::Battery::bMidVoltageMv ( ) const
inline

returns current temperature as measured by the STM32 coprocessor in °C

◆ isPoweredByBattery()

bool rb::Battery::isPoweredByBattery ( ) const
inline

◆ pct()

uint32_t rb::Battery::pct ( ) const

returns current battery percentage (0-100)

returns current battery voltage in mV

◆ shutdown()

void rb::Battery::shutdown ( )

shuts the robot's battery power

Returns true if the Robot's battery power branch is on (battery is connected)

◆ temperatureC()

int32_t rb::Battery::temperatureC ( ) const
inline

◆ voltageMv()

uint32_t rb::Battery::voltageMv ( ) const
inline

returns battery Mid point voltage in mV

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

Member Data Documentation

◆ BATTERY_IN_THRESHOLD

constexpr uint32_t rb::Battery::BATTERY_IN_THRESHOLD = 5000
staticconstexpr

◆ VOLTAGE_MAX

constexpr uint32_t rb::Battery::VOLTAGE_MAX = 4200 * 2
staticconstexpr

Maximal battery voltage, in mV.

◆ VOLTAGE_MIN

constexpr uint32_t rb::Battery::VOLTAGE_MIN
staticconstexpr
Initial value:
= 3300
* 2

Minimal battery voltage, in mV, at which the robot shuts down.


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