1 /* mbed Microcontroller Library - PortOut
2 * Copyright (c) 2006-2011 ARM Limited. All rights reserved.
16 #include "PortNames.h"
20 * A multiple pin digital out
23 * > // Toggle all four LEDs
27 * > // LED1 = P1.18 LED2 = P1.20 LED3 = P1.21 LED4 = P1.23
28 * > #define LED_MASK 0x00B40000
30 * > PortOut ledport(Port1, LED_MASK);
34 * > ledport = LED_MASK;
44 /* Constructor: PortOut
45 * Create an PortOut, connected to the specified port
48 * port - Port to connect to (Port0-Port5)
49 * mask - A bitmask to identify which bits in the port should be included (0 - ignore)
51 PortOut(PortName port
, int mask
= 0xFFFFFFFF);
54 * Write the value to the output port
57 * value - An integer specifying a bit to write for every corresponding PortOut pin
59 void write(int value
);
62 * Read the value currently output on the port
65 * returns - An integer with each bit corresponding to associated PortOut pin setting
69 /* Function: operator=
70 * A shorthand for <write>
72 PortOut
& operator= (int value
) {
77 PortOut
& operator= (PortOut
& rhs
) {
82 /* Function: operator int()
83 * A shorthand for <read>
90 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
91 LPC_GPIO_TypeDef
*_gpio
;