blob: 1586187330241977a4b3f6a094c3f482f1c2c828 [file] [log] [blame]
Patrick Venturee6206562018-03-08 15:36:53 -08001#pragma once
2
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07003#include "pid/ec/pid.hpp"
4
Patrick Venturee6206562018-03-08 15:36:53 -08005#include <map>
6#include <string>
7#include <vector>
8
Patrick Venturee6206562018-03-08 15:36:53 -08009/*
10 * General sensor structure used for configuration.
11 */
12struct sensor
13{
14 /* Used for listen if readpath is passive. */
15 std::string type;
16 /* Can be a sensor path or a dbus path. */
17 std::string readpath;
18 std::string writepath;
19 /* min/max values for writing a percentage or error checking. */
20 int64_t min;
21 int64_t max;
22 int64_t timeout;
23};
24
25/*
26 * Structure for holding the configuration of a PID.
27 */
28struct controller_info
29{
30 std::string type; // fan or margin or temp?
31 std::vector<std::string> inputs; // one or more sensors.
32 float setpoint; // initial setpoint for thermal.
33 ec::pidinfo info; // pid details
34};
35
36/*
37 * General zone structure used for configuration. A zone is a list of PIDs
38 * and a set of configuration settings. This structure gets filled out with
39 * the zone configuration settings and not the PID details.
40 */
41struct zone
42{
43 /* The minimum RPM value we would ever want. */
44 float minthermalrpm;
45
46 /* If the sensors are in fail-safe mode, this is the percentage to use. */
47 float failsafepercent;
48};
49
50using PIDConf = std::map<std::string, struct controller_info>;