# ADC_Status_struct Struct Reference

`#include <structs.h>`

## Detailed Description

Holds ADC-status and samples.

Is updated by ADC_ISR().

Definition at line 82 of file structs.h.

## Data Fields
unsigned char | ADC3_G20_OS: 4
| Offset on ADC3 at 20x gain.
unsigned char | ADC5_G20_OS: 4
| Offset on ADC5 at 20x gain.
signed int | avgIBAT
| Average of the last four IBAT readings, in mA.
signed int | discIBAT [4]
| Discrete battery current readings, in mA.
unsigned char | Flag: 1
| ADC cycle complete (TRUE/FALSE).
unsigned char | Halt: 1
| Stop A/D-conversions (TRUE/FALSE).
signed int | IBAT
| Battery current, in mA.
unsigned char | Mains: 1
| Mains OK? (TRUE/FALSE).
unsigned char | MUX: 5
| Corresponds to ADMUX low bits MUX4..0.
unsigned int | rawNTC
| Raw, unconditioned thermistor data.
unsigned int | rawRID
| Raw, unconditioned resistor ID data.
unsigned int | rawVBAT
| Raw, unconditioned battery voltage.
unsigned int | VBAT
| Battery voltage, in mV.
unsigned int | VIN
| Supply voltage, in mV.

## Field Documentation

unsigned char ADC_Status_struct::ADC3_G20_OS

Offset on ADC3 at 20x gain.

Definition at line 88 of file structs.h.

Referenced by ADC_Init().

unsigned char ADC_Status_struct::ADC5_G20_OS

Offset on ADC5 at 20x gain.

Definition at line 89 of file structs.h.

Referenced by ADC_Init(), and ADC_ISR().

signed int ADC_Status_struct::avgIBAT

Average of the last four IBAT readings, in mA.

Definition at line 97 of file structs.h.

Referenced by ADC_Init(), ADC_ISR(), BatteryStatusRefresh(), ConstantCurrent(), HaltNow(), and MaxVoltageAndCurrent().

signed int ADC_Status_struct::discIBAT[4]

Discrete battery current readings, in mA.

Definition at line 96 of file structs.h.

Referenced by ADC_Init(), and ADC_ISR().

unsigned char ADC_Status_struct::Flag

ADC cycle complete (TRUE/FALSE).

Definition at line 85 of file structs.h.

Referenced by ADC_Init(), ADC_ISR(), ADC_Wait(), and Doze().

unsigned char ADC_Status_struct::Halt

Stop A/D-conversions (TRUE/FALSE).

Definition at line 87 of file structs.h.

Referenced by ADC_Init(), ADC_ISR(), and Doze().

signed int ADC_Status_struct::IBAT

Battery current, in mA.

Definition at line 95 of file structs.h.

Referenced by ADC_ISR(), and JumperCheck().

unsigned char ADC_Status_struct::Mains

Mains OK? (TRUE/FALSE).

Definition at line 86 of file structs.h.

Referenced by ADC_ISR(), and HaltNow().

unsigned char ADC_Status_struct::MUX

Corresponds to ADMUX low bits MUX4..0.

Definition at line 84 of file structs.h.

Referenced by ADC_Init(), and ADC_ISR().

unsigned int ADC_Status_struct::rawNTC

Raw, unconditioned thermistor data.

Definition at line 91 of file structs.h.

Referenced by ADC_ISR(), HaltNow(), and NTCLookUp().

unsigned int ADC_Status_struct::rawRID

Raw, unconditioned resistor ID data.

Definition at line 90 of file structs.h.

Referenced by ADC_ISR(), and RIDLookUp().

unsigned int ADC_Status_struct::rawVBAT

Raw, unconditioned battery voltage.

Definition at line 92 of file structs.h.

Referenced by ADC_ISR(), and JumperCheck().

unsigned int ADC_Status_struct::VBAT

Battery voltage, in mV.

Definition at line 94 of file structs.h.

Referenced by ADC_ISR(), BatteryStatusRefresh(), ConstantVoltage(), HaltNow(), JumperCheck(), and MaxVoltageAndCurrent().

unsigned int ADC_Status_struct::VIN

Supply voltage, in mV.

Definition at line 93 of file structs.h.

Referenced by ADC_ISR(), and JumperCheck().