1 ###############################################################################
\r
3 # IAR Atmel AVR C/C++ Compiler V4.30F/W32 12/Mar/2008 23:01:39 #
\r
4 # Copyright 1996-2007 IAR Systems. All rights reserved. #
\r
6 # Source file = C:\home\kevin\pub\src\bc100_cal\IAR\menu.c #
\r
7 # Command line = C:\home\kevin\pub\src\bc100_cal\IAR\menu.c #
\r
8 # --cpu=tiny861 -ms -o C:\home\kevin\pub\src\bc100_cal\IAR #
\r
9 # \Debug\Obj\ -lC C:\home\kevin\pub\src\bc100_cal\IAR\Debu #
\r
10 # g\List\ -lB C:\home\kevin\pub\src\bc100_cal\IAR\Debug\Li #
\r
11 # st\ --initializers_in_flash -z2 --no_cse --no_inline #
\r
12 # --no_code_motion --no_cross_call --no_clustering #
\r
13 # --no_tbaa --debug -DENABLE_BIT_DEFINITIONS -e #
\r
14 # --require_prototypes -I "C:\Program Files\IAR #
\r
15 # Systems\Embedded Workbench 4.0\avr\INC\" -I "C:\Program #
\r
16 # Files\IAR Systems\Embedded Workbench 4.0\avr\INC\CLIB\" #
\r
17 # --eeprom_size 512 #
\r
18 # List file = C:\home\kevin\pub\src\bc100_cal\IAR\Debug\List\menu.lst #
\r
19 # Object file = C:\home\kevin\pub\src\bc100_cal\IAR\Debug\Obj\menu.r90 #
\r
22 ###############################################################################
\r
24 C:\home\kevin\pub\src\bc100_cal\IAR\menu.c
\r
25 1 /* This file has been prepared for Doxygen automatic documentation generation.*/
\r
26 2 /*! \file *********************************************************************
\r
29 5 * State menu definition
\r
31 7 * Contains the definition of the state menu.\n
\r
32 8 * The state menu contains all states and adresses to associated functions.
\r
34 10 * \par Application note:
\r
35 11 * AVR458: Charging Li-Ion Batteries with BC100 \n
\r
36 12 * AVR463: Charging NiMH Batteries with BC100
\r
38 14 * \par Documentation:
\r
39 15 * For comprehensive code documentation, supported compilers, compiler
\r
40 16 * settings and supported devices see readme.html
\r
43 19 * Atmel Corporation: http://www.atmel.com \n
\r
44 20 * Support email: avr@atmel.com
\r
48 24 * $Revision: 2299 $
\r
50 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
51 27 * $Date: 2007-08-23 12:55:51 +0200 (to, 23 aug 2007) $\n
\r
52 28 ******************************************************************************/
\r
54 30 #include <stdlib.h>
\r
56 32 #include "statefunc.h"
\r
57 33 #include "charge.h"
\r
58 34 #include "main.h"
\r
59 35 #include "menu.h"
\r
62 38 //******************************************************************************
\r
63 39 // State menu (relies on the proper battery type to be defined in main.h!)
\r
64 40 //******************************************************************************
\r
66 42 /*! \brief The state menu
\r
68 44 * Contains all the defined states and addresses to their associated functions.
\r
71 \ In segment NEAR_F, align 1, keep-with-next
\r
72 46 __flash const MENU_STATE_t menu_state[] = {
\r
75 \ 00000001 .... DW Initialize/2
\r
77 \ 00000004 .... DW BatteryControl/2
\r
79 \ 00000007 .... DW Charge/2
\r
81 \ 0000000A .... DW `Sleep`/2
\r
83 \ 0000000D .... DW Charge/2
\r
85 \ 00000010 .... DW Charge/2
\r
87 \ 00000013 .... DW Charge/2
\r
89 \ 00000016 .... DW Discharge/2
\r
91 \ 00000019 .... DW Error/2
\r
93 \ 0000001C 0000 DW 0H
\r
94 47 // State State function
\r
95 48 { ST_INIT, Initialize},
\r
96 49 { ST_BATCON, BatteryControl},
\r
97 50 { ST_PREQUAL, Charge},
\r
98 51 { ST_SLEEP, Sleep},
\r
99 52 { ST_FASTCHARGE, Charge},
\r
100 53 { ST_LOWRATECHARGE, Charge},
\r
101 54 { ST_ENDCHARGE, Charge},
\r
102 55 { ST_DISCHARGE, Discharge},
\r
103 56 { ST_ERROR, Error},
\r
109 62 /*! \brief The state menu
\r
111 64 * Contains all the defined states and addresses to their associated functions.
\r
113 66 __flash const MENU_STATE_t menu_state[] = {
\r
114 67 // State State function
\r
115 68 { ST_INIT, Initialize},
\r
116 69 { ST_BATCON, BatteryControl},
\r
117 70 { ST_PREQUAL, Charge},
\r
118 71 { ST_SLEEP, Sleep},
\r
119 72 { ST_CCURRENT, Charge},
\r
120 73 { ST_CVOLTAGE, Charge},
\r
121 74 { ST_ENDCHARGE, Charge},
\r
122 75 { ST_DISCHARGE, Discharge},
\r
123 76 { ST_ERROR, Error},
\r
129 Segment part sizes:
\r
131 Function/Label Bytes
\r
132 -------------- -----
\r
136 30 bytes in segment NEAR_F
\r
138 30 bytes of CODE memory
\r