1 /* mbed Microcontroller Library - PortInOut
2 * Copyright (c) 2006-2011 ARM Limited. All rights reserved.
12 #include "PortNames.h"
18 * A multiple pin digital input
21 * > // Switch on an LED if any of mbed pins 21-26 is high
25 * > PortIn p(Port2, 0x0000003F); // p21-p26
26 * > DigitalOut ind(LED4);
30 * > int pins = p.read();
42 /* Constructor: PortIn
43 * Create an PortIn, connected to the specified port
46 * port - Port to connect to (Port0-Port5)
47 * mask - A bitmask to identify which bits in the port should be included (0 - ignore)
49 PortIn(PortName port
, int mask
= 0xFFFFFFFF);
52 * Read the value currently output on the port
55 * returns - An integer with each bit corresponding to associated port pin setting
60 * Set the input pin mode
63 * mode - PullUp, PullDown, PullNone, OpenDrain
65 void mode(PinMode mode
);
67 /* Function: operator int()
68 * A shorthand for <read>
75 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
76 LPC_GPIO_TypeDef
*_gpio
;