Core2 for AWS IoT EduKit BSP  1.4.0
Display

The display screen is driven by the ILI9342C over SPI bus. The driver for ILI9342C display controller is the same as the ILI9341. The Core2 for AWS IoT EduKit BSP uses the LVGL library to interact with the ILI9342C display driver. For the documentation and API reference of the LVGL library used in the Core2 for AWS IoT EduKit BSP, visit https://docs.lvgl.io/7.11/index.html.

Before using the LVGL APIs to write to the screen, initialize the display with Core2ForAWS_Display_Init first. When performing any operations to the screen after initialization, the xGuiSemaphore FreeRTOS semaphore must be taken before calling the LVGL APIs, and released after.

Circuit Block Diagram for ILI9342C Display Controller

To enable this feature using KConfig, use the command pio run --environment core2foraws --target menuconfig from within the root of the project directory in your PlatformIO terminal window and go to the menu Component Config --> Core2 for AWS hardware enable to set the features you want to enable.

Example

The following example initializes the Core2 for AWS, which initializes the PMU for the battery and other user enabled hardware features — such as the ILI934 display controller and SPI bus. It then sets the screen brightness to 80, creates a LVGL label widget, sets the text of the label to "Hello World!", and aligns the label to the center of the screen.

#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "core2foraws.h"
#include "lvgl/lvgl.h"
void app_main(void){
xSemaphoreTake(xGuiSemaphore, portMAX_DELAY);
lv_obj_t * hello_label = lv_label_create(NULL, NULL);
lv_label_set_text_static(hello_label, "Hello World!");
lv_obj_align(hello_label, NULL, LV_ALIGN_CENTER, 0, 0);
xSemaphoreGive(xGuiSemaphore);
}
Functions to initialize and access Core2 for AWS IoT EduKit hardware features.
SemaphoreHandle_t xGuiSemaphore
FreeRTOS semaphore to be used when performing any operation on the display.
Definition: core2forAWS.c:271
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
void Core2ForAWS_Display_SetBrightness(uint8_t brightness)
Sets the brightness of the display.
Definition: core2forAWS.c:333

Variables

Functions