Initial import
[avr_bc100.git] / BaseTinyFirmware / IAR / menu.c
1 /* This file has been prepared for Doxygen automatic documentation generation.*/\r
2 /*! \file *********************************************************************\r
3  *\r
4  * \brief\r
5  *      State menu definition\r
6  * \r
7  *      Contains the definition of the state menu.\n\r
8  *      The state menu contains all states and adresses to associated functions.\r
9  *\r
10  * \par Application note:\r
11  *      AVR458: Charging Li-Ion Batteries with BC100 \n\r
12  *      AVR463: Charging NiMH Batteries with BC100\r
13  *\r
14  * \par Documentation:\r
15  *      For comprehensive code documentation, supported compilers, compiler\r
16  *      settings and supported devices see readme.html\r
17  *\r
18  * \author\r
19  *      Atmel Corporation: http://www.atmel.com \n\r
20  *      Support email: avr@atmel.com\r
21  *\r
22  *\r
23  * $Name$\r
24  * $Revision: 2299 $\r
25  * $RCSfile$\r
26  * $URL: http://svn.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/tag/20070904_release_1.0/code/IAR/menu.c $\r
27  * $Date: 2007-08-23 12:55:51 +0200 (to, 23 aug 2007) $\n\r
28  ******************************************************************************/\r
29 \r
30 #include <stdlib.h>\r
31 \r
32 #include "statefunc.h"\r
33 #include "charge.h"\r
34 #include "main.h"\r
35 #include "menu.h"\r
36 \r
37 \r
38 //******************************************************************************\r
39 // State menu (relies on the proper battery type to be defined in main.h!)\r
40 //******************************************************************************\r
41 #ifdef NIMH\r
42 /*! \brief The state menu\r
43  *\r
44  * Contains all the defined states and addresses to their associated functions.\r
45  */\r
46 __flash const MENU_STATE_t menu_state[] = {\r
47 //  State                                       State function\r
48   { ST_INIT,            Initialize},\r
49   { ST_BATCON,          BatteryControl},\r
50   { ST_PREQUAL,         Charge},\r
51   { ST_SLEEP,           Sleep},\r
52   { ST_FASTCHARGE,      Charge},\r
53   { ST_LOWRATECHARGE,   Charge},\r
54   { ST_ENDCHARGE,       Charge},        \r
55   { ST_DISCHARGE,       Discharge},\r
56   { ST_ERROR,           Error},\r
57   { 0,                  NULL},\r
58 };\r
59 #endif // NIMH\r
60 \r
61 #ifdef LIION\r
62 /*! \brief The state menu\r
63  *\r
64  * Contains all the defined states and addresses to their associated functions.\r
65  */\r
66 __flash const MENU_STATE_t menu_state[] = {\r
67 //  State                                       State function\r
68   { ST_INIT,            Initialize},\r
69   { ST_BATCON,          BatteryControl},\r
70   { ST_PREQUAL,         Charge},\r
71   { ST_SLEEP,           Sleep},\r
72   { ST_CCURRENT,        Charge},\r
73   { ST_CVOLTAGE,        Charge},\r
74   { ST_ENDCHARGE,       Charge},        \r
75   { ST_DISCHARGE,       Discharge},\r
76   { ST_ERROR,           Error},\r
77   { 0,                  NULL},\r
78 };\r
79 #endif // LIION\r