forked from espressif/esp-idf
feat(esp_lcd): Add API to sleep and wakeup the LCD panel
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -133,6 +133,17 @@ esp_err_t esp_lcd_panel_disp_on_off(esp_lcd_panel_handle_t panel, bool on_off);
|
|||||||
esp_err_t esp_lcd_panel_disp_off(esp_lcd_panel_handle_t panel, bool off)
|
esp_err_t esp_lcd_panel_disp_off(esp_lcd_panel_handle_t panel, bool off)
|
||||||
__attribute__((deprecated("use esp_lcd_panel_disp_on_off instead")));
|
__attribute__((deprecated("use esp_lcd_panel_disp_on_off instead")));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enter or exit sleep mode
|
||||||
|
*
|
||||||
|
* @param[in] panel LCD panel handle, which is created by other factory API like `esp_lcd_new_panel_st7789()`
|
||||||
|
* @param[in] sleep True to enter sleep mode, False to wake up
|
||||||
|
* @return
|
||||||
|
* - ESP_OK on success
|
||||||
|
* - ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
|
||||||
|
*/
|
||||||
|
esp_err_t esp_lcd_panel_disp_sleep(esp_lcd_panel_handle_t panel, bool sleep);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -120,6 +120,17 @@ struct esp_lcd_panel_t {
|
|||||||
*/
|
*/
|
||||||
esp_err_t (*disp_on_off)(esp_lcd_panel_t *panel, bool on_off);
|
esp_err_t (*disp_on_off)(esp_lcd_panel_t *panel, bool on_off);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enter or exit sleep mode
|
||||||
|
*
|
||||||
|
* @param[in] panel LCD panel handle, which is created by other factory API like `esp_lcd_new_panel_st7789()`
|
||||||
|
* @param[in] sleep True to enter sleep mode, False to wake up
|
||||||
|
* @return
|
||||||
|
* - ESP_OK on success
|
||||||
|
* - ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
|
||||||
|
*/
|
||||||
|
esp_err_t (*disp_sleep)(esp_lcd_panel_t *panel, bool sleep);
|
||||||
|
|
||||||
void *user_data; /*!< User data, used to store externally customized data */
|
void *user_data; /*!< User data, used to store externally customized data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -68,3 +68,10 @@ esp_err_t esp_lcd_panel_disp_off(esp_lcd_panel_handle_t panel, bool off)
|
|||||||
{
|
{
|
||||||
return esp_lcd_panel_disp_on_off(panel, !off);
|
return esp_lcd_panel_disp_on_off(panel, !off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_lcd_panel_disp_sleep(esp_lcd_panel_handle_t panel, bool sleep)
|
||||||
|
{
|
||||||
|
ESP_RETURN_ON_FALSE(panel, ESP_ERR_INVALID_ARG, TAG, "invalid panel handle");
|
||||||
|
ESP_RETURN_ON_FALSE(panel->disp_sleep, ESP_ERR_NOT_SUPPORTED, TAG, "sleep is not supported by this panel");
|
||||||
|
return panel->disp_sleep(panel, sleep);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user