Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 "modules/energy/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

◆ BAT_CHECKER_GPIO_OFF

#define BAT_CHECKER_GPIO_OFF   gpio_clear

Definition at line 46 of file bat_checker.c.

◆ BAT_CHECKER_GPIO_ON

#define BAT_CHECKER_GPIO_ON   gpio_set

Definition at line 43 of file bat_checker.c.

Function Documentation

◆ bat_checker_periodic()

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:

◆ init_bat_checker()

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: