Scripts and main daemon

This includes the scripts for the YAML parsing and the
main execution point.

Change-Id: If42154c621353b23370b63d4e58f6c75bca8b356
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/examples/swampd.conf b/examples/swampd.conf
new file mode 100644
index 0000000..c17a75c
--- /dev/null
+++ b/examples/swampd.conf
@@ -0,0 +1,97 @@
+
+sensors = (
+  { name = "fan1"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan1"
+    writepath = "/sys/class/hwmon/hwmon0/pwm0"
+    min = 0
+  { name = "fan2"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan2"
+    writepath = "/sys/class/hwmon/hwmon0/pwm1"
+    min = 0
+    max = 255
+    timeout = 0 },
+  { name = "fan3"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan3"
+    writepath = "/sys/class/hwmon/hwmon0/pwm2"
+    min = 0
+    max = 255
+    timeout = 0 },
+  { name = "fan4"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan4"
+    writepath = "/sys/class/hwmon/hwmon0/pwm3"
+    min = 0
+    max = 255
+    timeout = 0 },
+  { name = "fan5"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan5"
+    writepath = ""
+    min = 0
+    max = 0
+    timeout = 0 },
+  { name = "fan6"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan6"
+    writepath = ""
+    min = 0
+    max = 0
+    timeout = 0 },
+  { name = "fan7"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan7"
+    writepath = ""
+    min = 0
+    max = 0
+    timeout = 0 },
+  { name = "fan8"
+    type = "fan"
+    readpath = "/xyz/openbmc_project/sensors/fan_tach/fan8"
+    writepath = ""
+    min = 0
+    max = 0
+    timeout = 0 }
+);
+
+zones = (
+  { id = 0x01
+    minthermalrpm = 3000.0
+    failsafepwm = 90.0
+    pids = (
+      { name = "allfans"
+        type = "fan"
+        inputs = (
+          "fan1",
+          "fan2",
+          "fan3",
+          "fan4",
+          "fan5",
+          "fan6",
+          "fan7",
+          "fan8"
+        )
+        set-point = 90.0
+        pid = {
+          sampleperiod = 0.1
+          p_coefficient = 0.01
+          i_coefficient = 0.001
+          ff_off_coefficient = 0.0
+          ff_gain_coefficient = 0.0
+          i_limit = {
+            min: 0.0
+            max: 100.0
+          }
+          out_limit = {
+            min: 0.0
+            max: 100.0
+          }
+          slew_neg = 0.0
+          slew_pos = 0.0
+        }
+      }
+    )
+  }
+);