bootldr.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00026 //Prototypes...
00027 
00028 #define SMBvariables SV.SMBvar
00029 #define SMBvar_int   SV.SMBint
00030 
00031 
00032 
00033 
00034 #define HOST_ADDR    0x10
00035 #define CHARGER_ADDR 0x12
00036 #define BATTERY_ADDR 0x16
00037 
00038 
00039 // Note that the following cmds are both Master Write to Charger, and Slave Read.
00040 #define SMB_M_CMD_CHARGINGCURRENT 0x14
00041 #define SMB_M_CMD_CHARGINGVOLTAGE 0x15
00042 
00043 //This command is Master Write only, to both the Charger & Host addresses
00044 #define SMB_M_CMD_ALARMWARNING 0x16
00045 
00046 
00047 //SMBus Variable + Command Name offset list
00048 #define SMBV_MfrAccess  0
00049 #define SMBV_RemCapAlm  1
00050 #define SMBV_RemTimeAlm 2
00051 #define SMBV_BattMode   3
00052 #define SMBV_AtRate     4
00053 #define SMBV_AtRateTTF  5
00054 #define SMBV_AtRateTTE  6
00055 #define SMBV_AtRateOK   7
00056 
00057 #define SMBV_Temperature 8
00058 #define SMBV_Voltage     9
00059 #define SMBV_Current    10
00060 #define SMBV_AvgCurrent 11
00061 #define SMBV_MaxError   12
00062 #define SMBV_RelSOC     13
00063 #define SMBV_AbsSOC     14
00064 #define SMBV_RemCap     15
00065 
00066 #define SMBV_FullChgCap 16
00067 #define SMBV_RunTTE     17
00068 #define SMBV_AvgTTE     18
00069 #define SMBV_AvgTTF     19
00070 #define SMBV_ChgCurrent 20
00071 #define SMBV_ChgVoltage 21
00072 #define SMBV_BattStatus 22
00073 #define SMBV_CycleCount 23
00074 
00075 #define SMBV_DesignCap  24
00076 #define SMBV_DesignVolt 25
00077 #define SMBV_SpecInfo   26
00078 #define SMBV_MfrDate    27
00079 #define SMBV_SerialNo   28
00080 
00081 #define SMBV_MfrName    32
00082 #define SMBV_DeviceName 33
00083 #define SMBV_DeviceChem 34
00084 #define SMBV_MfrData    35
00085 #define SMBV_Opt5     0x2F
00086 #define SMBV_Opt4     0x3C
00087 #define SMBV_Opt3     0x3D
00088 #define SMBV_Opt2     0x3E
00089 #define SMBV_Opt1     0x3F
00090 
00091 
00092 
00093 //Offsets within each of the 29 SMBvariables elements
00094 #define lobyte 0
00095 #define hibyte 1
00096 
00097 
00098 //Offsets within TW_RxBuf[]
00099 #define TWRX_BLKCNT  2  /* amount of remaining bytes in this transmission */
00100 #define TWRX_CMD     3  /* flag for the specific cmd to be done */
00101 #define TWRX_MEM     4  /* flag indicating which memory space */
00102 #define TWRX_OFFSET  5  /* offset into the SRAM buffer for this data */
00103 #define TWRX_LOADDR  6  /* hi byte of mem space address    */
00104 #define TWRX_HIADDR  7  /* hi byte of mem space address    */
00105 #define TWRX_SIZE    8  /* size of data block that follows */
00106 #define TWRX_DATA    9  /* start of data block, if present */
00107 
00108 
00109 
00110 //SMBV_BatteryMode bit definitions
00111 
00112 //  HiByte
00113 #define CHARGE_CONTROLLER_ENABLED       0x01
00114 #define PRIMARY_BATTERY                 0x02
00115 #define ALARM_MODE                      0x20
00116 #define CHARGER_MODE                    0x40
00117 #define CAPACITY_MODE                   0x80
00118 
00119 //  LoByte
00120 #define INTERNAL_CHARGE_CONTROLLER      0x01
00121 #define PRIMARY_BATTERY_SUPPORT         0x02
00122 #define CONDITION_FLAG                  0x80
00123 
00124 
00125 
00126 //SMBV_BatteryStatus bit definitions.
00127 
00128 // HiByte
00129 /* * * * * * Alarm Bits * * * * */
00130 #define OVER_CHARGED_ALARM              0x80
00131 #define TERMINATE_CHARGE_ALARM          0x40
00132 #define OVER_TEMP_ALARM                 0x10
00133 #define TERMINATE_DISCHARGE_ALARM       0x08
00134 #define REMAINING_CAPACITY_ALARM        0x02
00135 #define REMAINING_TIME_ALARM            0x01
00136 
00137 // LoByte
00138 /* * * * * * Status Bits * * * * */
00139 #define INITIALIZED             0x80
00140 #define DISCHARGING             0x40
00141 #define FULLY_CHARGED           0x20
00142 #define FULLY_DISCHARGED        0x10
00143 
00144 /* * * * * * Error Codes * * * * */
00145 #define SMBerr_OK               0x00    // r/w The Smart Battery processed the function code without detecting any errors.
00146 #define SMBerr_Busy             0x01    // r/w The Smart Battery is unable to process the function code at this time.
00147 #define SMBerr_ReservedCommand  0x02    // r/w The Smart Battery detected an attempt to read or write to a function code
00148                                         //     reserved by this version of the specification. The Smart Battery detected
00149                                         //     an attempt to access an unsupported optional manufacturer function code.
00150 #define SMBerr_UnsuptdCommand   0x03    // r/w The Smart Battery does not support this function code which is
00151                                         //     defined in this version of the specification.
00152 #define SMBerr_AccessDenied     0x04    //  w  The Smart Battery detected an attempt to write to a read-only function code.
00153 #define SMBerr_OverUnderflow    0x05    // r/w The Smart Battery detected a data overflow or under flow.
00154 #define SMBerr_BadSize          0x06    //  w  The Smart Battery detected an attempt to write to a function code with
00155                                         //     an incorrect size data block.
00156 #define SMBerr_UnknownError     0x07    // r/w The Smart Battery detected an unidentifiable error.
00157 

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