I2S LCD 驱动

API 参考

Header File

Functions

i2s_lcd_handle_t i2s_lcd_driver_init(const i2s_lcd_config_t *config)

Initilize i2s lcd driver.

Return

A handle to the created i2s lcd driver, or NULL in case of error.

Parameters
  • config: configuration of i2s

esp_err_t i2s_lcd_driver_deinit(i2s_lcd_handle_t handle)

Deinit i2s lcd driver.

Return

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

Parameters
  • handle: i2s lcd driver handle to deinitilize

esp_err_t i2s_lcd_write_data(i2s_lcd_handle_t handle, uint16_t data)

Write a data to LCD.

Return

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

Parameters
  • handle: i2s lcd driver handle

  • data: Data to write

esp_err_t i2s_lcd_write_cmd(i2s_lcd_handle_t handle, uint16_t cmd)

Write a command to LCD.

Return

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

Parameters
  • handle: Handle of i2s lcd driver

  • cmd: command to write

esp_err_t i2s_lcd_write_command(i2s_lcd_handle_t handle, const uint8_t *cmd, uint32_t length)

Write a command to LCD.

Return

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

Parameters
  • handle: Handle of i2s lcd driver

  • cmd: command to write

  • length: length of command

esp_err_t i2s_lcd_write(i2s_lcd_handle_t handle, const uint8_t *data, uint32_t length)

Write block data to LCD.

Return

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

Parameters
  • handle: Handle of i2s lcd driver

  • data: Pointer of data

  • length: length of data

esp_err_t i2s_lcd_acquire(i2s_lcd_handle_t handle)

acquire a lock

Return

Always return ESP_OK

Parameters
  • handle: Handle of i2s lcd driver

esp_err_t i2s_lcd_release(i2s_lcd_handle_t handle)

release a lock

Return

Always return ESP_OK

Parameters
  • handle: Handle of i2s lcd driver

Structures

struct i2s_lcd_config_t

Configuration of i2s lcd mode.

Handle of i2s lcd driver

Public Members

int8_t data_width

Parallel data width, 16bit or 8bit available

int8_t pin_data_num[16]

Parallel data output IO

int8_t pin_num_cs

CS io num

int8_t pin_num_wr

Write clk io

int8_t pin_num_rs

RS io num

int clk_freq

I2s clock frequency

i2s_port_t i2s_port

I2S port number

bool swap_data

Swap the 2 bytes of RGB565 color

uint32_t buffer_size

DMA buffer size

Macros

LCD_CMD_LEV
LCD_DATA_LEV

Type Definitions

typedef void *i2s_lcd_handle_t