# Parallel IO

[中文]

## Introduction

[Parallel IO Peripheral] is a general parallel interface that can be used to connect external devices such as LED matrices, LCD displays, printers, and cameras. This peripheral has independent TX and RX units. Each unit can have up to 8 or 16 data signals and 1 or 2 clock signals.

The TX and RX drivers of the Parallel IO peripheral are independently designed and can be used by including the header files `driver/parlio_tx.h` or `driver/parlio_rx.h`.

- Parallel IO TX Driver
- Parallel IO RX Driver

## API Reference

### Header File

- components/esp_driver_parlio/include/driver/parlio_types.h

- This header file can be included with:

  >     #include "driver/parlio_types.h"

- This header file is a part of the API provided by the `esp_driver_parlio` component. To declare that your component depends on `esp_driver_parlio`, add the following to your CMakeLists.txt:

  >     REQUIRES esp_driver_parlio

  > or

  >     PRIV_REQUIRES esp_driver_parlio

### Structures

struct parlio_tx_done_event_data_t

  Type of Parallel IO TX done event data.

### Type Definitions

typedef struct parlio_tx_unit_t *parlio_tx_unit_handle_t

  Type of Parallel IO TX unit handle.

typedef struct parlio_rx_unit_t *parlio_rx_unit_handle_t

  Type of Parallel IO RX unit handle.

typedef struct parlio_rx_delimiter_t *parlio_rx_delimiter_handle_t

  Type of Parallel IO RX frame delimiter handle.

typedef bool (*parlio_tx_done_callback_t)(parlio_tx_unit_handle_t tx_unit, const parlio_tx_done_event_data_t *edata, void *user_ctx)

  Prototype of parlio tx event callback.

  Param tx_unit:

    [in] Parallel IO TX unit that created by `parlio_new_tx_unit`

  Param edata:

    [in] Point to Parallel IO TX event data. The lifecycle of this pointer memory is inside this function, user should copy it into static memory if used outside this function.

  Param user_ctx:

    [in] User registered context, passed from `parlio_tx_unit_register_event_callbacks`

  Return:

    Whether a high priority task has been waken up by this callback function

### Header File

- components/hal/include/hal/parlio_types.h

- This header file can be included with:

  >     #include "hal/parlio_types.h"

### Macros

PARLIO_TX_UNIT_MAX_DATA_WIDTH

  Maximum data width of TX unit.

PARLIO_RX_UNIT_MAX_DATA_WIDTH

  Maximum data width of RX unit.

### Type Definitions

typedef soc_periph_parlio_clk_src_t parlio_clock_source_t

  Parallel IO clock source.

  Note

  User should select the clock source based on the power and resolution requirement

### Enumerations

enum parlio_sample_edge_t

  Parallel IO sample edge.

  Values:

  enumerator PARLIO_SAMPLE_EDGE_NEG

    Sample data on falling edge of clock

  enumerator PARLIO_SAMPLE_EDGE_POS

    Sample data on rising edge of clock

enum parlio_bit_pack_order_t

  Parallel IO bit packing order.

  Data in memory: Byte 0: MSB < B0.7 B0.6 B0.5 B0.4 B0.3 B0.2 B0.1 B0.0 > LSB Byte 1: MSB < B1.7 B1.6 B1.5 B1.4 B1.3 B1.2 B1.1 B1.0 > LSB

  Output on line (PARLIO_BIT_PACK_ORDER_LSB): Cycle 0 Cycle 1 Cycle 2 —> time GPIO 0: B0.0 B0.4 B1.0 GPIO 1: B0.1 B0.5 B1.1 GPIO 2: B0.2 B0.6 B1.2 GPIO 3: B0.3 B0.7 B1.3

  Output on line (PARLIO_BIT_PACK_ORDER_MSB): Cycle 0 Cycle 1 Cycle 2 —> time GPIO 0: B0.4 B0.0 B1.4 GPIO 1: B0.5 B0.1 B1.5 GPIO 2: B0.6 B0.2 B1.6 GPIO 3: B0.7 B0.3 B1.7

  Values:

  enumerator PARLIO_BIT_PACK_ORDER_LSB

    Bit pack order: LSB

  enumerator PARLIO_BIT_PACK_ORDER_MSB

    Bit pack order: MSB

Was this page helpful?

- Thank you! We received your feedback.
- If you have any comments, fill in Espressif Documentation Feedback Form.

- We value your feedback.
- Let us know how we can improve this page by filling in Espressif Documentation Feedback Form.