Skip to content

Commit

Permalink
feat(wrover): Add noglib configuration for Wrover Kit
Browse files Browse the repository at this point in the history
  • Loading branch information
tore-espressif committed Aug 13, 2024
1 parent d4e80fd commit db6c188
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/upload_component_noglib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Upload noglib version of BSPs
# TODO: Extend this part to all BSPs
env:
BSPs: "bsp/esp32_s3_eye bsp/esp32_p4_function_ev_board bsp/m5stack_core_s3 bsp/m5dial"
BSPs: "bsp/esp_wrover_kit bsp/esp32_s3_eye bsp/esp32_p4_function_ev_board bsp/m5stack_core_s3 bsp/m5dial"
run: |
pip install idf-component-manager==1.* py-markdown-table --upgrade
python .github/ci/bsp_noglib.py ${BSPs}
Expand All @@ -27,6 +27,7 @@ jobs:
bsp/esp32_p4_function_ev_board_noglib;
bsp/m5stack_core_s3_noglib;
bsp/m5dial_noglib;
bsp/esp_wrover_kit_noglib;
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
dry_run: ${{ github.ref_name != 'master' || github.repository_owner != 'espressif' }}
Expand Down
1 change: 1 addition & 0 deletions bsp/esp_wrover_kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Most of the ESP32 I/O pins are broken out to the board’s pin headers for easy
| LED |:heavy_check_mark:| idf | >=4.4.5 |
| SDCARD |:heavy_check_mark:| idf | >=4.4.5 |
| IMU | :x: | | |
| CAMERA | :x: | | |
<!-- Autogenerated end: Dependencies -->
3 changes: 2 additions & 1 deletion bsp/esp_wrover_kit/esp_wrover_kit.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "bsp/esp_wrover_kit.h"
#include "bsp/display.h"
#include "bsp_err_check.h"
#include "esp_lvgl_port.h"

static const char *TAG = "Wrover";

Expand Down Expand Up @@ -264,6 +263,7 @@ esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_hand
return ret;
}

#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0)
static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
Expand Down Expand Up @@ -354,3 +354,4 @@ void bsp_display_unlock(void)
{
lvgl_port_unlock();
}
#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0)
16 changes: 16 additions & 0 deletions bsp/esp_wrover_kit/include/bsp/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

/**************************************************************************************************
* BSP configuration
**************************************************************************************************/
// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it.
// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix.
#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...)
#define BSP_CONFIG_NO_GRAPHIC_LIB (0)
#endif
39 changes: 23 additions & 16 deletions bsp/esp_wrover_kit/include/bsp/esp_wrover_kit.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
#include "driver/gpio.h"
#include "driver/sdmmc_host.h"
#include "sdkconfig.h"
#include "lvgl.h"
#include "iot_button.h"
#include "esp_lvgl_port.h"
#include "bsp/config.h"
#include "bsp/display.h"

#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0)
#include "lvgl.h"
#include "esp_lvgl_port.h"
#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0

/**************************************************************************************************
* BSP Capabilities
**************************************************************************************************/
Expand All @@ -31,6 +36,7 @@
#define BSP_CAPS_LED 1
#define BSP_CAPS_SDCARD 1
#define BSP_CAPS_IMU 0
#define BSP_CAPS_CAMERA 0

/**************************************************************************************************
* ESP-WROVER-KIT pinout
Expand Down Expand Up @@ -77,20 +83,6 @@ typedef enum {
BSP_BUTTON_NUM
} bsp_button_t;

/**
* @brief BSP display configuration structure
*
*/
typedef struct {
lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */
uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */
bool double_buffer; /*!< True, if should be allocated two buffers */
struct {
unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */
unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */
} flags;
} bsp_display_cfg_t;

/**************************************************************************************************
*
* SPIFFS
Expand Down Expand Up @@ -257,9 +249,23 @@ esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int b
#define BSP_LCD_PIXEL_CLOCK_HZ (40 * 1000 * 1000)
#define BSP_LCD_SPI_NUM (SPI2_HOST)

#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0)
#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * 30)
#define BSP_LCD_DRAW_BUFF_DOUBLE (1)

/**
* @brief BSP display configuration structure
*/
typedef struct {
lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */
uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */
bool double_buffer; /*!< True, if should be allocated two buffers */
struct {
unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */
unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */
} flags;
} bsp_display_cfg_t;

/**
* @brief Initialize display
*
Expand Down Expand Up @@ -314,6 +320,7 @@ void bsp_display_unlock(void);
* @param[in] rotation Angle of the display rotation
*/
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation);
#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0

#ifdef __cplusplus
}
Expand Down

0 comments on commit db6c188

Please sign in to comment.