#include <BatterySensor.h>
|
void | setIdle () |
|
void | unsetIdle (uint16_t(*irqfunc)()) |
|
static void | __vectorfunc () __asm__("__vector_24") __attribute__((__signal__ |
|
static void | __vectorfunc () __asm__("__vector_21") __attribute__((__signal__ |
|
uint8_t | m_Low |
| value for low battery
|
|
uint8_t | m_Critical |
| value for critical battery
|
|
uint8_t | m_BatSkip |
|
static void | __used__ |
|
static void | __externally_visible__ |
|
static volatile uint16_t | __gb_BatCurrent = 0 |
|
static volatile uint8_t | __gb_BatCount = 0 |
|
static uint16_t(* | __gb_BatIrq )() |
|
IrqInternalBatt class uses continue measurement in background. It uses the ADC and IRQ to get battery voltage during normal operation. If a device needs to sample analog values, it has to call setIdle() before and unsetIdle() after analogRead().
Definition at line 402 of file BatterySensor.h.
◆ IrqInternalBatt()
as::IrqInternalBatt::IrqInternalBatt |
( |
| ) |
|
|
inline |
◆ ~IrqInternalBatt()
as::IrqInternalBatt::~IrqInternalBatt |
( |
| ) |
|
|
inline |
◆ init()
void as::IrqInternalBatt::init |
( |
__attribute__((unused)) uint32_t |
period, |
|
|
__attribute__((unused)) AlarmClock & |
clock |
|
) |
| |
|
inline |
init measurement with period and used clock
- Parameters
-
period | ticks until next measurement |
clock | clock to use for waiting |
Definition at line 415 of file BatterySensor.h.
◆ irq()
static uint16_t as::IrqInternalBatt::irq |
( |
| ) |
|
|
inlinestatic |
ISR function to get current measured value
Definition at line 447 of file BatterySensor.h.
◆ setIdle()
void as::IrqInternalBatt::setIdle |
( |
| ) |
|
|
inline |
Disable the continues battery measurement Called by HAL before enter idle/sleep state Call this before your application code uses the ADC.
Definition at line 424 of file BatterySensor.h.
◆ unsetIdle()
void as::IrqInternalBatt::unsetIdle |
( |
| ) |
|
|
inline |
Enable the continues measurement of the battery voltage Called by HAL after return from idle/sleep state Call this after the application doesn't need ADC longer
Definition at line 432 of file BatterySensor.h.