mbed-drivers
Public Member Functions | List of all members
mbed::PortInOut Class Reference

#include <PortInOut.h>

Public Member Functions

 PortInOut (PortName port, int mask=0xFFFFFFFF)
 
void write (int value)
 
int read ()
 
void output ()
 
void input ()
 
void mode (PinMode mode)
 
PortInOutoperator= (int value)
 
PortInOutoperator= (PortInOut &rhs)
 
 operator int ()
 

Detailed Description

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

Constructor & Destructor Documentation

mbed::PortInOut::PortInOut ( PortName  port,
int  mask = 0xFFFFFFFF 
)
inline

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 mbed::PortInOut::input ( )
inline

Set as an input

void mbed::PortInOut::mode ( PinMode  mode)
inline

Set the input pin mode

Parameters
modePullUp, PullDown, PullNone, OpenDrain
mbed::PortInOut::operator int ( )
inline

A shorthand for read()

PortInOut& mbed::PortInOut::operator= ( int  value)
inline

A shorthand for write()

void mbed::PortInOut::output ( )
inline

Set as an output

int mbed::PortInOut::read ( )
inline

Read the value currently output on the port

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

Write the value to the output port

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

The documentation for this class was generated from the following file: