Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
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. More...
 
void write (int value)
 Write the value to the output port. More...
 
int read ()
 Read the value currently output on the port. More...
 
void output ()
 Set as an output. More...
 
void input ()
 Set as an input. More...
 
void mode (PinMode mode)
 Set the input pin mode. More...
 
PortInOutoperator= (int value)
 A shorthand for write() More...
 
PortInOutoperator= (PortInOut &rhs)
 A shorthand for write() More...
 
 operator int ()
 A shorthand for read() More...
 

Detailed Description

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

Note
Synchronization level: Interrupt safe

Definition at line 35 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)

Definition at line 43 of file PortInOut.h.

Member Function Documentation

void input ( )

Set as an input.

Definition at line 80 of file PortInOut.h.

void mode ( PinMode  mode)

Set the input pin mode.

Parameters
modePullUp, PullDown, PullNone, OpenDrain

Definition at line 91 of file PortInOut.h.

operator int ( )

A shorthand for read()

See also
PortInOut::read()

Definition at line 119 of file PortInOut.h.

PortInOut& operator= ( int  value)

A shorthand for write()

See also
PortInOut::write()

Definition at line 101 of file PortInOut.h.

PortInOut& operator= ( PortInOut rhs)

A shorthand for write()

See also
PortInOut::write()

Definition at line 110 of file PortInOut.h.

void output ( )

Set as an output.

Definition at line 71 of file PortInOut.h.

int read ( void  )

Read the value currently output on the port.

Returns
An integer with each bit corresponding to associated port pin setting

Definition at line 64 of file PortInOut.h.

void write ( int  value)

Write the value to the output port.

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

Definition at line 54 of file PortInOut.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.