8 #include "libs/LPC17xx/sLPC17xx.h" // smoothed mbed.h lib
19 Pin
* from_string(std::string value
);
21 inline bool connected(){
22 return this->pin
< 32;
25 inline bool equals(const Pin
& other
) const {
26 return (this->pin
== other
.pin
) && (this->port
== other
.port
);
29 inline Pin
* as_output(){
31 this->port
->FIODIR
|= 1<<this->pin
;
35 inline Pin
* as_input(){
37 this->port
->FIODIR
&= ~(1<<this->pin
);
41 Pin
* as_open_drain(void);
43 Pin
* as_repeater(void);
53 if (this->pin
>= 32) return false;
54 return this->inverting
^ (( this->port
->FIOPIN
>> this->pin
) & 1);
57 inline void set(bool value
)
59 if (this->pin
>= 32) return;
60 if ( this->inverting
^ value
)
61 this->port
->FIOSET
= 1 << this->pin
;
63 this->port
->FIOCLR
= 1 << this->pin
;
66 mbed::PwmOut
*hardware_pwm();
68 LPC_GPIO_TypeDef
* port
;