nrfxlib API 0.1.0
Loading...
Searching...
No Matches
nrf_fuel_gauge.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
12#ifndef __NRF_FUEL_GAUGE_H__
13#define __NRF_FUEL_GAUGE_H__
14
30#include <stdbool.h>
31#include <stddef.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
41extern const char *nrf_fuel_gauge_version;
42
46extern const char *nrf_fuel_gauge_build_date;
47
54 float param_1[201];
55 float temps[3];
56 float param_2[122];
57 float param_3[201];
58 float param_4[201];
59 float param_5[201];
60 float param_6[201];
61 float param_7[122];
62 float param_8[122];
63 float param_9[3];
64 float param_10[6];
65 float param_11[6];
66 float param_12[3];
67 char name[64];
68};
69
75 float yhat;
77 float r0;
82};
83
90 float tau1;
91 float tau2;
92 float neta1;
93 float neta2;
94 float neta3;
95 float beta1;
96 float beta2;
103};
104
111 float a;
112 float b;
113 float c;
114 float d;
116};
117
123 float v0;
125 float i0;
127 float t0;
129 const struct battery_model *model;
132};
133
140
153int nrf_fuel_gauge_init(const struct nrf_fuel_gauge_init_parameters *parameters, float *v0);
154
167float nrf_fuel_gauge_process(float v, float i, float T, float t_delta, bool vbus_present,
168 struct nrf_fuel_gauge_state_info *state);
169
178
189float nrf_fuel_gauge_ttf_get(bool cc_charging, float i_term);
190
212void nrf_fuel_gauge_idle_set(float v, float T, float i_avg);
213
222
231
232#ifdef __cplusplus
233}
234#endif
235
240#endif /* __NRF_FUEL_GAUGE_H__ */
float nrf_fuel_gauge_tte_get(void)
Get predicted "time-to-empty" discharge duration.
void nrf_fuel_gauge_idle_set(float v, float T, float i_avg)
Put library into the idle state.
float nrf_fuel_gauge_ttf_get(bool cc_charging, float i_term)
Get predicted "time-to-full" charging duration.
void nrf_fuel_gauge_opt_params_adjust(const struct nrf_fuel_gauge_config_parameters *opt_params)
Update optional parameters.
const char * nrf_fuel_gauge_build_date
Build date of nRF Fuel Gauge library.
float nrf_fuel_gauge_process(float v, float i, float T, float t_delta, bool vbus_present, struct nrf_fuel_gauge_state_info *state)
Process battery measurement values.
void nrf_fuel_gauge_param_adjust(const struct nrf_fuel_gauge_runtime_parameters *params)
Update runtime parameters.
int nrf_fuel_gauge_init(const struct nrf_fuel_gauge_init_parameters *parameters, float *v0)
Initialize the nRF Fuel Gauge library.
void nrf_fuel_gauge_opt_params_default_get(struct nrf_fuel_gauge_config_parameters *opt_params)
Initialize optional configuration parameters to default values.
const char * nrf_fuel_gauge_version
Version number of nRF Fuel Gauge library in format "x.y.z".
float temps[3]
Definition: nrf_fuel_gauge.h:55
float param_8[122]
Definition: nrf_fuel_gauge.h:62
float param_10[6]
Definition: nrf_fuel_gauge.h:64
float param_3[201]
Definition: nrf_fuel_gauge.h:57
float param_7[122]
Definition: nrf_fuel_gauge.h:61
float param_9[3]
Definition: nrf_fuel_gauge.h:63
char name[64]
Definition: nrf_fuel_gauge.h:67
float param_12[3]
Definition: nrf_fuel_gauge.h:66
float param_5[201]
Definition: nrf_fuel_gauge.h:59
float param_4[201]
Definition: nrf_fuel_gauge.h:58
float param_11[6]
Definition: nrf_fuel_gauge.h:65
float param_6[201]
Definition: nrf_fuel_gauge.h:60
float param_2[122]
Definition: nrf_fuel_gauge.h:56
float param_1[201]
Definition: nrf_fuel_gauge.h:54
Secondary cell (rechargeable) battery model parameters.
Definition: nrf_fuel_gauge.h:53
float neta1
Definition: nrf_fuel_gauge.h:92
float tau2
Definition: nrf_fuel_gauge.h:91
float beta1
Definition: nrf_fuel_gauge.h:95
float tte_reset_threshold
Reset threshold for TTE calculation. If short-term state-of-charge gradient differs from the long-ter...
Definition: nrf_fuel_gauge.h:102
float neta2
Definition: nrf_fuel_gauge.h:93
float beta2
Definition: nrf_fuel_gauge.h:96
float tau1
Definition: nrf_fuel_gauge.h:90
float neta3
Definition: nrf_fuel_gauge.h:94
float tte_min_time
Minimum duration of battery charge/discharge before TTE becomes available [s].
Definition: nrf_fuel_gauge.h:98
Optional static configuration parameters.
Definition: nrf_fuel_gauge.h:89
float t0
Definition: nrf_fuel_gauge.h:127
const struct battery_model * model
Definition: nrf_fuel_gauge.h:129
const struct nrf_fuel_gauge_config_parameters * opt_params
Definition: nrf_fuel_gauge.h:131
float i0
Definition: nrf_fuel_gauge.h:125
float v0
Definition: nrf_fuel_gauge.h:123
Library init parameter struct.
Definition: nrf_fuel_gauge.h:121
float b
Definition: nrf_fuel_gauge.h:112
float d
Definition: nrf_fuel_gauge.h:114
float a
Definition: nrf_fuel_gauge.h:111
float c
Definition: nrf_fuel_gauge.h:113
bool discard_positive_deltaz
Definition: nrf_fuel_gauge.h:115
Optional runtime configuration parameters.
Definition: nrf_fuel_gauge.h:110
float T_truncated
Definition: nrf_fuel_gauge.h:81
float r0
Definition: nrf_fuel_gauge.h:77
float yhat
Definition: nrf_fuel_gauge.h:75
Library state information. Useful for debugging.
Definition: nrf_fuel_gauge.h:73