91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: 其他
  • 標簽: max17055??

資源簡介

對max17055的寄存器配置,進行詳細配置,包括校準,bsp的驅動匹配文件都有,電量檢測很準。

資源截圖

代碼片段和文件信息

/*
?*?Maxim?MAX17055?IC?Fuel?Gauge?driver
?*
?*?Author:?Kerem?Sahin?
?*?Copyright?(C)?2016?Maxim?Integrated
?*
?*?This?program?is?free?software;?you?can?redistribute??it?and/or?modify?it
?*?under??the?terms?of??the?GNU?General??Public?License?as?published?by?the
?*?Free?Software?Foundation;??either?version?2?of?the??License?or?(at?your
?*?option)?any?later?version.
?*/

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#define?DRV_NAME?“max17055“

/*?CONFIG?register?bits?*/
#define?MAX17055_CONFIG_ALRT_EN?????????(1?<#define?MAX17055_CONFIG2_LDMDL??????????(1?<
/*?STATUS?register?bits?*/
#define?MAX17055_STATUS_BST?????????????(1?<#define?MAX17055_STATUS_POR?????????????(1?<
/*?MODELCFG?register?bits?*/
#define?MAX17055_MODELCFG_REFRESH???????(1?<
/*?TALRTTH?register?bits?*/
#define?MIN_TEMP_ALERT??????????????????0
#define?MAX_TEMP_ALERT??????????????????8

/*?FSTAT?register?bits?*/
#define?MAX17055_FSTAT_DNR??????????????(1)

/*?STATUS?interrupt?status?bits?*/
#define?MAX17055_STATUS_ALRT_CLR_MASK???(0x88BB)
#define?MAX17055_STATUS_SOC_MAX_ALRT????(1?<#define?MAX17055_STATUS_TEMP_MAX_ALRT???(1?<#define?MAX17055_STATUS_VOLT_MAX_ALRT???(1?<#define?MAX17055_STATUS_SOC_MIN_ALRT????(1?<#define?MAX17055_STATUS_TEMP_MIN_ALRT???(1?<#define?MAX17055_STATUS_VOLT_MIN_ALRT???(1?<#define?MAX17055_STATUS_CURR_MAX_ALRT???(1?<#define?MAX17055_STATUS_CURR_MIN_ALRT???(1?<
#define?MAX17055_VMAX_TOLERANCE?????50?/*?50?mV?*/

enum?chip_id?{
????ID_MAX17055
};

struct?max17055_priv?{
????struct?i2c_client???????*client;
????struct?device???????????*dev;
????struct?regmap???????????*regmap;
????struct?power_supply?????battery;
????struct?max17055_platform_data???*pdata;
????struct?work_struct??????init_worker;
????struct?attribute_group??*attr_grp;
};

static?inline?int?max17055_lsb_to_uvolts(struct?max17055_priv?*priv?int?lsb)
{
????return?lsb?*?625?/?8;?/*?78.125uV?per?bit?*/
}

static?int?max17055_raw_current_to_uamps(struct?max17055_priv?*priv?u32?curr)
{
????int?res?=?curr;

????/*?Negative?*/
????if?(res?&?0x8000)
????????res?|=?0xFFFF0000;

????res?*=?1562500?/?(priv->pdata->rsense?*?1000);
????return?res;
}

static?enum?power_supply_property?max17055_battery_props[]?=?{
????POWER_SUPPLY_PROP_PRESENT
????POWER_SUPPLY_PROP_CYCLE_COUNT
????POWER_SUPPLY_PROP_VOLTAGE_MAX
????POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN
????POWER_SUPPLY_PROP_VOLTAGE_NOW
????POWER_SUPPLY_PROP_VOLTAGE_AVG
????POWER_SUPPLY_PROP_VOLTAGE_OCV
????POWER_SUPPLY_PROP_CAPACITY
????POWER_SUPPLY_PROP_CHARGE_FULL
????POWER_SUPPLY_P

評論

共有 條評論

相關資源