@@ -32,20 +32,20 @@ namespace mbed {
32
32
*
33
33
* Example:
34
34
* @code
35
- * // Switch on an LED if any of mbed pins 21-26 is high
35
+ * // Turn on an LED if any pins of Port2[0:5] are high
36
36
*
37
37
* #include "mbed.h"
38
38
*
39
- * PortIn p(Port2, 0x0000003F); // p21-p26
40
- * DigitalOut ind (LED4);
39
+ * PortIn p(Port2, 0x0000003F); // Port2 pins [0:5] only
40
+ * DigitalOut led (LED4);
41
41
*
42
42
* int main() {
43
43
* while(1) {
44
44
* int pins = p.read();
45
45
* if(pins) {
46
- * ind = 1;
46
+ * led = 1;
47
47
* } else {
48
- * ind = 0;
48
+ * led = 0;
49
49
* }
50
50
* }
51
51
* }
@@ -55,10 +55,10 @@ namespace mbed {
55
55
class PortIn {
56
56
public:
57
57
58
- /* * Create an PortIn, connected to the specified port
58
+ /* * Create a PortIn, connected to the specified port
59
59
*
60
- * @param port Port to connect to (Port0-Port5 )
61
- * @param mask A bitmask to identify which bits in the port should be included (0 - ignore)
60
+ * @param port Port to connect to (as defined in target's PortNames.h )
61
+ * @param mask Bitmask defines which port pins should be an input (0 - ignore, 1 - include )
62
62
*/
63
63
PortIn (PortName port, int mask = 0xFFFFFFFF )
64
64
{
@@ -67,10 +67,10 @@ class PortIn {
67
67
core_util_critical_section_exit ();
68
68
}
69
69
70
- /* * Read the value currently output on the port
70
+ /* * Read the value input to the port
71
71
*
72
72
* @returns
73
- * An integer with each bit corresponding to associated port pin setting
73
+ * An integer with each bit corresponding to the associated pin value
74
74
*/
75
75
int read ()
76
76
{
0 commit comments