CoilGun

Revision:
4:0e2bdd3d52bc
Parent:
3:7273ba733560
Child:
6:4c75db8a43db
diff -r 7273ba733560 -r 0e2bdd3d52bc coilgun.h
--- a/coilgun.h	Sat Sep 14 22:31:22 2013 +0000
+++ b/coilgun.h	Sat Sep 14 22:57:17 2013 +0000
@@ -2,19 +2,37 @@
 #define COILGUN_H
 
 #include "mbed.h"
- 
+
+/** Interface to the CoilGun*/
 class CoilGun {
 public:
-    CoilGun(PinName chargePin, PinName kickPinName, PinName donePinName);
+    /** Create an instance of the CoilGun connected to specfied pins.
+     *
+     * @param chargePinName The charge pin.
+     * @param kickPinName The kick pin.
+     * @param donePinName The done pin.
+     */
+    CoilGun(PinName chargePinName, PinName kickPinName, PinName donePinName);
     
+    /** Kick with coilgun.
+     *
+     * @param length The length of the kick in uS
+     */
     void kick(unsigned int length);
-    void discharge(void); //Method that starts discharging
+    
+    /** Discharge coilgun */
+    void discharge(void);
+    
+    /** turn charging on or off
+     *
+     * @param chargeState Set true to charge. False, to not charge.
+     */
     void setCharge(bool chargeState);
  
 private:
     DigitalOut chargePin;
     DigitalOut kickPin;
-    InterruptIn done;
+    InterruptIn donePin;
     void doneCallback(void);
     
     bool kicking; //True while kick is in progress