I2S LCD 驱动

API 参考

Header File

Functions

i2s_lcd_handle_t i2s_lcd_driver_init(const i2s_lcd_config_t *config)

Initialize i2s lcd driver.

参数

config – configuration of i2s

返回

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

esp_err_t i2s_lcd_driver_deinit(i2s_lcd_handle_t handle)

Deinit i2s lcd driver.

参数

handle – i2s lcd driver handle to deinitilize

返回

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

esp_err_t i2s_lcd_write_data(i2s_lcd_handle_t handle, uint16_t data)

Write a data to LCD.

参数
  • handle – i2s lcd driver handle

  • data – Data to write

返回

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

esp_err_t i2s_lcd_write_cmd(i2s_lcd_handle_t handle, uint16_t cmd)

Write a command to LCD.

参数
  • handle – Handle of i2s lcd driver

  • cmd – command to write

返回

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

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

Write a command to LCD.

参数
  • handle – Handle of i2s lcd driver

  • cmd – command to write

  • length – length of command

返回

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

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

Write block data to LCD.

参数
  • handle – Handle of i2s lcd driver

  • data – Pointer of data

  • length – length of data

返回

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG handle is invalid

esp_err_t i2s_lcd_acquire(i2s_lcd_handle_t handle)

acquire a lock

参数

handle – Handle of i2s lcd driver

返回

Always return ESP_OK

esp_err_t i2s_lcd_release(i2s_lcd_handle_t handle)

release a lock

参数

handle – Handle of i2s lcd driver

返回

Always return ESP_OK

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