sggt/App/APP_WU/Inc/ip5310_i2c.h

35 lines
772 B
C

/*
* @Author: wujunchao wujunchao@wuxismart.com
* @Date: 2025-03-17 13:35:17
* @LastEditors: wujunchao wujunchao@wuxismart.com
* @LastEditTime: 2025-03-17 13:53:36
* @FilePath: \signal_generator\App\APP_WU\Inc\ip5310_i2c.h
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
#ifndef __IP5310_I2C_H
#define __IP5310_I2C_H
#include "apps_gather.h"
extern uint8_t bat_cpa;
//电芯电量寄存器
//bits [4~7]->[0000, 0001, 0011, 0111, 1111]->[<3%, 3~25%, 25~50%, 50~75%, >75%]
#define BATTERY_CAPACITY 0x74
//读命令
#define READ_CMD 0xEB
//写命令
#define WRITE_CMD 0xEA
//I2C读取电池电量
void read_battery(void);
#endif