Initial import
[avr_bc100.git] / BaseTinyFirmware / GCC / menu.h
1 /* This file has been prepared for Doxygen automatic documentation generation.*/\r
2 /*! \file *********************************************************************\r
3  *\r
4  * \brief\r
5  *      Headerfile for menu.c\r
6  * \r
7  *      Contains definitions of each state and declaration of the state\r
8  *      menu entry struct.\r
9  *\r
10  * \par Application note:\r
11  *      AVR458: Charging Li-Ion Batteries with BC100\r
12  *\r
13  * \par Documentation:\r
14  *      For comprehensive code documentation, supported compilers, compiler\r
15  *      settings and supported devices see readme.html\r
16  *\r
17  * \author\r
18  *      Atmel Corporation: http://www.atmel.com \n\r
19  *      Support email: avr@atmel.com\r
20  *\r
21  *\r
22  * $Name$\r
23  * $Revision: 2261 $\r
24  * $RCSfile$\r
25  * $URL: http://svn.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/tag/20070904_release_1.0/code/IAR/menu.h $\r
26  * $Date: 2007-08-10 09:28:35 +0200 (fr, 10 aug 2007) $\n\r
27  ******************************************************************************/\r
28 \r
29 #ifndef MENU_H\r
30 #define MENU_H\r
31 \r
32 #include <avr/pgmspace.h>\r
33 \r
34 \r
35 //******************************************************************************\r
36 // State machine states\r
37 //******************************************************************************\r
38 // State machine states -- max size and number of states is 255.\r
39 // State values must be larger than zero\r
40 #define ST_INIT           (10)  //!< Identifies initialization state.\r
41 #define ST_BATCON         (20)  //!< Identifies battery control state.\r
42 #define ST_PREQUAL        (30)  //!< Identifies prequalification state.\r
43 #define ST_SLEEP          (40)  //!< Identifies sleep state.\r
44 #define ST_FASTCHARGE     (50)  //!< Identifies fast charge state.\r
45 #define ST_LOWRATECHARGE  (60)  //!< Identifies trickle charge state.\r
46 #define ST_ENDCHARGE              (70)  //!< Identifies end of charge.\r
47 #define ST_DISCHARGE      (80)  //!< Identifies discharge state.\r
48 #define ST_ERROR          (90)  //!< Identifies error state.\r
49 #define ST_CCURRENT       (100)  //!< Identifies constant current charge state.\r
50 #define ST_CVOLTAGE       (110)  //!< Identifies constant voltage charge state.\r
51 \r
52 \r
53 //******************************************************************************\r
54 // Struct declarations\r
55 //******************************************************************************\r
56 /*! \brief Holds an entry in the state menu\r
57  *\r
58  * Contains the ID number of a state, and a pointer to its associated function\r
59  */\r
60 struct MENU_STATE_struct\r
61 {\r
62   unsigned char state;  //!< ID number of state.\r
63   unsigned char (*pFunc)(unsigned char inp);  //!< Associated function.\r
64 };\r
65 typedef struct MENU_STATE_struct MENU_STATE_t; //!< For convenience.\r
66 \r
67 \r
68 //******************************************************************************\r
69 // Global variables\r
70 //******************************************************************************\r
71 extern const MENU_STATE_t PROGMEM menu_state[];\r
72 \r
73 #endif // MENU_H\r