Skip to content

Commit

Permalink
Merge pull request espressif#126 from espressif/bsp/use_lvgl_port_in_bsp
Browse files Browse the repository at this point in the history
bsp: Use LVGL port for all BSPs with display.
  • Loading branch information
espzav authored Feb 13, 2023
2 parents 69abb8a + 1a088da commit db6d575
Show file tree
Hide file tree
Showing 34 changed files with 658 additions and 991 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
idf_component_register(
SRCS "ws_7inch.c"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "priv_include"
REQUIRES driver
PRIV_REQUIRES esp_timer esp_lcd esp_lcd_touch
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.0.1"
description: Board Support Package for WaveShare 7inch
url: https://github.com/espressif/esp-bsp/SquareLine/boards/custom_waveshare_7inch/components/ws_7inch

Expand All @@ -7,6 +7,5 @@ dependencies:
esp_lcd_ra8875: "^1"
esp_lcd_touch_gt911: "^1"

lvgl/lvgl:
version: "^8"
public: true
esp_lvgl_port:
version: ^1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/

#pragma once
#include "bsp/ws_7inch.h"
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ extern "C" {
* @brief Init I2C driver
*
*/
void bsp_i2c_init(void);
esp_err_t bsp_i2c_init(void);

/**
* @brief Deinit I2C driver and free its resources
*
*/
void bsp_i2c_deinit(void);
esp_err_t bsp_i2c_deinit(void);

/**************************************************************************************************
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/

#pragma once

#include "esp_check.h"
#include "sdkconfig.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Assert on error, if selected in menuconfig. Otherwise return error code. */
#if CONFIG_BSP_ERROR_CHECK
#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x)
#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x)
#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x)
#define BSP_NULL_CHECK(x, ret) assert(x)
#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x)
#else
#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \
esp_err_t err_rc_ = (x); \
if (unlikely(err_rc_ != ESP_OK)) { \
return err_rc_; \
} \
} while(0)

#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \
if (unlikely((x) != ESP_OK)) { \
return NULL; \
} \
} while(0)

#define BSP_NULL_CHECK(x, ret) do { \
if ((x) == NULL) { \
return ret; \
} \
} while(0)

#define BSP_ERROR_CHECK(x, ret) do { \
if (unlikely((x) != ESP_OK)) { \
return ret; \
} \
} while(0)

#define BSP_NULL_CHECK(x, ret) do { \
if ((x) == NULL) { \
return ret; \
} \
} while(0)

#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \
if ((x) == NULL) { \
goto goto_tag; \
} \
} while(0)
#endif

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit db6d575

Please sign in to comment.