Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format

Dependents:   NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more

Fork of mbed by mbed official

Embed: (wiki syntax)

« Back to documentation index

PortInOut Class Reference

PortInOut Class Reference

A multiple pin digital in/out used to set/read multiple bi-directional pins. More...

#include <PortInOut.h>

Public Member Functions

 PortInOut (PortName port, int mask=0xFFFFFFFF)
 Create an PortInOut, connected to the specified port.
void write (int value)
 Write the value to the output port.
int read ()
 Read the value currently output on the port.
void output ()
 Set as an output.
void input ()
 Set as an input.
void mode (PinMode mode)
 Set the input pin mode.
PortInOutoperator= (int value)
 A shorthand for write()
 operator int ()
 A shorthand for read()

Detailed Description

A multiple pin digital in/out used to set/read multiple bi-directional pins.

Definition at line 19 of file PortInOut.h.


Constructor & Destructor Documentation

PortInOut ( PortName  port,
int  mask = 0xFFFFFFFF 
)

Create an PortInOut, connected to the specified port.

Parameters:
portPort to connect to (Port0-Port5)
maskA bitmask to identify which bits in the port should be included (0 - ignore)

Member Function Documentation

void input (  )

Set as an input.

void mode ( PinMode  mode )

Set the input pin mode.

Parameters:
modePullUp, PullDown, PullNone, OpenDrain
operator int (  )

A shorthand for read()

Definition at line 70 of file PortInOut.h.

PortInOut& operator= ( int  value )

A shorthand for write()

Definition at line 58 of file PortInOut.h.

void output (  )

Set as an output.

int read (  )

Read the value currently output on the port.

Returns:
An integer with each bit corresponding to associated port pin setting
void write ( int  value )

Write the value to the output port.

Parameters:
valueAn integer specifying a bit to write for every corresponding port pin