下你所需,载你所想!
汇集开发技术源码资料

ds2762电电量芯片驱动实例

:1.912MB :1 :2022-10-08 14:13:52

部分简介

ds2762电电量芯片驱动实例如果开发者对于本文件有需要的可以参考。
ds2762电电量芯片驱动实例 stm32实例
u16 Read_Voltage (void)
{
u16 MSB, LSB,Temp,Voltage;
DS2762_Start ();
DS2762_Rst();
DS2762_Check(); //If a presence is detected, continue to read
DS2762_Write_Byte(0xCC); // Skip Net Address Command
DS2762_Write_Byte(0x69); // Read Registers Command
DS2762_Write_Byte(0x0C); // Voltage Register Address
MSB = DS2762_Read_Byte(); // Read msb
LSB = DS2762_Read_Byte() & 0xE0; // Read lsb and mask off lower 5 bits
Temp = (MSB<<8) LSB;
Voltage = ((Temp>>5) * 488) / 1000; //Voltage in Volts
return Voltage; //·μ??μ??1
}

ds2762电电量芯片驱动实例

热门推荐

相关文章