DC2100A  1.2.0
Bi-Directional Cell Balancer Using the LTC3300-1 and the LTC6804-2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Reference Application File for Interface to 24AA64 EEPROM through the LTC6804-2 Battery Monitor on the DC2100A PCB. More...

Go to the source code of this file.

Detailed Description

Reference Application File for Interface to 24AA64 EEPROM through the LTC6804-2 Battery Monitor on the DC2100A PCB.

Definition in file EEPROM.c.

Functions

void eeprom_write_with_crc (int8 board_num, int8 *data_ptr, int16 address, int16 num_bytes)
 
BOOLEAN eeprom_read_with_crc (int8 board_num, int8 *data_ptr, int16 address, int16 num_bytes)
 
void eeprom_cap_use_defaults (int8 board_num)
 
void eeprom_current_use_defaults (int8 board_num)
 
void Eeprom_Init (void)
 Initializes the EEPROM code module. More...
 
BOOLEAN Eeprom_Reset (int8 board_num, char *reset_key)
 Resets the EEPROM to blank values. More...
 
void Eeprom_Cap_Load (int8 board_num, int8 mfg_key)
 Loads the customer saved or Linear factory calibrated capacity values from EEPROM into global shadow RAM. More...
 
void Eeprom_Current_Load (int8 board_num, int8 mfg_key)
 Loads the customer saved or Linear factory calibrated balance current values from EEPROM into global shadow RAM. More...
 
void Eeprom_Cap_Save (int8 board_num, int8 mfg_key)
 Saves the customer saved or Linear factory calibrated capacity values from global shadow RAM into EEPROM. More...
 
void Eeprom_Current_Save (int8 board_num, int8 mfg_key)
 Saves the customer saved or Linear factory calibrated balance current values from global shadow RAM into EEPROM. More...
 
void Eeprom_Cap_Load_Defaults (int8 board_num, int8 mfg_key)
 Loads Linear factory calibrated or nominal capacity values. More...
 
void Eeprom_Current_Load_Defaults (int8 board_num, int8 mfg_key)
 Loads Linear factory calibrated or nominal balance current values. More...
 
void Eeprom_Cap_Save_Defaults (int8 board_num, int8 mfg_key)
 Resets customer saved capacity values to Linear factory calibrated capacity values, or factory calibrated capacity values to nominal. More...
 
void Eeprom_Current_Save_Defaults (int8 board_num, int8 mfg_key)
 Resets customer saved balance current values to Linear factory calibrated balance current values, or factory calibrated balance current values to nominal. More...
 
BOOLEAN Eeprom_Mfg_Data_Get (int8 board_num, EEPROM_MFG_DATA_TYPE *mfg_data)
 Loads the Manufacturing Board ID Data from EEPROM into global shadow RAM. More...
 
void Eeprom_Mfg_Data_Set (int8 board_num, EEPROM_MFG_DATA_TYPE *mfg_data)
 Saves the Manufacturing Board ID Data from global shadow RAM into EEPROM. More...
 

Macros

#define EEPROM_MFG_DATA_ADDRESS   0
 
#define EEPROM_MFG_DATA_CRC_ADDRESS   (EEPROM_MFG_DATA_ADDRESS + sizeof(EEPROM_MFG_DATA_TYPE))
 
#define EEPROM_MFG_DATA_END   (EEPROM_MFG_DATA_CRC_ADDRESS + sizeof(int16) - 1)
 
#define EEPROM_MFG_CAP_ADDRESS   32
 
#define EEPROM_MFG_CAP_CRC_ADDRESS   (EEPROM_MFG_CAP_ADDRESS + sizeof(EEPROM_CAP_TYPE))
 
#define EEPROM_MFG_CAP_END   (EEPROM_MFG_CAP_CRC_ADDRESS + sizeof(int16) - 1)
 
#define EEPROM_MFG_CURRENT_ADDRESS   80
 
#define EEPROM_MFG_CURRENT_CRC_ADDRESS   (EEPROM_MFG_CURRENT_ADDRESS + sizeof(EEPROM_CURRENT_TYPE))
 
#define EEPROM_MFG_CURRENT_END   (EEPROM_MFG_CURRENT_CRC_ADDRESS + sizeof(int16) - 1)
 
#define EEPROM_USER_CAP_ADDRESS   128
 
#define EEPROM_USER_CAP_CRC_ADDRESS   (EEPROM_USER_CAP_ADDRESS + sizeof(EEPROM_CAP_TYPE))
 
#define EEPROM_USER_CAP_END   (EEPROM_USER_CAP_CRC_ADDRESS + sizeof(int16) - 1)
 
#define EEPROM_USER_CURRENT_ADDRESS   176
 
#define EEPROM_USER_CURRENT_CRC_ADDRESS   (EEPROM_USER_CURRENT_ADDRESS + sizeof(EEPROM_CURRENT_TYPE))
 
#define EEPROM_USER_CURRENT_END   (EEPROM_USER_CURRENT_CRC_ADDRESS + sizeof(int16) - 1)
 
#define eeprom_read(board_num, address, data_ptr, num_bytes)
 
#define eeprom_write(board_num, address, data_ptr, num_bytes)
 

Variables

EEPROM_CAP_TYPE Eeprom_cap_values [DC2100A_MAX_BOARDS]
 @ EEPROM Shadow RAMShadow RAM for cell data stored in DC2100A EEPROM. More...
 
EEPROM_CURRENT_TYPE Eeprom_current_values [DC2100A_MAX_BOARDS]
 Copy of balance currents values allows quick balance calculations. More...
 
int16 eeprom_number_reads
 
int16 eeprom_number_writes
 

Function Documentation

void Eeprom_Cap_Load ( int8  board_num,
int8  mfg_key 
)

Loads the customer saved or Linear factory calibrated capacity values from EEPROM into global shadow RAM.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 173 of file EEPROM.c.

void Eeprom_Cap_Load_Defaults ( int8  board_num,
int8  mfg_key 
)

Loads Linear factory calibrated or nominal capacity values.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 229 of file EEPROM.c.

void Eeprom_Cap_Save ( int8  board_num,
int8  mfg_key 
)

Saves the customer saved or Linear factory calibrated capacity values from global shadow RAM into EEPROM.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 203 of file EEPROM.c.

void Eeprom_Cap_Save_Defaults ( int8  board_num,
int8  mfg_key 
)

Resets customer saved capacity values to Linear factory calibrated capacity values, or factory calibrated capacity values to nominal.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 259 of file EEPROM.c.

void Eeprom_Current_Load ( int8  board_num,
int8  mfg_key 
)

Loads the customer saved or Linear factory calibrated balance current values from EEPROM into global shadow RAM.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 188 of file EEPROM.c.

void Eeprom_Current_Load_Defaults ( int8  board_num,
int8  mfg_key 
)

Loads Linear factory calibrated or nominal balance current values.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 244 of file EEPROM.c.

void Eeprom_Current_Save ( int8  board_num,
int8  mfg_key 
)

Saves the customer saved or Linear factory calibrated balance current values from global shadow RAM into EEPROM.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 216 of file EEPROM.c.

void Eeprom_Current_Save_Defaults ( int8  board_num,
int8  mfg_key 
)

Resets customer saved balance current values to Linear factory calibrated balance current values, or factory calibrated balance current values to nominal.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_keyKey allows access for Linear factory calibrated values.

Definition at line 277 of file EEPROM.c.

void Eeprom_Init ( void  )

Initializes the EEPROM code module.

Returns
void

Definition at line 144 of file EEPROM.c.

BOOLEAN Eeprom_Mfg_Data_Get ( int8  board_num,
EEPROM_MFG_DATA_TYPE mfg_data 
)

Loads the Manufacturing Board ID Data from EEPROM into global shadow RAM.

Returns
True if Mfg Board ID Data is valid.
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_dataPointer where read data should be stored.

Definition at line 293 of file EEPROM.c.

void Eeprom_Mfg_Data_Set ( int8  board_num,
EEPROM_MFG_DATA_TYPE mfg_data 
)

Saves the Manufacturing Board ID Data from global shadow RAM into EEPROM.

Returns
void
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
mfg_dataPointer to data to write.

Definition at line 299 of file EEPROM.c.

BOOLEAN Eeprom_Reset ( int8  board_num,
char *  reset_key 
)

Resets the EEPROM to blank values.

Returns
TRUE if the board is reset.
Parameters
board_numThe logical address for the PCB containing this EEPROM data.
reset_keyKey allows reset of EEPROM to blank values.

Definition at line 157 of file EEPROM.c.

Macro Definition Documentation

#define eeprom_read (   board_num,
  address,
  data_ptr,
  num_bytes 
)
Value:
{ \
Eeprom_24AA64_Read(board_num, address, data_ptr, num_bytes); \
eeprom_number_reads += num_bytes; \
}
void Eeprom_24AA64_Read(int8 board_num, int16 address, int8 *data_ptr, int16 num_bytes)
Reads a series of bytes to the 24AA64 EEPROM.
Definition: 24AA64.c:141

Definition at line 104 of file EEPROM.c.

#define eeprom_write (   board_num,
  address,
  data_ptr,
  num_bytes 
)
Value:
{ \
Eeprom_24AA64_Write(board_num, address, data_ptr, num_bytes); \
eeprom_number_writes += num_bytes; \
}
void Eeprom_24AA64_Write(int8 board_num, int16 address, int8 *data_ptr, int16 num_bytes)
Writes a series of bytes to the 24AA64 EEPROM.
Definition: 24AA64.c:109

Definition at line 111 of file EEPROM.c.

Variable Documentation

EEPROM_CAP_TYPE Eeprom_cap_values[DC2100A_MAX_BOARDS]

@ EEPROM Shadow RAMShadow RAM for cell data stored in DC2100A EEPROM.

Copy of capacity value allows quick SOC calculations.

Definition at line 122 of file EEPROM.c.

EEPROM_CURRENT_TYPE Eeprom_current_values[DC2100A_MAX_BOARDS]

Copy of balance currents values allows quick balance calculations.

Definition at line 123 of file EEPROM.c.