PF1550 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
pf1550_kconfig.hpp
Go to the documentation of this file.
1
20#ifndef PF1550_KCONFIG_HPP
21#define PF1550_KCONFIG_HPP
22
23#ifdef __has_include
24#if __has_include("sdkconfig.h")
25#include "sdkconfig.h"
26#endif
27#endif
28
29#include "pf1550_config.hpp"
30
31#ifndef CONFIG_PF1550_CELL_MAX_MV
33#define CONFIG_PF1550_CELL_MAX_MV 4200
34#endif
35#ifndef CONFIG_PF1550_CELL_MAX_CHARGE_MA
37#define CONFIG_PF1550_CELL_MAX_CHARGE_MA 500
38#endif
39#ifndef CONFIG_PF1550_INPUT_MAX_MA
41#define CONFIG_PF1550_INPUT_MAX_MA 1000
42#endif
43
44namespace pf1550 {
45
52constexpr Config KconfigDefaults() noexcept {
53 Config c{};
55 c.limits.cell_max_charge_ma = CONFIG_PF1550_CELL_MAX_CHARGE_MA;
56 c.limits.input_max_ma = CONFIG_PF1550_INPUT_MAX_MA;
57#if defined(CONFIG_PF1550_AS_FOUND_MAKE_SAFE) && CONFIG_PF1550_AS_FOUND_MAKE_SAFE
58 c.as_found_policy = AsFoundPolicy::MakeSafe;
59#endif
60 return c;
61}
62
63} // namespace pf1550
64
65#endif // PF1550_KCONFIG_HPP
@ MakeSafe
Write CHG_OPER = linear only, then verify.
The PF1550 driver: everything it declares lives here; internals in detail.
Definition pf1550.hpp:39
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected: the cell and supply Limits and the as-found policy,...
Definition pf1550_kconfig.hpp:52
PF1550 configuration: the application's Limits, its explicit acknowledgements, the typed configuratio...
#define CONFIG_PF1550_INPUT_MAX_MA
Definition pf1550_kconfig.hpp:41
#define CONFIG_PF1550_CELL_MAX_CHARGE_MA
Definition pf1550_kconfig.hpp:37
#define CONFIG_PF1550_CELL_MAX_MV
Definition pf1550_kconfig.hpp:33
Everything the driver writes. The constructor stores it with no I/O.
Definition pf1550_config.hpp:245
Limits limits
Mandatory.
Definition pf1550_config.hpp:246
uint16_t cell_max_mv
Highest charge voltage the cell allows, 3500 to 4440 mV.
Definition pf1550_config.hpp:46