NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
battery.h File Reference
#include "common/filter.h"
#include "../config/battery.h"
Include dependency graph for battery.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  battery
 

Enumerations

enum  battery_state_t { BATTERY_OK = 0, BATTERY_WARNING, BATTERY_CRITICAL, BATTERY_NOT_PRESENT }
 

Functions

void battery_init (struct battery *self, const struct battery_config *config)
 
battery_state_t battery_get_state (struct battery *self)
 
const char * battery_get_state_str (struct battery *self)
 
void battery_update (struct battery *self)
 
uint8_t battery_get_remaining_percent (struct battery *self)
 
uint8_t battery_get_remaining_capacity (struct battery *self)
 
uint16_t battery_get_voltage (struct battery *self)
 
uint8_t battery_get_cell_count (struct battery *self)
 
uint16_t battery_get_cell_voltage (struct battery *self)
 
int32_t battery_get_current (struct battery *self)
 
int32_t battery_get_spent_capacity (struct battery *self)
 
void battery_update_current_meter (struct battery *self, int32_t lastUpdateAt)
 

Enumeration Type Documentation

Enumerator
BATTERY_OK 
BATTERY_WARNING 
BATTERY_CRITICAL 
BATTERY_NOT_PRESENT 

Function Documentation

uint8_t battery_get_cell_count ( struct battery self)
uint16_t battery_get_cell_voltage ( struct battery self)
int32_t battery_get_current ( struct battery self)
uint8_t battery_get_remaining_capacity ( struct battery self)

Here is the call graph for this function:

uint8_t battery_get_remaining_percent ( struct battery self)
int32_t battery_get_spent_capacity ( struct battery self)
battery_state_t battery_get_state ( struct battery self)
const char* battery_get_state_str ( struct battery self)
uint16_t battery_get_voltage ( struct battery self)
void battery_init ( struct battery self,
const struct battery_config config 
)

Here is the call graph for this function:

void battery_update ( struct battery self)

Here is the call graph for this function:

void battery_update_current_meter ( struct battery self,
int32_t  lastUpdateAt 
)

Here is the call graph for this function: