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_RX0_INT0(1):

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

1 — PL_IO_NUM_1_TX0_INT1(2):

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

2 — PL_IO_NUM_2_RX1_INT2(1):

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

3 — PL_IO_NUM_3_TX1_INT3(2):

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

4 — PL_IO_NUM_4_RX2_INT4(1):

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

5 — PL_IO_NUM_5_TX2_INT5(2):

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

6 — PL_IO_NUM_6_RX3_INT6(1):

General-purpose I/O line 6 (P0.6). This line is also the RX/W0&1in/din input of serial port 3 and interrupt line 6.

7 — PL_IO_NUM_7_TX3_INT7(2):

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

8 — PL_IO_NUM_8:

General-purpose I/O line 8 (P1.0).

9 — PL_IO_NUM_9:

General-purpose I/O line 9 (P1.1).

10 — PL_IO_NUM_10:

General-purpose I/O line 10 (P1.2).

11 — PL_IO_NUM_11:

General-purpose I/O line 11 (P1.3).

12 — PL_IO_NUM_12:

General-purpose I/O line 12 (P1.4).

13 — PL_IO_NUM_13:

General-purpose I/O line 13 (P1.5).

14 — PL_IO_NUM_14:

General-purpose I/O line 14 (P1.6).

15 — PL_IO_NUM_15:

General-purpose I/O line 15 (P1.7).

16 — PL_IO_NUM_16_CO(3):

General-purpose I/O line 16 (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).

17 — 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.