Enum pl_io_num contains the list of constants that refer to available GPIO lines. Use these constants when selecting the line with the io. object (see the io.num property).
Note that GPIO lines are of unidirectional type and require explicit configuration as outputs or inputs. Some lines are configured as inputs or outputs automatically — see the notes at the bottom of the page.
Enum pl_io_num includes the following constants:
0- PL_IO_NUM_0: | Selects general-purpose I/O line 0 (P0.0). |
1- PL_IO_NUM_1: | Selects general-purpose I/O line 1 (P0.1). |
2- PL_IO_NUM_2: | Selects general-purpose I/O line 2 (P0.2). |
3- PL_IO_NUM_3: | Selects general-purpose I/O line 3 (P0.3). |
4- PL_IO_NUM_4: | Selects general-purpose I/O line 4 (P0.4). |
5- PL_IO_NUM_5: | Selects general-purpose I/O line 5 (P0.5). |
6- PL_IO_NUM_6: | Selects general-purpose I/O line 6 (P0.6). |
7- PL_IO_NUM_7: | Selects general-purpose I/O line 7 (P0.7). |
8- PL_IO_NUM_8_RX0(1): | Selects general-purpose I/O line 8 (P1.0). This line is also the RX/W1in/din input of the serial port 0. |
9- PL_IO_NUM_9_TX0(2): | Selects general-purpose I/O line 9 (P1.1). This line is also the TX/W1out/dout output of the serial port 0. |
10- PL_IO_NUM_10_RX1(1): | Selects general-purpose I/O line 10 (P1.2). This line is also the RX/W0&1in/din input of the serial port 1. |
11- PL_IO_NUM_11_TX1(2): | Selects general-purpose I/O line 11 (P1.3). This line is also the TX/W1out/dout output of the serial port 1. |
12- PL_IO_NUM_12_RX2(1): | Selects general-purpose I/O line 12 (P1.4). This line is also the RX/W0&1in/din input of the serial port 2. |
13- PL_IO_NUM_13_TX2(2): | Selects general-purpose I/O line 13 (P1.5). This line is also the TX/W1out/dout output of the serial port 2. |
14- PL_IO_NUM_14_RX3(1): | Selects general-purpose I/O line 14 (P1.6). This line is also the RX/W0&1in/din input of the serial port 3. |
15- PL_IO_NUM_15_TX3(2): | Selects general-purpose I/O line 15 (P1.7). This line is also the TX/W1out/dout output of the serial port 3. |
16- PL_IO_NUM_16_INT0: | Selects general-purpose I/O line 16 (P2.0). This is also the interrupt line 0. |
17- PL_IO_NUM_17_INT1: | Selects general-purpose I/O line 17 (P2.1). This is also the interrupt line 1. |
18- PL_IO_NUM_18_INT2: | Selects general-purpose I/O line 18 (P2.2). This is also the interrupt line 2. |
19- PL_IO_NUM_19_INT3: | Selects general-purpose I/O line 19 (P2.3). This is also the interrupt line 3. |
20- PL_IO_NUM_20_INT4: | Selects general-purpose I/O line 20 (P2.4). This is also the interrupt line 4. |
21- PL_IO_NUM_21_INT5: | Selects general-purpose I/O line 21 (P2.5). This is also the interrupt line 5. |
22- PL_IO_NUM_22_INT6: | Selects general-purpose I/O line 22 (P2.6). This is also the interrupt line 6. |
23- PL_IO_NUM_23_INT7: | Selects general-purpose I/O line 23 (P2.7). This is also the interrupt line 7. |
24- PL_IO_NUM_24: | Selects general-purpose I/O line 24 (does not belong to any 8-bit port). |
25- PL_IO_NUM_25: | Selects general-purpose I/O line 25 (does not belong to any 8-bit port). |
26- PL_IO_NUM_26: | Selects general-purpose I/O line 26 (does not belong to any 8-bit port). |
27- PL_IO_NUM_27: | Selects general-purpose I/O line 27 (does not belong to any 8-bit port). |
28- PL_IO_NUM_28: | Selects general-purpose I/O line 28 (does not belong to any 8-bit port). |
29- PL_IO_NUM_29_CO(3): | Selects general-purpose I/O line 29 (does not belong to any 8-bit port). This line is also used by the beep object to generate square wave output that is primarily intended for driving beeper (buzzer). |
30- PL_IO_NUM_30: | Selects general-purpose I/O line 30 (does not belong to any 8-bit port). |
31- PL_IO_NUM_31: | Selects general-purpose I/O line 31 (does not belong to any 8-bit port). |
32- PL_IO_NULL: | This is a NULL line that does not physically exist. The state of this line is always detected as LOW. Setting this line has no effect. |
Notes:
- When a serial port is in the UART mode (ser.mode= 0- PL_SER_MODE_UART) this line is automatically configured to be an input when this serial port is enabled (ser.enabled= 1- YES) and returns to the previous input/output and high/low state when this serial port is closed (ser.enabled= 0- NO). When a serial port is in the Wiegand or clock/data mode (ser.mode= 1- PL_SER_MODE_WIEGAND or ser.mode= 2- PL_SER_MODE_CLOCKDATA), the line has to be configured as input by the application- this will not happen automatically.
- When a serial port is in the UART mode (ser.mode= 0- PL_SER_MODE_UART) this line is automatically configured to be an output when the serial port is enabled (ser.enabled= 1- YES) and returns to the previous input/output and high/low state when the serial port is closed (ser.enabled= 0- NO). When a serial port is in the Wiegand or clock/data mode (ser.mode= 1- PL_SER_MODE_WIEGAND or ser.mode= 2- PL_SER_MODE_CLOCKDATA), the line has to be configured as output by the application- this will not happen automatically.
- When the beeper pattern stars playing, this line is configured as output automatically. When the beeper pattern stops playing, the output returns to the input/output and high/low state that it had before the pattern started playing.