rcc 1.0
RCC - RGB LED Color Cube Documentation
|
Battery monitoring functions for AVR microcontrollers. More...
#include "battery.h"
Functions | |
void | battery_init (void) |
Initialize the battery measurement interface. | |
void | battery_disable (void) |
Disable battery voltage measurement. | |
BATTERY_Status | battery_status (void) |
Check the current battery status. |
Battery monitoring functions for AVR microcontrollers.
This source file implements the battery monitoring interface using ADC measurements. It provides functions to initialize the ADC for battery voltage measurement and to check the battery status against a predefined empty voltage threshold.
|
inline |
Disable battery voltage measurement.
This inline function disables the ADC hardware module used for battery voltage measurement. Calling this function reduces power consumption by shutting down the ADC when battery monitoring is not needed.
void battery_init | ( | void | ) |
Initialize the battery measurement interface.
This function initializes the ADC module and configures the ADC channel used for battery voltage measurement as defined by the BATTERY_CHANNEL macro. Must be called before reading battery status to ensure proper ADC setup.
BATTERY_Status battery_status | ( | void | ) |
Check the current battery status.
This function reads the battery voltage using the ADC and compares the value against the BATTERY_EMPTY_VALUE threshold to determine if the battery is considered empty or faulty.