Initial import
[avr_bc100.git] / BaseTinyFirmware / IAR / 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 //******************************************************************************\r
33 // State machine states\r
34 //******************************************************************************\r
35 // State machine states -- max size and number of states is 255.\r
36 // State values must be larger than zero\r
37 #define ST_INIT           (10)  //!< Identifies initialization state.\r
38 #define ST_BATCON         (20)  //!< Identifies battery control state.\r
39 #define ST_PREQUAL        (30)  //!< Identifies prequalification state.\r
40 #define ST_SLEEP          (40)  //!< Identifies sleep state.\r
41 #define ST_FASTCHARGE     (50)  //!< Identifies fast charge state.\r
42 #define ST_LOWRATECHARGE  (60)  //!< Identifies trickle charge state.\r
43 #define ST_ENDCHARGE              (70)  //!< Identifies end of charge.\r
44 #define ST_DISCHARGE      (80)  //!< Identifies discharge state.\r
45 #define ST_ERROR          (90)  //!< Identifies error state.\r
46 #define ST_CCURRENT       (100)  //!< Identifies constant current charge state.\r
47 #define ST_CVOLTAGE       (110)  //!< Identifies constant voltage charge state.\r
48 \r
49 \r
50 //******************************************************************************\r
51 // Struct declarations\r
52 //******************************************************************************\r
53 /*! \brief Holds an entry in the state menu\r
54  *\r
55  * Contains the ID number of a state, and a pointer to its associated function\r
56  */\r
57 struct MENU_STATE_struct\r
58 {\r
59   unsigned char state;  //!< ID number of state.\r
60   unsigned char (*pFunc)(unsigned char inp);  //!< Associated function.\r
61 };\r
62 typedef struct MENU_STATE_struct MENU_STATE_t; //!< For convenience.\r
63 \r
64 \r
65 //******************************************************************************\r
66 // Global variables\r
67 //******************************************************************************\r
68 extern __flash const MENU_STATE_t menu_state[];\r
69 \r
70 #endif // MENU_H\r