Enum pl_io_num

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 the 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:

General-purpose I/O line 0 (P0.0).

1 — PL_IO_NUM_1:

General-purpose I/O line 1 (P0.1).

2 — PL_IO_NUM_2:

General-purpose I/O line 2 (P0.2).

3 — PL_IO_NUM_3:

General-purpose I/O line 3 (P0.3).

4 — PL_IO_NUM_4:

General-purpose I/O line 4 (P0.4).

5 — PL_IO_NUM_5:

General-purpose I/O line 5 (P0.5).

6 — PL_IO_NUM_6:

General-purpose I/O line 6 (P0.6).

7 — PL_IO_NUM_7:

General-purpose I/O line 7 (P0.7).

8 — PL_IO_NUM_8_RX0(1):

General-purpose I/O line 8 (P1.0). This line is also the RX/W1in/din input of serial port 0.

9 — PL_IO_NUM_9_TX0(2):

General-purpose I/O line 9 (P1.1). This line is also the TX/W1out/dout output of serial port 0.

10 — PL_IO_NUM_10_RX1(1):

General-purpose I/O line 10 (P1.2). This line is also the RX/W0&1in/din input of serial port 1.

11 — PL_IO_NUM_11_TX1(2):

General-purpose I/O line 11 (P1.3). This line is also the TX/W1out/dout output of serial port 1.

12 — PL_IO_NUM_12_RX2(1):

General-purpose I/O line 12 (P1.4). This line is also the RX/W1in/din input of serial port 2.

13 — PL_IO_NUM_13_TX2(2):

General-purpose I/O line 13 (P1.5). This line is also the TX/W1out/dout output of serial port 2.

14 — PL_IO_NUM_14_RX3(1):

General-purpose I/O line 14 (P1.6). This line is also the RX/W1in/din input of serial port 3.

15 — PL_IO_NUM_15_TX3(2):

General-purpose I/O line 15 (P1.7). This line is also the TX/W1out/dout output of serial port 3.

16 — PL_IO_NUM_16_INT0:

General-purpose I/O line 16 (P2.0). This is also interrupt line 0.

17 — PL_IO_NUM_17_INT1:

General-purpose I/O line 17 (P2.1). This is also interrupt line 1.

18 — PL_IO_NUM_18_INT2:

General-purpose I/O line 18 (P2.2). This is also interrupt line 2.

19 — PL_IO_NUM_19_INT3:

General-purpose I/O line 16 (P2.3). This is also interrupt line 3.

20 — PL_IO_NUM_20_INT4:

General-purpose I/O line 16 (P2.4). This is also interrupt line 4.

21 — PL_IO_NUM_21_INT5:

General-purpose I/O line 16 (P2.5). This is also interrupt line 5.

22 — PL_IO_NUM_22_INT6:

General-purpose I/O line 16 (P2.6). This is also interrupt line 6.

23 — PL_IO_NUM_23_INT7:

General-purpose I/O line 16 (P2.7). This is also interrupt line 7.

24 — PL_IO_NUM_24:

General-purpose I/O line 24 (does not belong to any 8-bit port).

25 — PL_IO_NUM_25:

General-purpose I/O line 25 (does not belong to any 8-bit port).

26 — PL_IO_NUM_26:

General-purpose I/O line 26 (does not belong to any 8-bit port).

27 — PL_IO_NUM_27:

General-purpose I/O line 27 (does not belong to any 8-bit port).

28 — PL_IO_NUM_28:

General-purpose I/O line 28 (does not belong to any 8-bit port).

29 — PL_IO_NUM_29_CO(3):

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 a beeper (buzzer).

30 — PL_IO_NUM_30:

General-purpose I/O line 30 (does not belong to any 8-bit port).

31 — PL_IO_NUM_31:

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.

  1. 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 an input by the application — this will not happen automatically.
  2. 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 an output by the application — this will not happen automatically.
  3. When a beeper pattern starts playing, this line is automatically configured as an output. 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.