Skip to content

Commit 996a31f

Browse files
author
Cruz Monrreal
authored
Merge pull request #8419 from TacoGrandeTX/doc_fix_portin
PortIn.h: Documentation improvements only
2 parents adf9165 + bdcf24b commit 996a31f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/PortIn.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ namespace mbed {
3232
*
3333
* Example:
3434
* @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
3636
*
3737
* #include "mbed.h"
3838
*
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);
4141
*
4242
* int main() {
4343
* while(1) {
4444
* int pins = p.read();
4545
* if(pins) {
46-
* ind = 1;
46+
* led = 1;
4747
* } else {
48-
* ind = 0;
48+
* led = 0;
4949
* }
5050
* }
5151
* }
@@ -55,10 +55,10 @@ namespace mbed {
5555
class PortIn {
5656
public:
5757

58-
/** Create an PortIn, connected to the specified port
58+
/** Create a PortIn, connected to the specified port
5959
*
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)
6262
*/
6363
PortIn(PortName port, int mask = 0xFFFFFFFF)
6464
{
@@ -67,10 +67,10 @@ class PortIn {
6767
core_util_critical_section_exit();
6868
}
6969

70-
/** Read the value currently output on the port
70+
/** Read the value input to the port
7171
*
7272
* @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
7474
*/
7575
int read()
7676
{

0 commit comments

Comments
 (0)