blob: efe920c2ea12ad45f1ebef2ebc00eb3ffb872eb5 [file] [log] [blame]
Patrick Venturee6206562018-03-08 15:36:53 -08001#pragma once
2
James Feist0c8223b2019-05-08 15:33:33 -07003#include "pid/ec/pid.hpp"
4
James Feist5ec20272019-07-10 11:59:57 -07005#include <phosphor-logging/log.hpp>
James Feist0c8223b2019-05-08 15:33:33 -07006#include <sdbusplus/bus.hpp>
Patrick Venturea83a3ec2020-08-04 09:52:05 -07007
8#include <limits>
Patrick Ventureda064282018-06-12 19:33:47 -07009#include <string>
10
Patrick Venturea0764872020-08-08 07:48:43 -070011namespace pid_control
12{
13
Yong Li298a95c2020-04-07 15:11:02 +080014void tryRestartControlLoops(void);
James Feist1fe08952019-05-07 09:17:16 -070015
James Feist0c8223b2019-05-08 15:33:33 -070016/*
17 * Given a configuration structure, fill out the information we use within the
18 * PID loop.
19 */
20void initializePIDStruct(ec::pid_info_t* info, const ec::pidinfo& initial);
21
22void dumpPIDStruct(ec::pid_info_t* info);
23
James Feist0c8223b2019-05-08 15:33:33 -070024struct SensorThresholds
25{
26 double lowerThreshold = std::numeric_limits<double>::quiet_NaN();
27 double upperThreshold = std::numeric_limits<double>::quiet_NaN();
28};
29
30const std::string sensorintf = "xyz.openbmc_project.Sensor.Value";
31const std::string criticalThreshInf =
32 "xyz.openbmc_project.Sensor.Threshold.Critical";
33const std::string propertiesintf = "org.freedesktop.DBus.Properties";
34
James Feist0c8223b2019-05-08 15:33:33 -070035/*
36 * Given a path that optionally has a glob portion, fill it out.
37 */
38std::string FixupPath(std::string original);
Patrick Venturea0764872020-08-08 07:48:43 -070039
40} // namespace pid_control