Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
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"
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) |
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.
#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().
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.
void init_bat_checker | ( | void | ) |
Definition at line 49 of file bat_checker.c.
References gpio_setup_output(), LED_INIT, and LED_OFF.