Data Structures |
| struct | CELL_DATA |
| struct | BQ_DEV |
| struct | BQ_PACK |
Defines |
| #define | IN_HOST_CHG_OP BIT0 |
| | BQ pack signals defines .
|
|
#define | BQ76PL536_OUTPUTS_VECTOR PORT1_VECTOR |
| | *BQ76PL536 to MSP430 signals defines*/
|
|
#define | BQ76PL536_OUTPUTS_PxIV P1IV |
|
#define | BQ76PL536_CONV_PxIN P1IN |
|
#define | BQ76PL536_CONV_PxOUT P1OUT |
|
#define | BQ76PL536_CONV_PxDIR P1DIR |
|
#define | BQ76PL536_CONV_PxIFG P1IFG |
|
#define | BQ76PL536_CONV_PxIES P1IES |
|
#define | BQ76PL536_CONV_PxIE P1IE |
|
#define | BQ76PL536_CONV_PxSEL P1SEL |
|
#define | BQ76PL536_CONV_PxREN P1REN |
|
#define | OUT_BQ_CONV BIT4 |
|
#define | BQ76PL536_LED_PxIN P1IN |
|
#define | BQ76PL536_LED_PxOUT P1OUT |
|
#define | BQ76PL536_LED_PxDIR P1DIR |
|
#define | BQ76PL536_LED_PxIFG P1IFG |
|
#define | BQ76PL536_LED_PxIES P1IES |
|
#define | BQ76PL536_LED_PxIE P1IE |
|
#define | BQ76PL536_LED_PxSEL P1SEL |
|
#define | BQ76PL536_LED_PxREN P1REN |
|
#define | OUT_BQ_LED BIT0 |
|
#define | BQ76PL536_DRDY_PxIV P1IV |
|
#define | BQ76PL536_DRDY_PxIN P1IN |
|
#define | BQ76PL536_DRDY_PxOUT P1OUT |
|
#define | BQ76PL536_DRDY_PxDIR P1DIR |
|
#define | BQ76PL536_DRDY_PxIFG P1IFG |
|
#define | BQ76PL536_DRDY_PxIES P1IES |
|
#define | BQ76PL536_DRDY_PxIE P1IE |
|
#define | BQ76PL536_DRDY_PxSEL P1SEL |
|
#define | BQ76PL536_DRDY_PxREN P1REN |
|
#define | BQ76PL536_ALERT_PxIN P1IN |
|
#define | BQ76PL536_ALERT_PxOUT P1OUT |
|
#define | BQ76PL536_ALERT_PxDIR P1DIR |
|
#define | BQ76PL536_ALERT_PxIFG P1IFG |
|
#define | BQ76PL536_ALERT_PxIES P1IES |
|
#define | BQ76PL536_ALERT_PxIE P1IE |
|
#define | BQ76PL536_ALERT_PxSEL P1SEL |
|
#define | BQ76PL536_ALERT_PxREN P1REN |
|
#define | BQ76PL536_FAULT_PxIN P1IN |
|
#define | BQ76PL536_FAULT_PxOUT P1OUT |
|
#define | BQ76PL536_FAULT_PxDIR P1DIR |
|
#define | BQ76PL536_FAULT_PxIFG P1IFG |
|
#define | BQ76PL536_FAULT_PxIES P1IES |
|
#define | BQ76PL536_FAULT_PxIE P1IE |
|
#define | BQ76PL536_FAULT_PxSEL P1SEL |
|
#define | BQ76PL536_FAULT_PxREN P1REN |
|
#define | IN_BQ_DRDY BIT3 |
|
#define | IN_BQ_ALERT BIT2 |
|
#define | IN_BQ_FAULT BIT1 |
|
#define | ADC_CONTROL_VAL_6 ((1<<6)|(3<<4)|(0<<3)|(5<<0)) |
|
#define | ADC_CONTROL_VAL_5 ((1<<6)|(3<<4)|(0<<3)|(4<<0)) |
|
#define | ADC_CONTROL_VAL_4 ((1<<6)|(3<<4)|(0<<3)|(3<<0)) |
|
#define | IO_CONTROL_VAL ((0<<7)|(0<<6)|(0<<5)|(0<<2)|(0<<1)|(0<<0)) |
|
#define | CB_CTRL_VAL 0 |
|
#define | CB_TIME_VAL 0 |
|
#define | ADC_CONVERT_VAL (1<<0) |
|
#define | SHDW_CTRL_ACCESS_EN_VAL 0x35 |
|
#define | SHDW_CTRL_REFRESH_EN_VAL 0x27 |
|
#define | E_EN_OTP_EN_VAL 0x91 |
|
#define | FUNC_CONFIG_VAL_6 ((0x1<<6)|(0<<5)|(0<<4)|(0x0<<2)|(0<<0)) |
|
#define | FUNC_CONFIG_VAL_5 ((0x1<<6)|(0<<5)|(0<<4)|(0x1<<2)|(0<<0)) |
|
#define | FUNC_CONFIG_VAL_4 ((0x1<<6)|(0<<5)|(0<<4)|(0x2<<2)|(0<<0)) |
|
#define | IO_CONFIG_VAL (0<<0) |
|
#define | DISCARD_CRC (1) |
|
#define | RETURN_CRC (0) |
|
#define | CONFIG_COV_VAL (0<<7) |
|
#define | CONFIG_COVT_VAL (1<<7) |
|
#define | CONFIG_CUV_VAL (0<<7) |
|
#define | CONFIG_CUVT_VAL (1<<7) |
|
#define | CONFIG_OT_VAL (3<<4) |
|
#define | CONFIG_OTT_VAL (200<<0) |
|
#define | adc_step_mul 6250 |
|
#define | adc_step_div 16383 |
|
#define | BROADCAST_ADDR 0x3F |
|
#define | DISCOVERY_ADDR 0x00 |
|
#define | BQ76PL536_RESET 0xa5 |
|
#define | FAULT_COV_POS 0 |
|
#define | FAULT_CUV_POS 1 |
|
#define | ALERT_OT1_POS 0 |
|
#define | ALERT_OT2_POS 1 |
|
#define | STATUS_ERROR_POT_COV BIT1 |
|
#define | STATUS_ERROR_CUV BIT2 |
|
#define | STATUS_ERROR_IMBALANCE_FAIL BIT3 |
|
#define | STATUS_ERROR_MAX_BALANCE_TIME BIT4 |
|
#define | START_END_OF_CHG_DSCHG_TIMER BIT0 |
|
#define | START_CHARGE_TAPER_TIMER BIT1 |
|
#define | START_CELL_BALANCE_TIMER BIT2 |
|
#define | START_CHG_DSCHG_OP_TIMER BIT3 |
|
#define | bq_dev_write_reg(a, b, c) spi_write_reg(a,(unsigned char)b,c) |
|
#define | bq_dev_read_reg(a, b, c, d, e) spi_read_reg(a,(unsigned char)b,c,d,e) |
Typedefs |
|
typedef enum BQ_DEV_REGS | bq_dev_regs_t |
|
typedef struct CELL_DATA | cell_data_t |
|
typedef struct BQ_DEV | bq_dev_t |
|
typedef enum OP_MODES | op_modes_t |
|
typedef struct BQ_PACK | bq_pack_t |
Enumerations |
| enum | BQ_DEV_REGS {
DEVICE_STATUS_REG = 0x00,
GPAI_L_REG = 0x01,
GPAI_H_REG = 0x02,
VCELL1_L_REG = 0x03,
VCELL1_H_REG = 0x04,
VCELL2_L_REG = 0x05,
VCELL2_H_REG = 0x06,
VCELL3_L_REG = 0x07,
VCELL3_H_REG = 0x08,
VCELL4_L_REG = 0x09,
VCELL4_H_REG = 0x0a,
VCELL5_L_REG = 0x0b,
VCELL5_H_REG = 0x0c,
VCELL6_L_REG = 0x0d,
VCELL6_H_REG = 0x0e,
TEMPERATURE1_L_REG = 0x0f,
TEMPERATURE1_H_REG = 0x10,
TEMPERATURE2_L_REG = 0x11,
TEMPERATURE2_H_REG = 0x12,
ALERT_STATUS_REG = 0x20,
FAULT_STATUS_REG = 0x21,
COV_FAULT_REG = 0x22,
CUV_FAULT_REG = 0x23,
PRESULT_A_REG = 0x24,
PRESULT_B_REG = 0x25,
ADC_CONTROL_REG = 0x30,
IO_CONTROL_REG = 0x31,
CB_CTRL_REG = 0x32,
CB_TIME_REG = 0x33,
ADC_CONVERT_REG = 0x34,
SHDW_CTRL_REG = 0x3a,
ADDRESS_CONTROL_REG = 0x3b,
RESET_REG = 0x3c,
TEST_SELECT_REG = 0x3d,
E_EN_REG = 0x3F,
FUNCTION_CONFIG_REG = 0x40,
IO_CONFIG_REG = 0x41,
CONFIG_COV_REG = 0x42,
CONFIG_COVT_REG = 0x43,
CONFIG_CUV_REG = 0x44,
CONFIG_CUVT_REG = 0x45,
CONFIG_OT_REG = 0x46,
CONFIG_OTT_REG = 0x47,
USER1_REG = 0x48,
USER2_REG = 0x49,
USER3_REG = 0x4A,
USER4_REG = 0x4B,
BQ_SPI_REG_MAX = 0x4F
} |
| enum | OP_MODES {
INITIAL_MODE = 0,
CHARGE_OP,
END_OF_CHARGE,
DISCHARGE_OP,
END_OF_DISCHARGE,
FAULT_MODE,
SOV_MODE
} |
Functions |
| short | bq_pack_address_discovery (void) |
| | Function Name: bq_pack_address_discovery .
|
| short | bq_pack_init (void) |
| | Function Name: bq_pack_init.
|
| void | update_bq_pack_data (void) |
| | Function Name: update_bq_pack_data.
|
| void | BatteryPackManager (void) |
| | Function Name: BatteryPackManager .
|
| void | bq_pack_start_conv (void) |
| | Function Name: bq_pack_start_conv .
|
| unsigned short | get_bq_pack_voltage (void) |
| | Function Name: get_bq_pack_voltage.
|
| unsigned short | get_bq_pack_timer (void) |
| | Function Name: get_bq_pack_timer.
|
| void | update_bq_pack_timer (void) |
| | Function Name: update_bq_pack_timer .
|
| op_modes_t | get_bq_pack_mode (void) |
| | Function Name: get_bq_pack_mode .
|
|
void | set_bq_pack_mode (op_modes_t mode) |
| void | CheckFaultConditions (void) |
| | Function Name: CheckFaultConditions.
|
| unsigned short | find_imbalanced_cell (unsigned short bq_pack_id) |
| | Function Name: find_imbalanced_cell .
|
| void | conf_bq_dev (bq_dev_t *this) |
| | Function Name: conf_bq_dev .
|
| void | init_bq_dev_data_structure (bq_dev_t *this) |
| | Function Name: init_bq_dev_data_structure .
|
| short | bq_dev_read_cell_voltage (bq_dev_t *this) |
| | Function Name: bq_dev_read_cell_voltage.
|
| short | bq_dev_read_temps (bq_dev_t *this) |
| | Function Name: bq_dev_read_temps.
|
| short | bq_dev_read_errors (bq_dev_t *this) |
| | Function Name: bq_dev_read_errors.
|
| short | bq_dev_read_status (bq_dev_t *this) |
| | Function Name: bq_dev_read_status.
|
| void | bq_dev_clear_alerts (bq_dev_t *this) |
| | Function Name: bq_dev_clear_alerts .
|
| void | bq_dev_clear_faults (bq_dev_t *this) |
| | Function Name: bq_dev_clear_faults.
|
|
void | update_state_machine (op_modes_t new_mode) |
| short | check_for_cov (void) |
| | Function Name: check_for_cov .
|
| short | check_for_cuv (void) |
| | Function Name: check_for_cuv .
|
| short | check_for_pot (void) |
| | Function Name: check_for_pot .
|
| void | update_op_mode (op_modes_t new_mode) |
| | Function Name: update_op_mode .
|
| void | copy_cell_voltage_values (void) |
| | Function Name: copy_cell_voltage_values.
|
| unsigned short | check_for_discharge_op (void) |
| | Function Name: check_for_discharge_op .
|
| unsigned short | check_for_charge_op (void) |
| | Function Name: check_for_charge_op.
|
| void | CellBalancing (void) |
| | Function Name: CellBalancing.
|
| void | CheckChargeDischargeModes (void) |
| | Function Name: CheckChargeDischargeModes.
|
| void | CheckEndOfChargeOrDischargeModes (void) |
| | Function Name: CheckEndOfChargeOrDischargeModes .
|
| void | enable_bypass_resistor (unsigned short in_dev_id, unsigned short in_value) |
| | Function Name: enable_bypass_resistor.
|
| void | disable_bypass_resistor (unsigned short in_dev_id, unsigned short in_value) |
| | Function Name: disable_bypass_resistor.
|
| void | disable_all_bypass_resistors (void) |
| | Function Name: disable_all_bypass_resistors.
|
| unsigned short | cell_imbalance_threshold_reached (void) |
| | Function Name: cell_imbalance_threshold_reached .
|
Variables |
|
bq_pack_t | bq_pack |
|
unsigned char | HOST_CONTROL_IN |