1 ###############################################################################
\r
3 # IAR Atmel AVR C/C++ Compiler V4.30F/W32 13/Mar/2008 04:49:38 #
\r
4 # Copyright 1996-2007 IAR Systems. All rights reserved. #
\r
6 # Source file = C:\home\kevin\pub\src\bc100\IAR\menu.c #
\r
7 # Command line = C:\home\kevin\pub\src\bc100\IAR\menu.c #
\r
8 # --cpu=tiny861 -ms -o C:\home\kevin\pub\src\bc10 #
\r
9 # 0\IAR\Release\Obj\ -D NDEBUG -lCN #
\r
10 # C:\home\kevin\pub\src\bc100\IAR\Release\List\ #
\r
11 # -lB C:\home\kevin\pub\src\bc100\IAR\Release\Lis #
\r
12 # t\ --initializers_in_flash -s9 --no_cross_call #
\r
13 # --no_tbaa -DENABLE_BIT_DEFINITIONS -e -I #
\r
14 # "C:\Program Files\IAR Systems\Embedded #
\r
15 # Workbench 4.0\avr\INC\" -I "C:\Program #
\r
16 # Files\IAR Systems\Embedded Workbench #
\r
17 # 4.0\avr\INC\CLIB\" --eeprom_size 512 #
\r
18 # --misrac=5-9,11-12,14,16-17,19-21,24-26,29-32, #
\r
19 # 34-35,38-39,42-43,46,50,52-54,56-59,61-62, #
\r
20 # 64-65,68-80,83-84,87-91,94-95,98-100,103-110, #
\r
22 # Enabled MISRA C rules = 5-9,11-12,14,16-17,19-21,24-26,29-32,34-35, #
\r
23 # 38-39,42-43,46,50,52-54,56-59,61-62,64-65, #
\r
24 # 68-80,83-84,87-91,94-95,98-100,103-110,112-126 #
\r
25 # Checked = 5,7-9,11-12,14,17,19-21,24,29-32,34-35,38-39, #
\r
26 # 42,46,50,52-54,56-59,61-62,64,68-69,71-80, #
\r
27 # 83-84,87-89,91,94-95,98,100,104-105,108-109, #
\r
29 # Not checked = 6,16,25-26,43,65,70,90,99,103,106-107,110, #
\r
31 # List file = C:\home\kevin\pub\src\bc100\IAR\Release\List\me #
\r
33 # Object file = C:\home\kevin\pub\src\bc100\IAR\Release\Obj\men #
\r
37 ###############################################################################
\r
39 C:\home\kevin\pub\src\bc100\IAR\menu.c
\r
40 1 /* This file has been prepared for Doxygen automatic documentation generation.*/
\r
41 2 /*! \file *********************************************************************
\r
44 5 * State menu definition
\r
46 7 * Contains the definition of the state menu.\n
\r
47 8 * The state menu contains all states and adresses to associated functions.
\r
49 10 * \par Application note:
\r
50 11 * AVR458: Charging Li-Ion Batteries with BC100 \n
\r
51 12 * AVR463: Charging NiMH Batteries with BC100
\r
53 14 * \par Documentation:
\r
54 15 * For comprehensive code documentation, supported compilers, compiler
\r
55 16 * settings and supported devices see readme.html
\r
58 19 * Atmel Corporation: http://www.atmel.com \n
\r
59 20 * Support email: avr@atmel.com
\r
63 24 * $Revision: 2299 $
\r
65 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
66 27 * $Date: 2007-08-23 12:55:51 +0200 (to, 23 aug 2007) $\n
\r
67 28 ******************************************************************************/
\r
69 30 #include <stdlib.h>
\r
71 32 #include "statefunc.h"
\r
72 33 #include "charge.h"
\r
73 34 #include "main.h"
\r
74 35 #include "menu.h"
\r
77 38 //******************************************************************************
\r
78 39 // State menu (relies on the proper battery type to be defined in main.h!)
\r
79 40 //******************************************************************************
\r
81 42 /*! \brief The state menu
\r
83 44 * Contains all the defined states and addresses to their associated functions.
\r
86 \ In segment NEAR_F, align 1, keep-with-next
\r
87 46 __flash const MENU_STATE_t menu_state[] = {
\r
90 \ 00000001 .... DW Initialize/2
\r
92 \ 00000004 .... DW BatteryControl/2
\r
94 \ 00000007 .... DW Charge/2
\r
96 \ 0000000A .... DW `Sleep`/2
\r
98 \ 0000000D .... DW Charge/2
\r
100 \ 00000010 .... DW Charge/2
\r
101 \ 00000012 46 DB 70
\r
102 \ 00000013 .... DW Charge/2
\r
103 \ 00000015 50 DB 80
\r
104 \ 00000016 .... DW Discharge/2
\r
105 \ 00000018 5A DB 90
\r
106 \ 00000019 .... DW Error/2
\r
108 \ 0000001C 0000 DW 0H
\r
109 47 // State State function
\r
110 48 { ST_INIT, Initialize},
\r
111 49 { ST_BATCON, BatteryControl},
\r
112 50 { ST_PREQUAL, Charge},
\r
113 51 { ST_SLEEP, Sleep},
\r
114 52 { ST_FASTCHARGE, Charge},
\r
115 53 { ST_LOWRATECHARGE, Charge},
\r
116 54 { ST_ENDCHARGE, Charge},
\r
117 55 { ST_DISCHARGE, Discharge},
\r
118 56 { ST_ERROR, Error},
\r
124 62 /*! \brief The state menu
\r
126 64 * Contains all the defined states and addresses to their associated functions.
\r
128 66 __flash const MENU_STATE_t menu_state[] = {
\r
129 67 // State State function
\r
130 68 { ST_INIT, Initialize},
\r
131 69 { ST_BATCON, BatteryControl},
\r
132 70 { ST_PREQUAL, Charge},
\r
133 71 { ST_SLEEP, Sleep},
\r
134 72 { ST_CCURRENT, Charge},
\r
135 73 { ST_CVOLTAGE, Charge},
\r
136 74 { ST_ENDCHARGE, Charge},
\r
137 75 { ST_DISCHARGE, Discharge},
\r
138 76 { ST_ERROR, Error},
\r
144 Segment part sizes:
\r
146 Function/Label Bytes
\r
147 -------------- -----
\r
151 30 bytes in segment NEAR_F
\r
153 30 bytes of CODE memory
\r