Paparazzi UAS  v5.15_devel-111-g8fb4629
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bat_checker.c File Reference

Activate a buzzer/LED periodically or periodically to warn of low/critical battery level. More...

#include "modules/energy/bat_checker.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "subsystems/electrical.h"
#include "mcu_periph/gpio.h"
#include "led.h"
+ Include dependency graph for bat_checker.c:

Go to the source code of this file.

Macros

#define BAT_CHECKER_GPIO_ON   gpio_set
 
#define BAT_CHECKER_GPIO_OFF   gpio_clear
 

Functions

void init_bat_checker (void)
 
void bat_checker_periodic (void)
 

Detailed Description

Activate a buzzer/LED periodically or periodically to warn of low/critical battery level.

At LOW_BAT_LEVEL the buzzer will be activated periodically. At CRITIC_BAT_LEVEL the buzzer will be activated permanently.

Definition in file bat_checker.c.

Macro Definition Documentation

#define BAT_CHECKER_GPIO_OFF   gpio_clear

Definition at line 46 of file bat_checker.c.

Referenced by bat_checker_periodic().

#define BAT_CHECKER_GPIO_ON   gpio_set

Definition at line 43 of file bat_checker.c.

Referenced by bat_checker_periodic().

Function Documentation

void bat_checker_periodic ( void  )

Definition at line 60 of file bat_checker.c.

References BAT_CHECKER_GPIO_OFF, BAT_CHECKER_GPIO_ON, Electrical::bat_critical, Electrical::bat_low, electrical, gpio_toggle(), LED_OFF, LED_ON, and LED_TOGGLE.

+ Here is the call graph for this function:

void init_bat_checker ( void  )

Definition at line 49 of file bat_checker.c.

References gpio_setup_output(), LED_INIT, and LED_OFF.

+ Here is the call graph for this function: