release the include directive if found in config
[clinton/Smoothieware.git] / src / libs / Pin.h
index fd694a9..c3e781f 100644 (file)
@@ -6,6 +6,12 @@
 #include <string>
 
 #include "libs/LPC17xx/sLPC17xx.h" // smoothed mbed.h lib
+#include "PinNames.h"
+
+namespace mbed {
+    class PwmOut;
+    class InterruptIn;
+}
 
 class Pin {
     public:
@@ -43,7 +49,7 @@ class Pin {
 
         Pin* pull_none(void);
 
-        inline bool get(){
+        inline bool get() const{
             if (!this->valid) return false;
             return this->inverting ^ (( this->port->FIOPIN >> this->pin ) & 1);
         }
@@ -57,12 +63,21 @@ class Pin {
                 this->port->FIOCLR = 1 << this->pin;
         }
 
+        mbed::PwmOut *hardware_pwm();
+
+        mbed::InterruptIn *interrupt_pin();
+
+        bool is_inverting() const { return inverting; }
+        void set_inverting(bool f) { inverting= f; }
+
         // these should be private, and use getters
         LPC_GPIO_TypeDef* port;
 
+        unsigned char pin;
+        char port_number;
+
+    private:
         struct {
-            unsigned char pin:6;
-            char port_number:3;
             bool inverting:1;
             bool valid:1;
         };