8 #include "libs/LPC17xx/sLPC17xx.h" // smoothed mbed.h lib
14 Pin
* from_string(std::string value
);
16 inline bool connected(){
17 return this->pin
< 32;
20 inline Pin
* as_output(){
22 this->port
->FIODIR
|= 1<<this->pin
;
26 inline Pin
* as_input(){
28 this->port
->FIODIR
&= ~(1<<this->pin
);
32 Pin
* as_open_drain(void);
34 Pin
* as_repeater(void);
44 if (this->pin
>= 32) return false;
45 return this->inverting
^ (( this->port
->FIOPIN
>> this->pin
) & 1);
48 inline void set(bool value
)
50 if (this->pin
>= 32) return;
51 if ( this->inverting
^ value
)
52 this->port
->FIOSET
= 1 << this->pin
;
54 this->port
->FIOCLR
= 1 << this->pin
;
57 LPC_GPIO_TypeDef
* port
;