dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Battery Module

Files

file  battery.c
 Module to read the battery Voltage and Current periodically and set alarms appropriately.
 

Macros

#define STACK_SIZE_BYTES   624
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define SAMPLE_PERIOD_MS   250
 

Functions

static void batteryTask (void *parameters)
 
static int32_t BatteryStart (void)
 
int32_t BatteryInitialize (void)
 

Variables

static bool module_enabled = false
 
static struct pios_thread * batteryTaskHandle
 
static int8_t voltageADCPin = -1
 
static int8_t currentADCPin = -1
 
static bool battery_settings_updated
 
static float avg_current_lpf_for_time
 

Detailed Description

Macro Definition Documentation

#define SAMPLE_PERIOD_MS   250

Definition at line 47 of file battery.c.

#define STACK_SIZE_BYTES   624

Definition at line 45 of file battery.c.

#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 46 of file battery.c.

Function Documentation

int32_t BatteryInitialize ( void  )

Initialise the module, called on startup

Returns
0 on success or -1 if initialisation failed

Definition at line 79 of file battery.c.

static int32_t BatteryStart ( void  )
static

Definition at line 63 of file battery.c.

static void batteryTask ( void *  parameters)
static

Main task. It does not return.

Definition at line 109 of file battery.c.

Variable Documentation

float avg_current_lpf_for_time
static

Definition at line 57 of file battery.c.

bool battery_settings_updated
static

Definition at line 55 of file battery.c.

struct pios_thread* batteryTaskHandle
static

Definition at line 52 of file battery.c.

int8_t currentADCPin = -1
static

Definition at line 54 of file battery.c.

bool module_enabled = false
static

Definition at line 51 of file battery.c.

int8_t voltageADCPin = -1
static

Definition at line 53 of file battery.c.