api / mbed / trunk / DigitalInOut

DigitalInOut

class DigitalInOut : public Base

A digital input/output, used for setting or reading a bi-directional pin

DigitalInOutA digital input/output, used for setting or reading a bi-directional pin
Functions
DigitalInOutCreate a DigitalInOut connected to the specified pin
writeSet the output, specified as 0 or 1 (int)
readReturn the output setting, represented as 0 or 1 (int)
outputSet as an output
inputSet as an input
modeSet the input pin mode
operator=A shorthand for write
operator int()A shorthand for read

Functions

DigitalInOut

DigitalInOut(PinName pin,  
const char *name =  NULL)

Create a DigitalInOut connected to the specified pin

Variables

pinDigitalInOut pin to connect to

write

void write(int value)

Set the output, specified as 0 or 1 (int)

Variables

valueAn integer specifying the pin output value, 0 for logical 0 and 1 (or any other non-zero value) for logical 1

read

int read()

Return the output setting, represented as 0 or 1 (int)

Variables

returnsAn integer representing the output setting of the pin if it is an output, or read the input if set as an input

output

void output()

Set as an output

input

void input()

Set as an input

mode

void mode(PinMode pull)

Set the input pin mode

Variables

modePullUp, PullDown, PullNone, OpenDrain

operator=

DigitalInOut& operator= (int value)

A shorthand for write

operator int()

operator int()

A shorthand for read

class DigitalInOut : public Base
A digital input/output, used for setting or reading a bi-directional pin
DigitalInOut(PinName pin,  
const char *name =  NULL)
Create a DigitalInOut connected to the specified pin
void write(int value)
Set the output, specified as 0 or 1 (int)
int read()
Return the output setting, represented as 0 or 1 (int)
void output()
Set as an output
void input()
Set as an input
void mode(PinMode pull)
Set the input pin mode
DigitalInOut& operator= (int value)
A shorthand for write
operator int()
A shorthand for read