### LVGL Button Simple Example Source: https://docs.lvgl.io/9.1 Demonstrates the creation of a basic LVGL button widget. This example covers the fundamental steps of creating a button, setting its text, and positioning it on the screen. It serves as a starting point for more complex button interactions. ```c #include "lvgl.h" void button_simple_example(lv_obj_t * parent) { lv_obj_t * btn = lv_button_create(parent); lv_obj_set_size(btn, 100, 40); lv_obj_center(btn); lv_obj_t * label = lv_label_create(btn); lv_label_set_text(label, "Click Me"); lv_obj_center(label); lv_obj_invalidate(btn); } ``` -------------------------------- ### LVGL List Simple Example Source: https://docs.lvgl.io/9.1 Demonstrates the basic usage of the LVGL list widget. This example shows how to create a list and add buttons to it, which typically represent list items. It covers the fundamental structure for building scrollable lists. ```c #include "lvgl.h" void list_simple_example(lv_obj_t * parent) { lv_obj_t * list = lv_list_create(parent); lv_obj_set_size(list, 200, 250); lv_obj_center(list); // Add buttons to the list lv_obj_t * btn1 = lv_list_add_btn(list, LV_SYMBOL_FILE, "File 1"); lv_obj_t * btn2 = lv_list_add_btn(list, LV_SYMBOL_EDIT, "Edit File"); lv_obj_t * btn3 = lv_list_add_btn(list, LV_SYMBOL_SAVE, "Save"); lv_obj_t * btn4 = lv_list_add_btn(list, LV_SYMBOL_DELETE, "Delete"); // You can add text elements as well // lv_obj_t * txt = lv_list_add_text(list, "A header"); lv_obj_invalidate(list); } ``` -------------------------------- ### LVGL LED Custom Style Example Source: https://docs.lvgl.io/9.1 Demonstrates how to create and style an LVGL LED widget. This example shows how to set the LED's color and brightness, and how to toggle its state. Custom styles can be applied to change the appearance of the LED. ```c #include "lvgl.h" void led_custom_style_example(lv_obj_t * parent) { lv_obj_t * led = lv_led_create(parent); lv_obj_center(led); // Set LED color lv_led_set_color(led, lv_palette_main(LV_PALETTE_GREEN)); // Set LED brightness (0-255) lv_led_set_brightness(led, 150); // Toggle the LED on/off // lv_led_on(led); // lv_led_off(led); // lv_led_toggle(led); // Apply custom style (example: change size and border) lv_obj_set_style_bg_color(led, lv_palette_main(LV_PALETTE_BLUE), LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_radius(led, 0, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_border_width(led, 2, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_border_color(led, lv_palette_darken(LV_PALETTE_BLUE, 4), LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_size(led, 50, 50); lv_obj_invalidate(led); } ``` -------------------------------- ### LVGL Checkbox Simple Example Source: https://docs.lvgl.io/9.1 Provides a basic example of creating and using LVGL checkbox widgets. This covers setting the checkbox text and demonstrating how to check, uncheck, and disable the checkboxes programmatically. It also shows how checkboxes can function as radio buttons. ```c #include "lvgl.h" void checkbox_simple_example(lv_obj_t * parent) { lv_obj_t * cb1 = lv_checkbox_create(parent); lv_checkbox_set_text(cb1, "Option 1"); lv_obj_set_pos(cb1, 20, 20); lv_obj_t * cb2 = lv_checkbox_create(parent); lv_checkbox_set_text(cb2, "Option 2"); lv_obj_set_pos(cb2, 20, 60); // Check a checkbox // lv_obj_set_state(cb1, LV_STATE_CHECKED); // Uncheck a checkbox // lv_obj_clear_state(cb1, LV_STATE_CHECKED); // Disable a checkbox // lv_obj_add_state(cb2, LV_STATE_DISABLED); // Example of checkboxes as radio buttons (grouping) // lv_obj_t * radio1 = lv_checkbox_create(parent); // lv_checkbox_set_text(radio1, "Radio 1"); // lv_checkbox_set_group(radio1, NULL); // Assign to a group // lv_obj_add_state(radio1, LV_STATE_USER_1); // Mark as radio button // lv_obj_set_pos(radio1, 20, 100); // lv_obj_t * radio2 = lv_checkbox_create(parent); // lv_checkbox_set_text(radio2, "Radio 2"); // lv_checkbox_set_group(radio2, NULL); // Assign to the same group // lv_obj_add_state(radio2, LV_STATE_USER_1); // Mark as radio button // lv_obj_set_pos(radio2, 20, 140); lv_obj_invalidate(cb1); lv_obj_invalidate(cb2); } ``` -------------------------------- ### LVGL Line Drawing Example Source: https://docs.lvgl.io/9.1 Provides an example of creating and drawing a line using the LVGL line widget. This includes setting the points that define the line and configuring its appearance, such as color and width. The auto-size and invert y options are also mentioned. ```c #include "lvgl.h" void line_simple_example(lv_obj_t * parent) { lv_obj_t * line = lv_line_create(parent); // Define the points of the line static lv_point_t points[] = { {0, 0}, {100, 50}, {150, -50} }; lv_line_set_points(line, points, 3); // Set line color lv_obj_set_style_line_color(line, lv_palette_main(LV_PALETTE_RED), 0); // Set line width lv_obj_set_style_line_width(line, 3, 0); // Enable auto-size (line will be sized to fit the points) // lv_line_set_auto_size(line, true); // Invert the y-axis direction // lv_line_set_y_invert(line, true); lv_obj_center(line); lv_obj_invalidate(line); } ``` -------------------------------- ### LVGL Keyboard with Text Area Example Source: https://docs.lvgl.io/9.1 Demonstrates integrating an LVGL keyboard widget with a text area. This allows users to input text into the text area using the on-screen keyboard. The example covers assigning the keyboard to a text area and handling key presses. ```c #include "lvgl.h" void keyboard_textarea_example(lv_obj_t * parent) { lv_obj_t * ta = lv_textarea_create(parent); lv_obj_set_width(ta, 300); lv_obj_set_height(ta, 100); lv_obj_center(ta); lv_textarea_set_placeholder_text(ta, "Write something..."); lv_obj_t * kb = lv_keyboard_create(parent); lv_keyboard_set_textarea(kb, ta); // Set keyboard mode (e.g., text, numbers, symbols) // lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_TEXT_UPPER); // Assign a custom keymap // static const char * map[] = {"a", "b", "c", "\n", "d", "e", "f", "\n", "g", "h", "i", ""}; // lv_keyboard_set_map(kb, LV_KEYBOARD_MODE_USER_1, map, 100); // lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_USER_1); lv_obj_invalidate(ta); lv_obj_invalidate(kb); } ``` -------------------------------- ### LVGL Chart Line Chart Example Source: https://docs.lvgl.io/9.1 Illustrates the creation and configuration of a line chart using the LVGL chart widget. This example focuses on setting up data series, defining the chart type, and displaying data points. It also covers axis tick and label customization for better data visualization. ```c #include "lvgl.h" void chart_line_example(lv_obj_t * parent) { lv_obj_t * chart = lv_chart_create(parent); lv_chart_set_type(chart, LV_CHART_TYPE_LINE); lv_obj_set_size(chart, 200, 150); lv_obj_center(chart); // Add a data series lv_chart_series_t * ser1 = lv_chart_add_series(chart, lv_palette_main(LV_PALETTE_RED), LV_CHART_ORDER_NORMAL); // Set data points lv_chart_set_point_count(chart, 10); lv_chart_set_next_value(chart, ser1, 5); lv_chart_set_next_value(chart, ser1, 10); lv_chart_set_next_value(chart, ser1, 8); lv_chart_set_next_value(chart, ser1, 12); lv_chart_set_next_value(chart, ser1, 10); lv_chart_set_next_value(chart, ser1, 15); lv_chart_set_next_value(chart, ser1, 13); lv_chart_set_next_value(chart, ser1, 18); lv_chart_set_next_value(chart, ser1, 16); lv_chart_set_next_value(chart, ser1, 20); // Configure axes lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 0, 5, 2, true, "m"); lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 10, 0, 5, 2, true, "s"); // Enable scrolling for ticks and labels lv_chart_set_update_mode(chart, LV_CHART_UPDATE_MODE_SHIFT); lv_obj_invalidate(chart); } ``` -------------------------------- ### LVGL Canvas Drawing Example Source: https://docs.lvgl.io/9.1 Demonstrates drawing various shapes and elements onto an LVGL canvas widget. Includes examples for rectangles, labels, arcs, images, lines, and vector graphics. It also shows how to rotate the canvas content and handle transparency with chroma keying. ```c #include "lvgl.h" void canvas_example(lv_obj_t * parent) { lv_obj_t * canvas = lv_canvas_create(parent); lv_canvas_set_size(canvas, 200, 150); lv_obj_center(canvas); // Draw a rectangle lv_draw_rect_dsc_t rect_dsc; lv_draw_rect_dsc_init(&rect_dsc); rect_dsc.bg_color = lv_color_make(0x55, 0x66, 0x77); rect_dsc.border_color = lv_color_black(); rect_dsc.border_width = 2; lv_canvas_draw_rect(canvas, 10, 10, 100, 50, &rect_dsc); // Draw a label lv_draw_label_dsc_t label_dsc; lv_draw_label_dsc_init(&label_dsc); label_dsc.color = lv_color_white(); lv_canvas_draw_label(canvas, 20, 20, 100, &label_dsc, "Hello LVGL"); // Draw an arc lv_draw_arc_dsc_t arc_dsc; lv_draw_arc_dsc_init(&arc_dsc); arc_dsc.color = lv_color_red(); arc_dsc.width = 5; lv_canvas_draw_arc(canvas, 150, 75, 40, 0, 90, &arc_dsc); // Draw a line lv_draw_line_dsc_t line_dsc; lv_draw_line_dsc_init(&line_dsc); line_dsc.color = lv_color_green(); line_dsc.width = 3; lv_canvas_draw_line(canvas, (lv_point_t[]){{10, 100}, {190, 100}}, 2, &line_dsc); // Draw an image (assuming 'img_src' is a valid lv_img_src_t) // lv_canvas_draw_image(canvas, 10, 110, 50, 50, img_src, NULL); // Draw a vector graphic (assuming 'vec_src' is a valid lv_draw_vector_dsc_t) // lv_canvas_draw_vector(canvas, 100, 110, 50, 50, vec_src, NULL); // Apply rotation // lv_canvas_rotate(canvas, 45); // Apply chroma keying for transparency // lv_canvas_set_chroma_key(canvas, LV_COLOR_WHITE); lv_canvas_invalidate(canvas); } ``` -------------------------------- ### File Explorer API Source: https://docs.lvgl.io/9.1 API documentation for the File Explorer widget, including usage, events, and examples for customization. ```APIDOC ## File Explorer API ### Description This section provides the API documentation for the File Explorer widget, covering its usage, event handling, and examples for creating and controlling file explorers. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL Dropdown List Example Source: https://docs.lvgl.io/9.1 Demonstrates how to create and manage a dropdown list widget in LVGL. This includes setting options, retrieving the selected option, controlling the list's direction, and displaying a symbol. It also shows how to manually open and close the dropdown. ```c #include "lvgl.h" void dropdown_example(lv_obj_t * parent) { lv_obj_t * dropdown = lv_dropdown_create(parent); lv_dropdown_set_options(dropdown, "Option 1\nOption 2\nOption 3\nOption 4"); lv_obj_set_width(dropdown, 150); lv_obj_center(dropdown); // Set a default selected option (e.g., the second one) lv_dropdown_set_selected(dropdown, 1); // Set the direction of the list lv_dropdown_set_dir(dropdown, LV_DIR_BOTTOM); // Add a symbol to the button lv_dropdown_set_symbol(dropdown, LV_SYMBOL_DOWN); // Show the selected option lv_dropdown_set_show_selected(dropdown, true); // Manually open the dropdown // lv_dropdown_open(dropdown); // Manually close the dropdown // lv_dropdown_close(dropdown); // Get the selected option index // uint16_t sel_idx = lv_dropdown_get_selected(dropdown); // Get the selected option text // char buf[32]; // lv_dropdown_get_selected_str(dropdown, buf, sizeof(buf)); lv_obj_invalidate(dropdown); } ``` -------------------------------- ### LVGL Image Button Example Source: https://docs.lvgl.io/9.1 Shows how to create an image button widget in LVGL. This involves specifying different image sources for various button states (released, pressed, disabled). It allows for visually distinct button appearances based on user interaction. ```c #include "lvgl.h" void image_button_example(lv_obj_t * parent) { // Assume img_btn_released, img_btn_pressed, img_btn_disabled are valid lv_img_src_t static const void * img_btn_released = NULL; // Replace with actual image source static const void * img_btn_pressed = NULL; // Replace with actual image source static const void * img_btn_disabled = NULL; // Replace with actual image source lv_obj_t * imgbtn = lv_imagebutton_create(parent); // Set image sources for different states lv_imagebutton_set_src(imgbtn, LV_IMAGEBUTTON_STATE_RELEASED, img_btn_released); lv_imagebutton_set_src(imgbtn, LV_IMAGEBUTTON_STATE_PRESSED, img_btn_pressed); lv_imagebutton_set_src(imgbtn, LV_IMAGEBUTTON_STATE_DISABLED, img_btn_disabled); lv_obj_center(imgbtn); lv_obj_invalidate(imgbtn); } ``` -------------------------------- ### Grid Navigation API Source: https://docs.lvgl.io/9.1 API documentation for Grid Navigation, including usage with focusable objects and examples for various navigation scenarios. ```APIDOC ## Grid Navigation API ### Description This section details the API for Grid Navigation, which allows for structured navigation between focusable objects using a grid-like pattern. Examples cover basic navigation, list navigation, and nested grids. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Monkey API Source: https://docs.lvgl.io/9.1 API documentation for the Monkey input device, including examples for touchpad, encoder, and button interactions. ```APIDOC ## Monkey API ### Description This section provides the API documentation for the Monkey input device, covering its usage with various input methods like touchpads, encoders, and buttons. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL Image Recolor Example Source: https://docs.lvgl.io/9.1 Demonstrates how to recolor an image displayed using the LVGL image widget. This allows changing the color tint of an image dynamically, which can be useful for effects or adapting images to different themes. ```c #include "lvgl.h" void image_recolor_example(lv_obj_t * parent) { // Assume 'img_src' is a valid lv_img_src_t static const void * img_src = NULL; // Replace with actual image source lv_obj_t * img = lv_image_create(parent); lv_image_set_src(img, img_src); lv_obj_center(img); // Recolor the image to red lv_image_set_recolor(img, lv_color_red()); // Set the recolor alpha value (0-255) // lv_image_set_recolor_opa(img, 128); lv_obj_invalidate(img); } ``` -------------------------------- ### LVGL Button Matrix Custom Buttons Example Source: https://docs.lvgl.io/9.1 Illustrates creating a button matrix with custom button appearances in LVGL. This involves defining a custom map for the buttons and potentially styling individual buttons within the matrix to achieve unique visual designs. ```c #include "lvgl.h" void button_matrix_custom_example(lv_obj_t * parent) { // Define a custom button map static const char * map[] = {"1", "2", "3", "\n", "4", "5", "6", "\n", "7", "8", "9", "\n", "Clear", "0", "Ok", ""}; lv_obj_t * btnm = lv_buttonmatrix_create(parent); lv_buttonmatrix_set_map(btnm, map); lv_obj_set_size(btnm, 200, 150); lv_obj_center(btnm); // Example of styling a specific button within the matrix // Get the index of the 'Ok' button // uint16_t ok_btn_idx = lv_buttonmatrix_get_button_index(btnm, "Ok"); // if (ok_btn_idx != LV_BUTTONMATRIX_BTN_NONE) { // lv_obj_set_style_bg_color(btnm, lv_palette_main(LV_PALETTE_GREEN), LV_PART_ITEMS | ok_btn_idx); // } lv_obj_invalidate(btnm); } ``` -------------------------------- ### LVGL Label Text Alignment Example Source: https://docs.lvgl.io/9.1 Illustrates different text alignment options for the LVGL label widget. This includes left, center, right, and justify alignments, as well as handling long texts with various modes like wrap, ellipsis, and scroll. It also shows how to apply text shadows and gradients. ```c #include "lvgl.h" void label_alignment_example(lv_obj_t * parent) { lv_obj_t * label1 = lv_label_create(parent); lv_label_set_text(label1, "Left aligned text"); lv_obj_set_width(label1, 150); lv_label_set_align(label1, LV_LABEL_ALIGN_LEFT); lv_obj_set_pos(label1, 10, 10); lv_obj_t * label2 = lv_label_create(parent); lv_label_set_text(label2, "Center aligned text"); lv_obj_set_width(label2, 150); lv_label_set_align(label2, LV_LABEL_ALIGN_CENTER); lv_obj_set_pos(label2, 10, 40); lv_obj_t * label3 = lv_label_create(parent); lv_label_set_text(label3, "Right aligned text"); lv_obj_set_width(label3, 150); lv_label_set_align(label3, LV_LABEL_ALIGN_RIGHT); lv_obj_set_pos(label3, 10, 70); // Example with long text and wrap mode lv_obj_t * label4 = lv_label_create(parent); lv_label_set_text(label4, "This is a very long text that needs to wrap around to the next line."); lv_obj_set_width(label4, 150); lv_label_set_long_mode(label4, LV_LABEL_LONG_WRAP); lv_obj_set_pos(label4, 10, 100); // Example with text shadow lv_obj_t * label5 = lv_label_create(parent); lv_label_set_text(label5, "Text with shadow"); lv_obj_set_pos(label5, 10, 150); lv_obj_set_style_text_shadow_color(label5, lv_color_black(), 0); lv_obj_set_style_text_shadow_opa(label5, 255, 0); lv_obj_set_style_text_shadow_width(label5, 2, 0); lv_obj_set_style_text_shadow_ofs_x(label5, 2, 0); lv_obj_set_style_text_shadow_ofs_y(label5, 2, 0); // Example with gradient color lv_obj_t * label6 = lv_label_create(parent); lv_label_set_text(label6, "Gradient Text"); lv_obj_set_pos(label6, 10, 180); lv_obj_set_style_text_gradient_stop(label6, 0, 0); lv_obj_set_style_text_gradient_color(label6, lv_color_blue(), 0); lv_obj_set_style_text_gradient_stop(label6, 100, 1); lv_obj_set_style_text_gradient_color(label6, lv_color_red(), 1); lv_obj_set_style_text_gradient_mode(label6, LV_GRADIENT_MODE_LINEAR, 0); lv_obj_invalidate(label1); lv_obj_invalidate(label2); lv_obj_invalidate(label3); lv_obj_invalidate(label4); lv_obj_invalidate(label5); lv_obj_invalidate(label6); } ``` -------------------------------- ### Core Initialization and Control Source: https://docs.lvgl.io/9.1 Functions for initializing the GPU, managing command queues, and querying device information. ```APIDOC ## [FUNCTION] vg_lite_init / vg_lite_close ### Description Initializes the VG-Lite hardware context or shuts it down to release resources. ### Method N/A (C Function) ### Endpoint `vg_lite_init()`, `vg_lite_close()` ### Parameters - **None** ### Response - **vg_lite_error_t** (enum) - Returns success or error code. ``` -------------------------------- ### Window (lv_win) API Source: https://docs.lvgl.io/9.1 API documentation for the Window widget, including functions for creation, title, and button management. ```APIDOC ## Window (lv_win) API ### Description This section outlines the API for the Window widget, covering its creation, customization of title and buttons, and retrieval of its parts. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL Image Font API Source: https://docs.lvgl.io/9.1 APIs for using image-based fonts in LVGL, including usage, examples, and API details. ```APIDOC ## LVGL Image Font API ### Description Enables the use of custom image-based fonts within LVGL applications, including support for emojis. ### Functionality - **Usage**: Guidelines on how to integrate and use image fonts. - **Example**: Code examples demonstrating image font usage. - **Text Rendering**: How to render text using image fonts. - **Emoji Support**: Specifics on using emojis within image fonts. - **API**: Details of the relevant API functions and structures. ``` -------------------------------- ### LVGL Tick API Source: https://docs.lvgl.io/9.1 APIs for managing the LVGL tick system, including getting elapsed time, delaying execution, and setting callback functions. ```APIDOC ## LVGL Tick API ### Description Manages the LVGL tick system for time-based operations and delays. ### Functions - `lv_tick_inc(uint32_t tick_period_ms)`: Increments the internal tick counter. - `lv_tick_get()`: Returns the current value of the tick counter. - `lv_tick_elaps(uint32_t start_tick)`: Calculates the time elapsed since a given start tick. - `lv_delay_ms(uint32_t ms)`: Delays the current task for a specified number of milliseconds. - `lv_tick_set_cb(lv_tick_get_cb_t cb)`: Sets a custom callback function for getting the tick value. - `lv_delay_set_cb(lv_delay_cb_t cb)`: Sets a custom callback function for handling delays. ### Types - `lv_tick_get_cb_t`: Type for the tick get callback. - `lv_delay_cb_t`: Type for the delay callback. - `lv_tick_state_t`: Enum for tick states. ### Header File `tick/lv_tick.h` ``` -------------------------------- ### Lottie Player API Source: https://docs.lvgl.io/9.1 API documentation for the Lottie player, covering loading animations from files or raw data, and controlling playback. ```APIDOC ## Lottie Player API ### Description This section details the API for the Lottie player, enabling the loading and playback of Lottie animations from various sources, including files and raw string data. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### littlefs API Source: https://docs.lvgl.io/9.1 API documentation for the littlefs filesystem, covering its usage and integration. ```APIDOC ## littlefs API ### Description This section provides the API documentation for the littlefs filesystem, detailing its usage and how to integrate it within the LVGL environment. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Object Alignment and Coordinates Source: https://docs.lvgl.io/9.1 Functions for aligning objects within their parent, getting their absolute and aligned coordinates, and moving them. Also includes functions for transforming points and areas. ```APIDOC ## Object Alignment and Coordinates ### Description Functions for aligning objects within their parent, getting their absolute and aligned coordinates, and moving them. Also includes functions for transforming points and areas. ### Methods - `lv_obj_set_align(obj, align)` - `lv_obj_align(obj, base, align, x_ofs, y_ofs)` - `lv_obj_align_to(obj, base, align, x_ofs, y_ofs)` - `lv_obj_center(obj)` - `lv_obj_get_coords(obj)` - `lv_obj_get_x(obj)` - `lv_obj_get_x2(obj)` - `lv_obj_get_y(obj)` - `lv_obj_get_y2(obj)` - `lv_obj_get_x_aligned(obj)` - `lv_obj_get_y_aligned(obj)` - `lv_obj_get_content_coords(obj)` - `lv_obj_refr_pos(obj)` - `lv_obj_move_to(obj, x, y)` - `lv_obj_move_children_by(obj, x_delta, y_delta)` - `lv_obj_transform_point(obj, point)` - `lv_obj_transform_point_array(obj, points, n_points)` - `lv_obj_get_transformed_area(obj, area)` ``` -------------------------------- ### Object Size and Layout Management Source: https://docs.lvgl.io/9.1 Functions for setting and getting the width, height, content dimensions, and layout properties of LVGL objects. This includes functions to mark layouts as dirty and update them. ```APIDOC ## Object Size and Layout Management ### Description Functions for setting and getting the width, height, content dimensions, and layout properties of LVGL objects. This includes functions to mark layouts as dirty and update them. ### Methods - `lv_obj_set_width(obj, w)` - `lv_obj_set_height(obj, h)` - `lv_obj_set_content_width(obj, w)` - `lv_obj_set_content_height(obj, h)` - `lv_obj_set_layout(obj, layout)` - `lv_obj_is_layout_positioned(obj)` - `lv_obj_mark_layout_as_dirty(obj)` - `lv_obj_update_layout(obj)` - `lv_obj_get_width(obj)` - `lv_obj_get_height(obj)` - `lv_obj_get_content_width(obj)` - `lv_obj_get_content_height(obj)` - `lv_obj_get_self_width(obj)` - `lv_obj_get_self_height(obj)` - `lv_obj_refresh_self_size(obj)` - `lv_clamp_width(val, min, max)` - `lv_clamp_height(val, min, max)` ``` -------------------------------- ### LVGL Global Configuration and Object Class Management Source: https://docs.lvgl.io/9.1 Documentation for global LVGL settings and functions related to object classes. ```APIDOC ## LVGL Global Configuration and Object Class Management ### Description This section covers global variables and functions for managing LVGL's global state and defining object classes. ### Method `lv_global_t`, `lv_global`, `_lv_global_t`, `lv_obj_class_event_cb_t`, `lv_obj_class_editable_t`, `lv_obj_class_group_def_t`, `lv_obj_class_theme_inheritable_t`, `lv_obj_class_create_obj`, `lv_obj_class_init_obj`, `_lv_obj_destruct`, `lv_obj_is_editable`, `lv_obj_is_group_def`, `_lv_obj_class_t` ### Endpoint N/A (These are internal LVGL structures and functions) ### Parameters - **`lv_global_t`**: Structure holding global variables. - **`lv_global`**: Pointer to the global variables structure. - **`_lv_global_t`**: Internal structure for global variables. - **`lv_obj_class_event_cb_t`**: Typedef for event callback functions. - **`lv_obj_class_editable_t`**: Enum for editable states. - **`lv_obj_class_group_def_t`**: Enum for group definition states. - **`lv_obj_class_theme_inheritable_t`**: Enum for theme inheritable states. - **`lv_obj_class_create_obj(class_ptr, parent)`**: Creates a new object with a specific class. - **`lv_obj_class_init_obj(obj, class_ptr)`**: Initializes an object with a specific class. - **`_lv_obj_destruct(obj)`**: Destructs an object (internal use). - **`lv_obj_is_editable(obj)`**: Checks if an object is editable. - **`lv_obj_is_group_def(obj)`**: Checks if an object is group definable. - **`_lv_obj_class_t`**: Internal structure representing an object class. ### Request Example ```c // Example of creating an object with a custom class (conceptual) // const lv_obj_class_t my_custom_class = { ... }; // lv_obj_t *my_obj = lv_obj_class_create_obj(&my_custom_class, lv_screen_active()); // Checking object properties if (lv_obj_is_editable(some_obj)) { // Handle editable object } ``` ### Response N/A (These are internal LVGL structures and functions) ``` -------------------------------- ### LVGL Theme Management Functions Source: https://docs.lvgl.io/9.1 Functions for applying and managing themes in LVGL. This allows for consistent styling across UI elements. It includes functions to get default themes and apply custom themes. ```c #include "lv_theme.h" // Example: Apply the default theme void apply_default_theme() { lv_theme_t * theme = lv_theme_default_init(lv_disp_get_default(), LV_COLOR_BLACK, LV_COLOR_WHITE, false, NULL); lv_theme_apply(lv_obj_create(NULL), theme); } ``` -------------------------------- ### LVGL Calendar Header Arrow Buttons Example Source: https://docs.lvgl.io/9.1 Shows how to configure the header of an LVGL calendar widget to include arrow buttons for navigating between months or years. This enhances user interaction by providing explicit controls for date navigation. ```c #include "lvgl.h" void calendar_header_arrow_example(lv_obj_t * parent) { lv_obj_t * calendar = lv_calendar_create(parent); lv_obj_set_size(calendar, 250, 200); lv_obj_center(calendar); // Enable header and set arrow buttons lv_calendar_set_show_header(calendar, true); lv_calendar_set_header_arrow(calendar, true); // Set current date lv_calendar_set_today_highlighted(calendar, true); lv_calendar_set_show_today_button(calendar, true); lv_calendar_set_date(calendar, 2023, 10, 26); lv_obj_invalidate(calendar); } ``` -------------------------------- ### Accessing and Modifying LVGL Object Styles Source: https://docs.lvgl.io/9.1 These functions are used to interact with the style system of LVGL objects. The 'get' functions retrieve current style values, while the 'set' functions apply new values to specific style properties. ```C /* Example: Getting and setting a border color */ lv_color_t color = lv_obj_get_style_border_color(obj, LV_PART_MAIN); lv_obj_set_style_border_color(obj, lv_palette_main(LV_PALETTE_RED), LV_PART_MAIN); /* Example: Setting object dimensions */ lv_obj_set_style_width(obj, 100, LV_PART_MAIN); lv_obj_set_style_height(obj, 50, LV_PART_MAIN); ``` -------------------------------- ### LVGL SDL Driver API Source: https://docs.lvgl.io/9.1 APIs for the SDL (Simple DirectMedia Layer) driver, allowing LVGL to run on desktop platforms. ```APIDOC ## LVGL SDL Driver API ### Description Provides drivers for using SDL to display LVGL applications and handle input events on desktop systems. ### Header Files - `drivers/sdl/lv_sdl_keyboard.h`: SDL keyboard input driver. - `drivers/sdl/lv_sdl_window.h`: SDL window management for display. - `drivers/sdl/lv_sdl_mousewheel.h`: SDL mouse wheel input driver. - `drivers/sdl/lv_sdl_mouse.h`: SDL mouse input driver. ``` -------------------------------- ### Tileview API Source: https://docs.lvgl.io/9.1 API documentation for the Tileview widget, covering its usage for adding and changing tiles. ```APIDOC ## Tileview API ### Description This section details the API for the Tileview widget, including functions to manage its tiles. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL File System Core Functions Source: https://docs.lvgl.io/9.1 This section details the core functions for initializing, deinitializing, and managing file system drivers within LVGL. ```APIDOC ## LVGL File System Core Functions ### Description Provides functions for initializing, deinitializing, registering, and managing file system drivers. ### Functions #### `_lv_fs_init()` * **Description**: Initializes the file system module. * **Method**: Internal #### `_lv_fs_deinit()` * **Description**: Deinitializes the file system module. * **Method**: Internal #### `lv_fs_drv_init()` * **Description**: Initializes a file system driver structure. * **Method**: Internal #### `lv_fs_drv_register()` * **Parameters**: * `driver` (lv_fs_drv_t*) - Pointer to the file system driver to register. * **Description**: Registers a file system driver with the LVGL system. * **Method**: Internal #### `lv_fs_get_drv()` * **Parameters**: * `letter` (char) - The drive letter to find the driver for. * **Returns**: Pointer to the `lv_fs_drv_t` structure for the given letter, or NULL if not found. * **Description**: Retrieves the file system driver associated with a specific drive letter. * **Method**: Internal #### `lv_fs_is_ready()` * **Parameters**: * `letter` (char) - The drive letter to check. * **Returns**: `true` if the file system is ready, `false` otherwise. * **Description**: Checks if a specific file system is ready for use. * **Method**: Internal ``` -------------------------------- ### libpng Decoder API Source: https://docs.lvgl.io/9.1 API documentation for the libpng decoder, including instructions for adding it to a project and opening PNG images. ```APIDOC ## libpng Decoder API ### Description This section details the API for the libpng decoder, covering its integration into projects and the process of opening PNG images from files. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Observer API Source: https://docs.lvgl.io/9.1 API documentation for the Observer pattern implementation, covering Subject and Observer concepts. ```APIDOC ## Observer API ### Description This section provides the API documentation for the Observer pattern, detailing the concepts of Subject and Observer for implementing event notification systems. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL Initialization API Source: https://docs.lvgl.io/9.1 APIs for initializing and deinitializing the LVGL graphics library, and checking its initialization status. ```APIDOC ## LVGL Initialization API ### Description Provides functions to initialize, deinitialize, and check the status of the LVGL graphics library. ### Methods - `lv_init()`: Initializes the LVGL library. - `lv_deinit()`: Deinitializes the LVGL library. - `lv_is_initialized()`: Checks if LVGL is currently initialized. ### Header File `lv_init.h` ``` -------------------------------- ### FFmpeg Support API Source: https://docs.lvgl.io/9.1 API documentation for FFmpeg support, including functions for decoding images and videos. ```APIDOC ## FFmpeg Support API ### Description This section provides the API for FFmpeg support within LVGL, covering its integration and usage for decoding various media formats, including images and videos. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL Libinput Driver API Source: https://docs.lvgl.io/9.1 APIs for the libinput driver, providing a more abstract way to handle input devices on Linux. ```APIDOC ## LVGL Libinput Driver API ### Description Integrates LVGL with the libinput library for handling various input devices. ### Header Files - `drivers/libinput/lv_libinput.h`: Main libinput driver header. - `drivers/libinput/lv_xkb.h`: XKB keymap handling for libinput. ``` -------------------------------- ### Fragment API Source: https://docs.lvgl.io/9.1 API documentation for the Fragment system, including usage for creating fragment classes and managing fragment-based navigation. ```APIDOC ## Fragment API ### Description This section details the API for the Fragment system, which allows for modular UI development. It covers creating fragment classes, using the fragment manager, and implementing fragment-based navigation. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Snapshot API Source: https://docs.lvgl.io/9.1 API documentation for the Snapshot feature, including functions for freeing images and using existing buffers. ```APIDOC ## Snapshot API ### Description This section details the API for the Snapshot feature, covering its usage for capturing screen content, freeing associated image data, and utilizing existing buffers. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Display Management API Source: https://docs.lvgl.io/9.1 Configures display rendering modes, rotation, and screen transition animations. ```APIDOC ## PUT /display/config ### Description Updates the display configuration including rotation and render mode. ### Method PUT ### Endpoint /display/config ### Parameters #### Request Body - **rotation** (lv_display_rotation_t) - Required - 0, 90, 180, or 270 degrees - **render_mode** (lv_display_render_mode_t) - Required - PARTIAL, DIRECT, or FULL ### Response #### Success Response (200) - **status** (string) - Configuration updated successfully ## POST /display/screen/load ### Description Loads a new screen with a specified animation effect. ### Method POST ### Endpoint /display/screen/load ### Parameters #### Request Body - **screen_id** (string) - Required - Target screen identifier - **animation** (lv_screen_load_anim_t) - Required - Animation type (e.g., FADE_IN, MOVE_LEFT) ### Response #### Success Response (200) - **status** (string) - Screen transition initiated ``` -------------------------------- ### libjpeg-turbo Decoder API Source: https://docs.lvgl.io/9.1 API documentation for the libjpeg-turbo decoder, detailing its usage for loading JPEG images. ```APIDOC ## libjpeg-turbo Decoder API ### Description This section outlines the API for the libjpeg-turbo decoder, which enables efficient loading of JPEG images into the LVGL environment. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### FreeType Support API Source: https://docs.lvgl.io/9.1 API documentation for FreeType support, covering its integration and usage for opening fonts. ```APIDOC ## FreeType Support API ### Description This section outlines the API for integrating and using FreeType support within LVGL, including instructions for adding it to projects and opening fonts. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### RLE Compress API Source: https://docs.lvgl.io/9.1 API documentation for RLE compression, focusing on generating RLE compressed binary images. ```APIDOC ## RLE Compress API ### Description This section details the API for Run-Length Encoding (RLE) compression, specifically for generating RLE compressed binary images. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Grid Layout API Source: https://docs.lvgl.io/9.1 API documentation for the Grid layout manager, covering its capabilities for creating grid-based layouts. ```APIDOC ## Grid Layout API ### Description This section details the API for the Grid layout manager, enabling the creation of complex grid-based layouts with precise control over item placement, spanning, and alignment. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### QR Code API Source: https://docs.lvgl.io/9.1 API documentation for generating QR codes within the LVGL environment. ```APIDOC ## QR Code API ### Description This section details the API for creating QR codes using the LVGL library. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### File System Interfaces API Source: https://docs.lvgl.io/9.1 API documentation for File System Interfaces, likely related to storage and file operations within the LVGL environment. ```APIDOC ## File System Interfaces API ### Description This section covers the API for File System Interfaces, which are essential for managing storage and performing file operations within the LVGL framework. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Flex Layout API Source: https://docs.lvgl.io/9.1 API documentation for the Flex layout manager, detailing its features for arranging items in rows or columns. ```APIDOC ## Flex Layout API ### Description This section provides the API documentation for the Flex layout manager, which allows for flexible arrangement of child elements in rows or columns with various alignment and sizing options. ### Method N/A (This is an API reference, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### LVGL sprintf Functions Source: https://docs.lvgl.io/9.1 Offers functions for formatted string output, similar to standard C's `sprintf` and `vprintf`. ```APIDOC ## LVGL sprintf Functions ### Description Offers functions for formatted string output, similar to standard C's `sprintf` and `vprintf`. ### Functions - **`lv_snprintf(char *str, size_t size, const char *format, ...)`**: Writes output to the string `str`, with at most `size` characters written. - **`lv_vsnprintf(char *str, size_t size, const char *format, va_list ap)`**: Similar to `lv_snprintf`, but takes a `va_list` as the argument list. ```