#include <string>
#include "libs/LPC17xx/sLPC17xx.h" // smoothed mbed.h lib
+#include "PinNames.h"
+
+namespace mbed {
+ class PwmOut;
+ class InterruptIn;
+}
class Pin {
public:
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);
}
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;
};