Prius IPM controller

Dependencies:   mbed

Fork of analoghalls5_5 by N K

Revision:
24:f1ff9c7256b5
Parent:
16:fd6771a6685a
Child:
26:d00561c7bf43
--- a/context.h	Mon Mar 09 08:28:22 2015 +0000
+++ b/context.h	Mon Mar 09 11:33:14 2015 +0000
@@ -9,6 +9,8 @@
 #include "meta.h"
 #include "sensors.h"
 
+class BufferedDebugger;
+
 class Context {
 public:
     Context();
@@ -18,6 +20,7 @@
     void ConfigureThrottle(PinName throttle_pin, float min, float max);
     void ConfigurePositionSensor(PinName pos_a_pin, PinName pos_b_pin, float cal1_a, float cal2_a, float cal1_b, float cal2_b, float offset);
     void ConfigureReference(float max_current);
+    void ConfigureDebugger(int debugger_channels, int debugger_size);
     void AttachCallBack(void (*f)(Context *), int freq);
     void Start();
 public:
@@ -34,6 +37,7 @@
     Serial *serial;
     ReferenceSynthesizer *reference;
     LtiFilter *filter_d, *filter_q;
+    BufferedDebugger *debugger;
 private:
     void InitData();
 private:
@@ -41,6 +45,7 @@
 private:
     PinName _oa, _ob, _oc, _ib_pin, _ic_pin, _throttle_pin, _pos_a_pin, _pos_b_pin, _en;
     float _ki, _kp, _kd, _min, _max, _cal1_a, _cal2_a, _cal1_b, _cal2_b, _scale, _offset, _max_current, _filter_strength;
+    int _debugger_channels, _debugger_size;
     float _pidmax, _pidmin;
     void (*_callbacks[16])(Context *);
     unsigned long  _call_times[16];