You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.7 KiB
83 lines
2.7 KiB
#ifndef _HAL_SC8933_CTR_H_
|
|
#define _HAL_SC8933_CTR_H_
|
|
#include "comp_i2c.h"
|
|
|
|
#define CHARGER_SLAVE 0x76
|
|
|
|
#define SC_MODE (0x01)
|
|
#define SC_PWR_SET (0x02)
|
|
#define SC_PWR_PATH (0x03)
|
|
#define SC_IMON (0x04)
|
|
#define SC_CHAR_SET (0x05)
|
|
#define SC_IBUS_LIM (0x06)
|
|
#define SC_VBUS_SET_MSB (0x07)
|
|
#define SC_VBUS_SET_LSB (0x08)
|
|
#define SC_LOAD (0x09)
|
|
#define SC_IBAT_LIM (0x0A)
|
|
#define SC_PRO_SET (0x0B)
|
|
#define SC_CTRL (0x0C)
|
|
#define SC_LOOP_STA (0x0D)
|
|
#define SC_STA1 (0x0E)
|
|
#define SC_STA2 (0x0F)
|
|
#define SC_INT (0x10)
|
|
#define SC_INT_MASK (0x11)
|
|
|
|
#define MON_IBUS 0X00
|
|
#define MON_IBAT 0X01
|
|
#define MON_VC_DROP 0X02
|
|
#define MON_VB_DROP 0x03
|
|
#define MON_VA_DROP 0x04
|
|
#define MON_VBAT 0x05
|
|
#define MON_VBUS 0x06
|
|
|
|
|
|
/*******i2c api**************/
|
|
void hal_charger_i2c_write(uint8_t addr, uint8_t value);
|
|
void hal_charger_i2c_read(uint8_t addr, uint8_t *data);
|
|
uint8_t SC_I2C_Read(uint8_t addr);
|
|
/**********SC8933 API*************/
|
|
void SC_SetOTGVoltageIn(uint16_t VoltageValue);
|
|
void SC_SetOTGCurrent(uint16_t CurrentValue);
|
|
void SC_SetIBAT_LIM(uint8_t iba_lim);
|
|
void SC_SetNONE_OTGCurrent(uint16_t CurrentValue);
|
|
uint16_t get_OTGCurrent(void);
|
|
void SC_SetBATTFull_Vol(uint8_t batt_full_vol);
|
|
void SC_SetOTGMode(bool enable);
|
|
void SC_VB_SET(bool enable);
|
|
void SC_ITRKL_SET(bool enable);
|
|
uint8_t SC_getetOTGMode(void);
|
|
void SC_SetPSTOP(bool enable); //1: STOP 0: NORMAL OPERA
|
|
uint8_t SC_SetPSTOget(void);
|
|
void SC_SetIDLE(bool enable);
|
|
void SC_Set_dpl(uint8_t vin_dpl);
|
|
uint8_t SC_Read_Sta1(void);
|
|
uint8_t SC_Read_Status(void);
|
|
uint8_t SC_Get_Batt_full_flag(void);
|
|
uint8_t SC_Get_Charge_Phase(void);
|
|
void SC_Select_FB(bool enable);
|
|
void SC_Select_PASS_THROUGH(bool enable);
|
|
void SC_Select_Mask(uint8_t select);
|
|
void SC_Control_VA(bool enable);
|
|
void SC_Control_VB(bool enable);
|
|
void SC_Control_VC(bool enable);
|
|
void SC_VBUS_DISPATH(bool enable);
|
|
void SC_VC_DISPATH(bool enable);
|
|
void SC_INDET_SET(bool enable);
|
|
void SC_RECH_SET(bool enable);
|
|
void SC_CBLCOMP_C_SET(uint8_t value);
|
|
uint8_t SC_Control_SC_PWR_PATH_get(void);
|
|
void SC_ForceCharge(bool enable);
|
|
void SC_BlockSS(bool enable);
|
|
void SC_Set_Boost_9V(void);
|
|
void SC_Set_sw_frq(uint8_t value);
|
|
void SC_Set_VLDO(bool enable);
|
|
void SC_Set_ITERM(uint8_t value);
|
|
void SC_Set_CTRL_Short_RST(bool enable);
|
|
void SC_Set_CTRL_RST(bool enable);
|
|
void SC_PRO_SET_EN_VBUSUVP(bool enable);
|
|
void SC_PRO_SET_EN_VBUSOVP(bool enable);
|
|
void SC_Set_C_DIR(bool enable);
|
|
void charger_ctrl_init(void);
|
|
void SC_resverd(bool enable);
|
|
#endif
|
|
|
|
|