bootldr.h File Reference


Detailed Description

Headerfile for bootloader_smbus.c.

Application note:
AVR453: Smart Battery Reference Design
Documentation:
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Original author: Rob G. Fries - Apt Inc.
$Name$
Revision
$RCSfile$
Date

Definition in file bootldr.h.

Go to the source code of this file.

Defines

#define ALARM_MODE   0x20
#define BATTERY_ADDR   0x16
#define CAPACITY_MODE   0x80
#define CHARGE_CONTROLLER_ENABLED   0x01
#define CHARGER_ADDR   0x12
#define CHARGER_MODE   0x40
#define CONDITION_FLAG   0x80
#define DISCHARGING   0x40
#define FULLY_CHARGED   0x20
#define FULLY_DISCHARGED   0x10
#define hibyte   1
#define HOST_ADDR   0x10
#define INITIALIZED   0x80
#define INTERNAL_CHARGE_CONTROLLER   0x01
#define lobyte   0
#define OVER_CHARGED_ALARM   0x80
#define OVER_TEMP_ALARM   0x10
#define PRIMARY_BATTERY   0x02
#define PRIMARY_BATTERY_SUPPORT   0x02
#define REMAINING_CAPACITY_ALARM   0x02
#define REMAINING_TIME_ALARM   0x01
#define SMB_M_CMD_ALARMWARNING   0x16
#define SMB_M_CMD_CHARGINGCURRENT   0x14
#define SMB_M_CMD_CHARGINGVOLTAGE   0x15
#define SMBerr_AccessDenied   0x04
#define SMBerr_BadSize   0x06
#define SMBerr_Busy   0x01
#define SMBerr_OK   0x00
#define SMBerr_OverUnderflow   0x05
#define SMBerr_ReservedCommand   0x02
#define SMBerr_UnknownError   0x07
#define SMBerr_UnsuptdCommand   0x03
#define SMBV_AbsSOC   14
#define SMBV_AtRate   4
#define SMBV_AtRateOK   7
#define SMBV_AtRateTTE   6
#define SMBV_AtRateTTF   5
#define SMBV_AvgCurrent   11
#define SMBV_AvgTTE   18
#define SMBV_AvgTTF   19
#define SMBV_BattMode   3
#define SMBV_BattStatus   22
#define SMBV_ChgCurrent   20
#define SMBV_ChgVoltage   21
#define SMBV_Current   10
#define SMBV_CycleCount   23
#define SMBV_DesignCap   24
#define SMBV_DesignVolt   25
#define SMBV_DeviceChem   34
#define SMBV_DeviceName   33
#define SMBV_FullChgCap   16
#define SMBV_MaxError   12
#define SMBV_MfrAccess   0
#define SMBV_MfrData   35
#define SMBV_MfrDate   27
#define SMBV_MfrName   32
#define SMBV_Opt1   0x3F
#define SMBV_Opt2   0x3E
#define SMBV_Opt3   0x3D
#define SMBV_Opt4   0x3C
#define SMBV_Opt5   0x2F
#define SMBV_RelSOC   13
#define SMBV_RemCap   15
#define SMBV_RemCapAlm   1
#define SMBV_RemTimeAlm   2
#define SMBV_RunTTE   17
#define SMBV_SerialNo   28
#define SMBV_SpecInfo   26
#define SMBV_Temperature   8
#define SMBV_Voltage   9
#define SMBvar_int   SV.SMBint
#define SMBvariables   SV.SMBvar
#define TERMINATE_CHARGE_ALARM   0x40
#define TERMINATE_DISCHARGE_ALARM   0x08
#define TWRX_BLKCNT   2
#define TWRX_CMD   3
#define TWRX_DATA   9
#define TWRX_HIADDR   7
#define TWRX_LOADDR   6
#define TWRX_MEM   4
#define TWRX_OFFSET   5
#define TWRX_SIZE   8


Define Documentation

#define ALARM_MODE   0x20

Definition at line 115 of file bootldr.h.

Referenced by AlarmModeDisabledCheck(), MasterSMBusCheck(), and SMBW_BattMode().

#define BATTERY_ADDR   0x16

Definition at line 36 of file bootldr.h.

Referenced by SMB_RestoreBus().

#define CAPACITY_MODE   0x80

Definition at line 117 of file bootldr.h.

Referenced by AtRateOK(), AtRateTTE(), AtRateTTF(), AvgTimeToFull(), FullChgCap(), RemainingCap(), SMBR_DesignCap(), SMBW_BattMode(), and TimeToEmpty().

#define CHARGE_CONTROLLER_ENABLED   0x01

Definition at line 113 of file bootldr.h.

Referenced by SMBW_BattMode().

#define CHARGER_ADDR   0x12

Definition at line 35 of file bootldr.h.

Referenced by MasterSMBusCheck().

#define CHARGER_MODE   0x40

Definition at line 116 of file bootldr.h.

Referenced by MasterSMBusCheck(), and SMBW_BattMode().

#define CONDITION_FLAG   0x80

Definition at line 122 of file bootldr.h.

#define DISCHARGING   0x40

Definition at line 140 of file bootldr.h.

Referenced by ChargeCheck().

#define FULLY_CHARGED   0x20

Definition at line 141 of file bootldr.h.

Referenced by ChargeCheck(), FullChargeReached(), FullDischargeReached(), and MasterSMBusCheck().

#define FULLY_DISCHARGED   0x10

Definition at line 142 of file bootldr.h.

Referenced by ChargeCheck(), FullChargeReached(), and FullDischargeReached().

#define hibyte   1

Definition at line 95 of file bootldr.h.

Referenced by AlarmConditionsCheck(), AlarmModeDisabledCheck(), AtRateOK(), AtRateTTE(), AtRateTTF(), AvgTimeToFull(), ChargeCheck(), FullChgCap(), MasterSMBusCheck(), RemainingCap(), SMBR_DesignCap(), ThermalCheck(), TimeToEmpty(), and TWICD_ISR().

#define HOST_ADDR   0x10

Definition at line 34 of file bootldr.h.

Referenced by MasterSMBusCheck().

#define INITIALIZED   0x80

Definition at line 139 of file bootldr.h.

#define INTERNAL_CHARGE_CONTROLLER   0x01

Definition at line 120 of file bootldr.h.

Referenced by SMBW_BattMode().

#define lobyte   0

Definition at line 94 of file bootldr.h.

Referenced by ChargeCheck(), FullChargeReached(), FullDischargeReached(), main(), MasterSMBusCheck(), SMB_CmdInterpreter(), SMBR_BattStatus(), SMBR_ChgCurrent(), SMBR_ChgVoltage(), SMBW_AtRate(), SMBW_BattMode(), SMBW_MfrAccess(), SMBW_RemCapAlm(), SMBW_RemTimeAlm(), and TWI_ISR().

#define OVER_CHARGED_ALARM   0x80

Definition at line 130 of file bootldr.h.

Referenced by ChargeCheck(), and MasterSMBusCheck().

#define OVER_TEMP_ALARM   0x10

Definition at line 132 of file bootldr.h.

Referenced by ThermalCheck().

#define PRIMARY_BATTERY   0x02

Definition at line 114 of file bootldr.h.

Referenced by SMBW_BattMode().

#define PRIMARY_BATTERY_SUPPORT   0x02

Definition at line 121 of file bootldr.h.

#define REMAINING_CAPACITY_ALARM   0x02

Definition at line 134 of file bootldr.h.

Referenced by AlarmConditionsCheck(), and MasterSMBusCheck().

#define REMAINING_TIME_ALARM   0x01

Definition at line 135 of file bootldr.h.

Referenced by AlarmConditionsCheck(), and MasterSMBusCheck().

#define SMB_M_CMD_ALARMWARNING   0x16

Definition at line 44 of file bootldr.h.

Referenced by MasterSMBusCheck().

#define SMB_M_CMD_CHARGINGCURRENT   0x14

Definition at line 40 of file bootldr.h.

Referenced by MasterSMBusCheck().

#define SMB_M_CMD_CHARGINGVOLTAGE   0x15

Definition at line 41 of file bootldr.h.

Referenced by MasterSMBusCheck().

#define SMBerr_AccessDenied   0x04

Definition at line 152 of file bootldr.h.

Referenced by SMBW_BattMode(), SMBW_Invalid(), and TWI_ISR().

#define SMBerr_BadSize   0x06

Definition at line 154 of file bootldr.h.

Referenced by TWI_ISR().

#define SMBerr_Busy   0x01

Definition at line 146 of file bootldr.h.

#define SMBerr_OK   0x00

Definition at line 145 of file bootldr.h.

#define SMBerr_OverUnderflow   0x05

Definition at line 153 of file bootldr.h.

#define SMBerr_ReservedCommand   0x02

Definition at line 147 of file bootldr.h.

Referenced by SMBR_Opt1(), SMBR_Opt2(), SMBR_Opt3(), SMBW_Opt1(), SMBW_Opt2(), and SMBW_Opt3().

#define SMBerr_UnknownError   0x07

Definition at line 156 of file bootldr.h.

Referenced by SMB_CmdInterpreter(), and TWI_ISR().

#define SMBerr_UnsuptdCommand   0x03

Definition at line 150 of file bootldr.h.

Referenced by SMB_CmdInterpreter(), and SMBR_invalid().

#define SMBV_AbsSOC   14

Definition at line 63 of file bootldr.h.

Referenced by SMBR_AbsSOC().

#define SMBV_AtRate   4

Definition at line 52 of file bootldr.h.

Referenced by AtRateOK(), AtRateTTE(), AtRateTTF(), InitSMBvariables(), SMBR_AtRate(), and SMBW_AtRate().

#define SMBV_AtRateOK   7

Definition at line 55 of file bootldr.h.

Referenced by SMBR_AtRateOK().

#define SMBV_AtRateTTE   6

Definition at line 54 of file bootldr.h.

Referenced by SMBR_AtRateTTE().

#define SMBV_AtRateTTF   5

Definition at line 53 of file bootldr.h.

Referenced by SMBR_AtRateTTF().

#define SMBV_AvgCurrent   11

Definition at line 60 of file bootldr.h.

Referenced by SMBR_AvgCurrent().

#define SMBV_AvgTTE   18

Definition at line 68 of file bootldr.h.

Referenced by SMBR_AvgTTE().

#define SMBV_AvgTTF   19

Definition at line 69 of file bootldr.h.

Referenced by SMBR_AvgTTF().

#define SMBV_BattMode   3

Definition at line 51 of file bootldr.h.

Referenced by AlarmModeDisabledCheck(), AtRateOK(), AtRateTTE(), AtRateTTF(), AvgTimeToFull(), FullChgCap(), InitSMBvariables(), MasterSMBusCheck(), RemainingCap(), SMBR_BattMode(), SMBR_DesignCap(), SMBW_BattMode(), TimeToEmpty(), and TWICD_ISR().

#define SMBV_BattStatus   22

Definition at line 72 of file bootldr.h.

Referenced by AlarmConditionsCheck(), ChargeCheck(), FullChargeReached(), FullDischargeReached(), InitSMBvariables(), main(), MasterSMBusCheck(), SMB_CmdInterpreter(), SMBR_BattStatus(), SMBR_ChgCurrent(), SMBR_ChgVoltage(), SMBW_AtRate(), SMBW_MfrAccess(), SMBW_RemCapAlm(), SMBW_RemTimeAlm(), ThermalCheck(), and TWI_ISR().

#define SMBV_ChgCurrent   20

Definition at line 70 of file bootldr.h.

Referenced by MasterSMBusCheck(), and SMBR_ChgCurrent().

#define SMBV_ChgVoltage   21

Definition at line 71 of file bootldr.h.

Referenced by MasterSMBusCheck(), and SMBR_ChgVoltage().

#define SMBV_Current   10

Definition at line 59 of file bootldr.h.

Referenced by SMBR_Current().

#define SMBV_CycleCount   23

Definition at line 73 of file bootldr.h.

Referenced by InitSMBvariables(), and SMBR_CycleCount().

#define SMBV_DesignCap   24

Definition at line 75 of file bootldr.h.

Referenced by SMBR_DesignCap().

#define SMBV_DesignVolt   25

Definition at line 76 of file bootldr.h.

Referenced by SMBR_DesignVolt().

#define SMBV_DeviceChem   34

Definition at line 83 of file bootldr.h.

#define SMBV_DeviceName   33

Definition at line 82 of file bootldr.h.

#define SMBV_FullChgCap   16

Definition at line 66 of file bootldr.h.

Referenced by SMBR_FullChgCap().

#define SMBV_MaxError   12

Definition at line 61 of file bootldr.h.

Referenced by SMBR_MaxError().

#define SMBV_MfrAccess   0

Definition at line 48 of file bootldr.h.

Referenced by InitSMBvariables(), SMBR_MfrAccess(), and SMBW_MfrAccess().

#define SMBV_MfrData   35

Definition at line 84 of file bootldr.h.

#define SMBV_MfrDate   27

Definition at line 78 of file bootldr.h.

Referenced by InitSMBvariables(), and SMBR_MfrDate().

#define SMBV_MfrName   32

Definition at line 81 of file bootldr.h.

#define SMBV_Opt1   0x3F

Definition at line 89 of file bootldr.h.

#define SMBV_Opt2   0x3E

Definition at line 88 of file bootldr.h.

#define SMBV_Opt3   0x3D

Definition at line 87 of file bootldr.h.

#define SMBV_Opt4   0x3C

Definition at line 86 of file bootldr.h.

#define SMBV_Opt5   0x2F

Definition at line 85 of file bootldr.h.

Referenced by SMB_Reply(), and TWI_handler().

#define SMBV_RelSOC   13

Definition at line 62 of file bootldr.h.

Referenced by SMBR_RelSOC().

#define SMBV_RemCap   15

Definition at line 64 of file bootldr.h.

Referenced by SMBR_RemCap().

#define SMBV_RemCapAlm   1

Definition at line 49 of file bootldr.h.

Referenced by AlarmConditionsCheck(), InitSMBvariables(), SMBR_RemCapAlm(), and SMBW_RemCapAlm().

#define SMBV_RemTimeAlm   2

Definition at line 50 of file bootldr.h.

Referenced by AlarmConditionsCheck(), InitSMBvariables(), SMBR_RemTimeAlm(), and SMBW_RemTimeAlm().

#define SMBV_RunTTE   17

Definition at line 67 of file bootldr.h.

Referenced by SMBR_RunTTE().

#define SMBV_SerialNo   28

Definition at line 79 of file bootldr.h.

Referenced by InitSMBvariables(), and SMBR_SerialNo().

#define SMBV_SpecInfo   26

Definition at line 77 of file bootldr.h.

Referenced by InitSMBvariables(), and SMBR_SpecInfo().

#define SMBV_Temperature   8

Definition at line 57 of file bootldr.h.

Referenced by SMBR_Temperature().

#define SMBV_Voltage   9

Definition at line 58 of file bootldr.h.

Referenced by SMBR_Voltage().

#define SMBvar_int   SV.SMBint

Definition at line 29 of file bootldr.h.

Referenced by AlarmConditionsCheck(), AtRateOK(), AtRateTTE(), AtRateTTF(), InitSMBvariables(), MasterSMBusCheck(), SMBR_AbsSOC(), SMBR_AtRate(), SMBR_AtRateOK(), SMBR_AtRateTTE(), SMBR_AtRateTTF(), SMBR_AvgCurrent(), SMBR_AvgTTE(), SMBR_AvgTTF(), SMBR_BattMode(), SMBR_BattStatus(), SMBR_ChgCurrent(), SMBR_ChgVoltage(), SMBR_Current(), SMBR_CycleCount(), SMBR_DesignCap(), SMBR_DesignVolt(), SMBR_FullChgCap(), SMBR_MaxError(), SMBR_MfrAccess(), SMBR_MfrDate(), SMBR_RelSOC(), SMBR_RemCap(), SMBR_RemCapAlm(), SMBR_RemTimeAlm(), SMBR_RunTTE(), SMBR_SerialNo(), SMBR_SpecInfo(), SMBR_Temperature(), SMBR_Voltage(), SMBW_AtRate(), SMBW_BattMode(), SMBW_MfrAccess(), SMBW_RemCapAlm(), and SMBW_RemTimeAlm().

#define SMBvariables   SV.SMBvar

Definition at line 28 of file bootldr.h.

Referenced by AlarmConditionsCheck(), AlarmModeDisabledCheck(), AtRateOK(), AtRateTTE(), AtRateTTF(), AvgTimeToFull(), ChargeCheck(), FullChargeReached(), FullChgCap(), FullDischargeReached(), main(), MasterSMBusCheck(), RemainingCap(), SMB_CmdInterpreter(), SMBR_BattStatus(), SMBR_ChgCurrent(), SMBR_ChgVoltage(), SMBR_DesignCap(), SMBW_AtRate(), SMBW_BattMode(), SMBW_MfrAccess(), SMBW_RemCapAlm(), SMBW_RemTimeAlm(), ThermalCheck(), TimeToEmpty(), TWI_ISR(), and TWICD_ISR().

#define TERMINATE_CHARGE_ALARM   0x40

Definition at line 131 of file bootldr.h.

Referenced by ChargeCheck(), and MasterSMBusCheck().

#define TERMINATE_DISCHARGE_ALARM   0x08

Definition at line 133 of file bootldr.h.

Referenced by ChargeCheck().

#define TWRX_BLKCNT   2

Definition at line 99 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_CMD   3

Definition at line 100 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_DATA   9

Definition at line 106 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_HIADDR   7

Definition at line 104 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_LOADDR   6

Definition at line 103 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_MEM   4

Definition at line 101 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_OFFSET   5

Definition at line 102 of file bootldr.h.

Referenced by SMB_CmdInterpreter().

#define TWRX_SIZE   8

Definition at line 105 of file bootldr.h.

Referenced by SMB_CmdInterpreter().


Generated on Mon Nov 12 15:59:58 2007 for AVR453 Smart Battery Reference Design by  doxygen 1.5.3