2021-05-11 23:26:07 -04:00
|
|
|
/*
|
2022-01-17 01:37:30 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
2021-05-11 23:26:07 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "esp_check.h"
|
|
|
|
#include "esp_lcd_panel_io.h"
|
|
|
|
#include "esp_lcd_panel_io_interface.h"
|
|
|
|
|
2022-01-21 04:42:13 -05:00
|
|
|
static const char *TAG = "lcd_panel.io";
|
2021-05-11 23:26:07 -04:00
|
|
|
|
2022-05-06 03:41:54 -04:00
|
|
|
esp_err_t esp_lcd_panel_io_rx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, void *param, size_t param_size)
|
|
|
|
{
|
|
|
|
ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "invalid panel io handle");
|
|
|
|
ESP_RETURN_ON_FALSE(io->rx_param, ESP_ERR_NOT_SUPPORTED, TAG, "rx_param is not supported yet");
|
|
|
|
return io->rx_param(io, lcd_cmd, param, param_size);
|
|
|
|
}
|
|
|
|
|
2021-08-04 08:11:31 -04:00
|
|
|
esp_err_t esp_lcd_panel_io_tx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, const void *param, size_t param_size)
|
2021-05-11 23:26:07 -04:00
|
|
|
{
|
|
|
|
ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "invalid panel io handle");
|
2021-08-04 08:11:31 -04:00
|
|
|
return io->tx_param(io, lcd_cmd, param, param_size);
|
2021-05-11 23:26:07 -04:00
|
|
|
}
|
|
|
|
|
2021-08-04 08:11:31 -04:00
|
|
|
esp_err_t esp_lcd_panel_io_tx_color(esp_lcd_panel_io_handle_t io, int lcd_cmd, const void *color, size_t color_size)
|
2021-05-11 23:26:07 -04:00
|
|
|
{
|
|
|
|
ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "invalid panel io handle");
|
2021-08-04 08:11:31 -04:00
|
|
|
return io->tx_color(io, lcd_cmd, color, color_size);
|
2021-05-11 23:26:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
esp_err_t esp_lcd_panel_io_del(esp_lcd_panel_io_handle_t io)
|
|
|
|
{
|
|
|
|
ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "invalid panel io handle");
|
|
|
|
return io->del(io);
|
|
|
|
}
|