/* * Copyright 2025 NXP * NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in * accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing, * activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to * comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license * terms, then you may not retain, install, activate or otherwise use the software. */ #include "lvgl.h" #include #include "gui_guider.h" #include "events_init.h" #include "widgets_init.h" #include "custom.h" void setup_scr_screen_modbus_display(lv_ui *ui) { //Write codes screen_modbus_display ui->screen_modbus_display = lv_obj_create(NULL); lv_obj_set_size(ui->screen_modbus_display, 320, 240); lv_obj_set_scrollbar_mode(ui->screen_modbus_display, LV_SCROLLBAR_MODE_OFF); //Write style for screen_modbus_display, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_modbus_display, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_modbus_display, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_modbus_display, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_value_Rx ui->screen_modbus_display_value_Rx = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_value_Rx, ""); lv_label_set_long_mode(ui->screen_modbus_display_value_Rx, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_value_Rx, 3, 169); lv_obj_set_size(ui->screen_modbus_display_value_Rx, 314, 68); //Write style for screen_modbus_display_value_Rx, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_value_Rx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_value_Rx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_value_Rx, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_value_Rx, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_value_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_value_Rx, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_value_Rx, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_value_Rx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_value_Rx, 1, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_value_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_value_Rx, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_value_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_value_Rx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_value_Rx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_value_Rx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_value_Rx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_value_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_value_Tx ui->screen_modbus_display_value_Tx = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_value_Tx, ""); lv_label_set_long_mode(ui->screen_modbus_display_value_Tx, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_value_Tx, 160, 21); lv_obj_set_size(ui->screen_modbus_display_value_Tx, 157, 85); //Write style for screen_modbus_display_value_Tx, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_value_Tx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_value_Tx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_value_Tx, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_value_Tx, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_value_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_value_Tx, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_value_Tx, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_value_Tx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_value_Tx, 1, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_value_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_value_Tx, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_value_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_value_Tx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_value_Tx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_value_Tx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_value_Tx, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_value_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_value_Data ui->screen_modbus_display_value_Data = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_value_Data, ""); lv_label_set_long_mode(ui->screen_modbus_display_value_Data, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_value_Data, 3, 21); lv_obj_set_size(ui->screen_modbus_display_value_Data, 147, 85); //Write style for screen_modbus_display_value_Data, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_value_Data, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_value_Data, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_value_Data, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_value_Data, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_value_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_value_Data, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_value_Data, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_value_Data, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_value_Data, 1, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_value_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_value_Data, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_value_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_value_Data, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_value_Data, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_value_Data, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_value_Data, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_value_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_Rx ui->screen_modbus_display_label_Rx = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_Rx, "Rx:"); lv_label_set_long_mode(ui->screen_modbus_display_label_Rx, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_Rx, 3, 150); lv_obj_set_size(ui->screen_modbus_display_label_Rx, 40, 18); //Write style for screen_modbus_display_label_Rx, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_Rx, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_Rx, &lv_font_SourceHanSerifSC_Regular_16, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_Rx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_Rx, 2, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_Rx, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_Rx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_send ui->screen_modbus_display_label_send = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_send, "发送"); lv_label_set_long_mode(ui->screen_modbus_display_label_send, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_send, 220, 114); lv_obj_set_size(ui->screen_modbus_display_label_send, 80, 30); //Write style for screen_modbus_display_label_send, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_send, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_label_send, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_label_send, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_label_send, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_send, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_send, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_send, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_send, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_send, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_modbus_display_label_send, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_modbus_display_label_send, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_send, 4, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_send, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_set ui->screen_modbus_display_label_set = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_set, "设置"); lv_label_set_long_mode(ui->screen_modbus_display_label_set, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_set, 120, 114); lv_obj_set_size(ui->screen_modbus_display_label_set, 80, 30); //Write style for screen_modbus_display_label_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_set, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_label_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_label_set, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_label_set, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_set, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_set, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_set, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_modbus_display_label_set, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_modbus_display_label_set, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_set, 4, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_previous ui->screen_modbus_display_label_previous = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_previous, "上一步"); lv_label_set_long_mode(ui->screen_modbus_display_label_previous, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_previous, 20, 114); lv_obj_set_size(ui->screen_modbus_display_label_previous, 80, 30); //Write style for screen_modbus_display_label_previous, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_previous, 3, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_opa(ui->screen_modbus_display_label_previous, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui->screen_modbus_display_label_previous, lv_color_hex(0x00b6ff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_side(ui->screen_modbus_display_label_previous, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_previous, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_previous, &lv_font_SourceHanSerifSC_Regular_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_previous, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_previous, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_previous, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_modbus_display_label_previous, lv_color_hex(0xCAEEFF), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_modbus_display_label_previous, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_previous, 4, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_previous, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_Tx ui->screen_modbus_display_label_Tx = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_Tx, "Tx:"); lv_label_set_long_mode(ui->screen_modbus_display_label_Tx, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_Tx, 166, 3); lv_obj_set_size(ui->screen_modbus_display_label_Tx, 40, 18); //Write style for screen_modbus_display_label_Tx, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_Tx, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_Tx, &lv_font_SourceHanSerifSC_Regular_16, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_Tx, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_Tx, 2, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_Tx, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_Tx, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_modbus_display_label_Data ui->screen_modbus_display_label_Data = lv_label_create(ui->screen_modbus_display); lv_label_set_text(ui->screen_modbus_display_label_Data, "Data:"); lv_label_set_long_mode(ui->screen_modbus_display_label_Data, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_modbus_display_label_Data, 3, 3); lv_obj_set_size(ui->screen_modbus_display_label_Data, 60, 18); //Write style for screen_modbus_display_label_Data, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_modbus_display_label_Data, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_modbus_display_label_Data, &lv_font_SourceHanSerifSC_Regular_16, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_modbus_display_label_Data, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_modbus_display_label_Data, 2, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_modbus_display_label_Data, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_modbus_display_label_Data, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //The custom code of screen_modbus_display. //Update current screen layout. lv_obj_update_layout(ui->screen_modbus_display); }