1 /* mbed Microcontroller Library - PortInOut
2 * Copyright (c) 2006-2011 ARM Limited. All rights reserved.
5 #ifndef MBED_PORTINOUT_H
6 #define MBED_PORTINOUT_H
12 #include "PortNames.h"
18 * A multiple pin digital in/out used to set/read multiple bi-directional pins
23 /* Constructor: PortInOut
24 * Create an PortInOut, connected to the specified port
27 * port - Port to connect to (Port0-Port5)
28 * mask - A bitmask to identify which bits in the port should be included (0 - ignore)
30 PortInOut(PortName port
, int mask
= 0xFFFFFFFF);
33 * Write the value to the output port
36 * value - An integer specifying a bit to write for every corresponding port pin
38 void write(int value
);
41 * Read the value currently output on the port
44 * returns - An integer with each bit corresponding to associated port pin setting
59 * Set the input pin mode
62 * mode - PullUp, PullDown, PullNone, OpenDrain
64 void mode(PinMode mode
);
66 /* Function: operator=
67 * A shorthand for <write>
69 PortInOut
& operator= (int value
) {
74 PortInOut
& operator= (PortInOut
& rhs
) {
79 /* Function: operator int()
80 * A shorthand for <read>
87 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
88 LPC_GPIO_TypeDef
*_gpio
;