xref: /openbmc/phosphor-pid-control/pid/pidloop.hpp (revision 7a98c19a76aa1ed2863d6d04e0f8f75bf83da49a)
1ce6a3f36SJames Feist #pragma once
2ce6a3f36SJames Feist 
3*7a98c19aSPatrick Venture #include "pid/zone_interface.hpp"
4ce6a3f36SJames Feist 
5ce6a3f36SJames Feist #include <boost/asio/steady_timer.hpp>
6ce6a3f36SJames Feist 
7a076487aSPatrick Venture namespace pid_control
8a076487aSPatrick Venture {
9a076487aSPatrick Venture 
10ce6a3f36SJames Feist /**
11ce6a3f36SJames Feist  * Main pid control loop for a given zone.
12ce6a3f36SJames Feist  * This function calls itself indefinitely in an async loop to calculate
13ce6a3f36SJames Feist  * fan outputs based on thermal inputs.
14ce6a3f36SJames Feist  *
15*7a98c19aSPatrick Venture  * @param[in] zone - ptr to the ZoneInterface implementation for this loop.
16ce6a3f36SJames Feist  * @param[in] timer - boost timer used for async callback.
17ce6a3f36SJames Feist  * @param[in] first - boolean to denote if initialization needs to be run.
18ce6a3f36SJames Feist  * @param[in] ms100cnt - loop timer counter.
19ce6a3f36SJames Feist  */
20*7a98c19aSPatrick Venture void pidControlLoop(ZoneInterface* zone, boost::asio::steady_timer& timer,
21ce6a3f36SJames Feist                     bool first = true, int ms100cnt = 0);
22a076487aSPatrick Venture 
23a076487aSPatrick Venture } // namespace pid_control
24