AVR146
File
statefunc.c
statefunc.h
Type
C source code
Header file
Note
Functions related to the states defined
in menu file
4.3 Overview
The firmware integrates all functions required to charge a lithium-ion battery.
Table 4-3. Memory requirements of firmware (IAR without optimization)
Build option
Debug
Memory
CODE (Flash)
DATA (SRAM)
XDATA (EEPROM)
Approximate value
13900 bytes
1109 bytes
2 bytes
4.4 State Machine
A state machine is implemented in battery task. This state machine is rather simple
and uses function pointers. It simply looks up the address of the next function to
execute and then jumps to that function. The flow chart of the state machine is
illustrated in the figure below.
Figure 4-2. Flow chart of main function, including the state machine
ADC measurements update
+
Uart state machine
Look up address for Current State
Jump to function of Current State
State function
Next State
Look up address for Next State
Set Current State = Next State
Upon return, the state machine expects the function to indicate the next state as a
return argument. The recognised return codes are described in the table below.
Table 4-4. State machine codes (see source code, menu.h)
Label
INIT
BATCON
Related Function
Initialize()
BatteryControl()
Description
Entry state
Check hardware and batteries
13
7801A-AVR-06/08
相关PDF资料
ATICE10 AVR IN CIRCUIT EMULATOR
ATICE50POD REPLACEMENT POD FOR ICE40,ICE50
ATQT600IB BOARD INTERFACE ATQT600IB
ATSTK1000 KIT STARTER FOR AVR32AP7000
ATSTK501 ADAPTER KIT FOR 64PIN AVR MCU
ATSTK502 MOD EXPANSION AVR STARTER 500
ATSTK503 STARTER KIT AVR EXP MODULE 100P
ATSTK504 STARTER KIT AVR EXP MOD 100P LCD
相关代理商/技术参数
ATEVKLCD100 功能描述:处理器配件 NGW100 ADD-ON QVGA LCD, AUDIO RoHS:否 制造商:Olimex Ltd. 产品:Cable 用于:
ATEVKLCD101 功能描述:处理器配件 NGW100 ADD-ON VGA LCD, AUDIO RoHS:否 制造商:Olimex Ltd. 产品:Cable 用于:
ATEVK-MXT1066T2-A 功能描述:EVAL BOARD FOR MXT1066T2 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT1066T2 主要属性:- 辅助属性:- 所含物品:板 标准包装:1
ATEVK-MXT1189TAT-A 功能描述:EVAL BOARD FOR MXT1189TAT 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT1189TAT 主要属性:- 辅助属性:- 所含物品:板 标准包装:1
ATEVK-MXT1189TAT-B 功能描述:EVAL BOARD FOR MXT1189TAT 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT1189TAT 主要属性:- 辅助属性:- 所含物品:板 标准包装:1
ATEVK-MXT144U-A 功能描述:EVAL BOARD FOR MXT144U 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT144U 主要属性:- 辅助属性:- 所含物品:板 标准包装:1
ATEVK-MXT1664T3-A 功能描述:EVAL BOARD FOR MXT1664T3 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT1664T3 主要属性:- 辅助属性:- 所含物品:板 标准包装:1
ATEVK-MXT1665TAT-A 功能描述:EVAL BOARD FOR MXT1665TAT 制造商:microchip technology 系列:- 零件状态:在售 主要用途:接口,触摸屏控制器 嵌入式:- 使用的 IC/零件:mXT1665TAT 主要属性:- 辅助属性:- 所含物品:板 标准包装:1