# main.h File Reference

## Detailed Description

Headerfile for main.c.

Contains some basic definitions (FALSE, TRUE, ZERO) as well as what battery type (NiMh or Li-Ion) the charger is for.

Application note:
  AVR458: Charging Li-Ion Batteries with BC100
  AVR463: Charging NiMH Batteries with BC100

Documentation:
  For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html

Author:
  Atmel Corporation: http://www.atmel.com
  Support email: avr@atmel.com

$Name$

Revision
  2335

$RCSfile$

URL
  http://revisor.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/trunk/code/IAR/main.h

Date
  2007-09-07 10:11:19 +0200 (fr, 07 sep 2007)

Definition in file main.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | FALSE 0
| We have to define this ourselves.
#define | LIION
| Use specs and state menu for LIION.
#define | SWHIGH 1
#define | SWLOW 0
#define | TRUE (!FALSE)
| We have to define this ourselves.
#define | ZERO 0
| We have to define this ourselves.
## Variables
unsigned char | CurrentState
| Global that indicates current state.

## Define Documentation

#define FALSE 0

We have to define this ourselves.

Definition at line 51 of file main.h.

Referenced by ADC_Init(), ADC_ISR(), ADC_Wait(), BatteryCheck(), BatteryDataRefresh(), BatteryStatusRefresh(), ConstantCurrent(), ConstantVoltage(), Doze(), Error(), HaltNow(), JumperCheck(), MaxVoltageAndCurrent(), NTCLookUp(), PWM_DecrementDutyCycle(), PWM_IncrementDutyCycle(), RIDLookUp(), SPI_Init(), SPI_Put(), SPI_Wait(), Time_Left(), and USI_OVF_ISR().

#define LIION

Use specs and state menu for LIION.

Definition at line 45 of file main.h.

#define SWHIGH 1

Definition at line 37 of file main.h.

#define SWLOW 0

Definition at line 38 of file main.h.

#define TRUE (!FALSE)

We have to define this ourselves.

Definition at line 52 of file main.h.

Referenced by ADC_ISR(), BatteryCheck(), BatteryDataRefresh(), BatteryStatusRefresh(), Charge(), ConstantCurrent(), ConstantVoltage(), Doze(), HaltNow(), JumperCheck(), main(), MaxVoltageAndCurrent(), NTCLookUp(), PWM_DecrementDutyCycle(), PWM_IncrementDutyCycle(), RIDLookUp(), Sleep(), SPI_Put(), Time_Left(), and USI_OVF_ISR().

#define ZERO 0

We have to define this ourselves.

Definition at line 53 of file main.h.

Referenced by main().

## Variable Documentation

unsigned char CurrentState

Global that indicates current state.

Updated by main().

Note:
  See menu.h for definition of states.

Definition at line 78 of file main.c.

Referenced by Charge(), main(), and SetErrorFlag().