| 数据搜索系统,热门电子元器件搜索 |
|
UM1836 数据表(PDF) 13 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM1836 数据表(HTML) 13 Page - STMicroelectronics |
|
13 / 16 page ![]() UM1836 Code to call the API of the STC3115 open source driver DocID027146 Rev 1 13/16 5 Code to call the API of the STC3115 open source driver The code below is an example of how to call the API of the STC3115 open source driver to report battery information to the application. #include "stc3115_Driver.h" int main(void) { int i=0; STC3115_ConfigData_TypeDef STC3115_ConfigData; STC3115_BatteryData_TypeDef STC3115_BatteryData; /* Initialize I2C and GPIO */ IO_Init(); /* Initialize Gas Gauge */ GasGauge_Initialization(&STC3115_ConfigData, &STC3115_BatteryData); /* Read and print Gas Gauge values */ while(1){ /* Update Gas Gauge driver */ if(i == GASGAUGE_PERIOD){ GasGauge_Task(&STC3115_ConfigData, &STC3115_BatteryData); printf("Vbat: %i mV, I=%i mA SoC=%i, C=%i, P=%i A=%i , CC=%d\r\n", STC3115_BatteryData.Voltage, STC3115_BatteryData.Voltage, STC3115_BatteryData.Current, STC3115_BatteryData.SOC, STC3115_BatteryData.ChargeValue, STC3115_BatteryData.Presence, STC3115_BatteryData.status >> 13, STC3115_BatteryData.ConvCounter); i=0; } i++; } Return 0; } |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |