31 #include "generated/airframe.h"
32 #include "generated/modules.h"
37 #if (!defined BAT_CHECKER_GPIO && !defined BAT_CHECKER_LED)
38 #error You must define BAT_CHECKER_GPIO or BAT_CHECKER_LED in your airframe file.
42 #ifndef BAT_CHECKER_GPIO_ON
43 #define BAT_CHECKER_GPIO_ON gpio_set
45 #ifndef BAT_CHECKER_GPIO_OFF
46 #define BAT_CHECKER_GPIO_OFF gpio_clear
51 #ifdef BAT_CHECKER_LED
55 #ifdef BAT_CHECKER_GPIO
64 #ifdef BAT_CHECKER_LED
67 #ifdef BAT_CHECKER_GPIO
71 #ifdef BAT_CHECKER_LED
74 #ifdef BAT_CHECKER_GPIO
78 #ifdef BAT_CHECKER_LED
81 #ifdef BAT_CHECKER_GPIO
#define BAT_CHECKER_GPIO_ON
Some architecture independent helper functions for GPIOs.
void bat_checker_periodic(void)
#define BAT_CHECKER_GPIO_OFF
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
static void gpio_toggle(ioportid_t port, uint16_t pin)
Toggle a gpio output to low level.
void init_bat_checker(void)
bool bat_critical
battery critical status
Interface for electrical status: supply voltage, current, battery status, etc.
bool bat_low
battery low status
arch independent LED (Light Emitting Diodes) API
struct Electrical electrical