I2S LCD 驱动

API 参考

Header File

Functions

i2s_lcd_handle_t i2s_lcd_driver_init(const i2s_lcd_config_t *config)

Initialize i2s lcd driver.

Parameters

config – configuration of i2s

Returns

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.

Parameters

handle – i2s lcd driver handle to deinitilize

Returns

  • 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.

Parameters
  • handle – i2s lcd driver handle

  • data – Data to write

Returns

  • 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.

Parameters
  • handle – Handle of i2s lcd driver

  • cmd – command to write

Returns

  • 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.

Parameters
  • handle – Handle of i2s lcd driver

  • cmd – command to write

  • length – length of command

Returns

  • 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.

Parameters
  • handle – Handle of i2s lcd driver

  • data – Pointer of data

  • length – length of data

Returns

  • 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

Parameters

handle – Handle of i2s lcd driver

Returns

Always return ESP_OK

esp_err_t i2s_lcd_release(i2s_lcd_handle_t handle)

release a lock

Parameters

handle – Handle of i2s lcd driver

Returns

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