Umstrukuriert/windows-app hinzugefügt
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
|
||||
#include "camera_tile.h"
|
||||
|
||||
lv_obj_t *cam_ing;
|
||||
|
||||
|
||||
void camera_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
cam_ing = lv_img_create(parent);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef __CAMERA_TILE_H__
|
||||
#define __CAMERA_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void camera_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
#include "image_tile.h"
|
||||
|
||||
|
||||
#define MAX_FILENAME_LENGTH 50
|
||||
#define MAX_FILE_COUNT 100
|
||||
|
||||
static lv_obj_t *img = NULL;
|
||||
|
||||
char bin_filenames[MAX_FILE_COUNT][MAX_FILENAME_LENGTH];
|
||||
int bin_file_count = 0;
|
||||
|
||||
int is_bin_file(const char *filename)
|
||||
{
|
||||
const char *ext = strrchr(filename, '.');
|
||||
return (ext != NULL && strcmp(ext, ".bin") == 0);
|
||||
}
|
||||
|
||||
void read_bin_files(const char *dir_path)
|
||||
{
|
||||
lv_fs_dir_t dir;
|
||||
lv_fs_res_t res = lv_fs_dir_open(&dir, dir_path);
|
||||
if (res != LV_FS_RES_OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
char filename[MAX_FILENAME_LENGTH];
|
||||
while (lv_fs_dir_read(&dir, filename) == LV_FS_RES_OK && filename[0] != '\0')
|
||||
{
|
||||
printf("Checking file: %s\n", filename);
|
||||
if (is_bin_file(filename))
|
||||
{
|
||||
if (bin_file_count < MAX_FILE_COUNT)
|
||||
{
|
||||
strncpy(bin_filenames[bin_file_count], filename, MAX_FILENAME_LENGTH - 1);
|
||||
bin_filenames[bin_file_count][MAX_FILENAME_LENGTH - 1] = '\0';
|
||||
bin_file_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
lv_fs_dir_close(&dir);
|
||||
}
|
||||
|
||||
void print_bin_filenames()
|
||||
{
|
||||
for (int i = 0; i < bin_file_count; i++)
|
||||
{
|
||||
printf("Found .bin file: %s \r\n", bin_filenames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void img_callback(lv_event_t *e)
|
||||
{
|
||||
char str_buf[200];
|
||||
static uint16_t img_index = 0;
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
if (code == LV_EVENT_SHORT_CLICKED)
|
||||
{
|
||||
if (++img_index >= bin_file_count)
|
||||
{
|
||||
img_index = 0;
|
||||
}
|
||||
sprintf(str_buf, "S:/images/%s", bin_filenames[img_index]);
|
||||
lv_img_set_src(img, str_buf);
|
||||
}
|
||||
}
|
||||
|
||||
void clicked_event_cb(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
if (code == LV_EVENT_SHORT_CLICKED)
|
||||
{
|
||||
printf("LV_EVENT_SHORT_CLICKED\n");
|
||||
}
|
||||
}
|
||||
void image_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
char str_buf[200];
|
||||
img = lv_img_create(parent);
|
||||
lv_obj_set_size(img, lv_pct(100), lv_pct(100));
|
||||
lv_obj_add_flag(img, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_add_event_cb(img, img_callback, LV_EVENT_SHORT_CLICKED, NULL);
|
||||
read_bin_files("S:/images");
|
||||
print_bin_filenames();
|
||||
sprintf(str_buf, "S:/images/%s", bin_filenames[0]);
|
||||
// lv_img_set_src(img, str_buf);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __IMAGE_TILE_H__
|
||||
#define __IMAGE_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void image_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
#include "qmi8658_tile.h"
|
||||
#include "bsp_qmi8658.h"
|
||||
|
||||
static lv_obj_t *list;
|
||||
lv_obj_t *label_accel_x;
|
||||
lv_obj_t *label_accel_y;
|
||||
lv_obj_t *label_accel_z;
|
||||
|
||||
lv_obj_t *label_gyro_x;
|
||||
lv_obj_t *label_gyro_y;
|
||||
lv_obj_t *label_gyro_z;
|
||||
|
||||
lv_obj_t *label_angle_x;
|
||||
lv_obj_t *label_angle_y;
|
||||
lv_obj_t *label_angle_z;
|
||||
|
||||
static void qmi8658_time_cb(lv_timer_t *timer)
|
||||
{
|
||||
qmi8658_data_t qmi8658_data;
|
||||
char str[20];
|
||||
if (bsp_qmi8658_read_data(&qmi8658_data))
|
||||
{
|
||||
lv_label_set_text_fmt(label_accel_x, "%d", qmi8658_data.acc_x);
|
||||
lv_label_set_text_fmt(label_accel_y, "%d", qmi8658_data.acc_y);
|
||||
lv_label_set_text_fmt(label_accel_z, "%d", qmi8658_data.acc_z);
|
||||
lv_label_set_text_fmt(label_gyro_x, "%d", qmi8658_data.gyr_x);
|
||||
lv_label_set_text_fmt(label_gyro_y, "%d", qmi8658_data.gyr_y);
|
||||
lv_label_set_text_fmt(label_gyro_z, "%d", qmi8658_data.gyr_z);
|
||||
|
||||
sprintf(str, "%4.1f", qmi8658_data.AngleX);
|
||||
lv_label_set_text_fmt(label_angle_x, str);
|
||||
sprintf(str, "%4.1f", qmi8658_data.AngleY);
|
||||
lv_label_set_text_fmt(label_angle_y, str);
|
||||
sprintf(str, "%4.1f", qmi8658_data.AngleZ);
|
||||
lv_label_set_text_fmt(label_angle_z, str);
|
||||
}
|
||||
}
|
||||
|
||||
void qmi8658_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
/*Create a list*/
|
||||
list = lv_list_create(parent);
|
||||
lv_obj_t *lable = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(lable, &lv_font_montserrat_20, LV_PART_MAIN);
|
||||
lv_label_set_text(lable, "QMI8658");
|
||||
lv_obj_align(lable, LV_ALIGN_TOP_MID, 0, 3);
|
||||
|
||||
lv_obj_set_size(list, lv_pct(100), lv_pct(90));
|
||||
lv_obj_align(list, LV_ALIGN_TOP_MID, 0, 30);
|
||||
|
||||
lv_obj_t *list_item;
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Accel_x");
|
||||
label_accel_x = lv_label_create(list_item);
|
||||
lv_label_set_text(label_accel_x, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Accel_y");
|
||||
label_accel_y = lv_label_create(list_item);
|
||||
lv_label_set_text(label_accel_y, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Accel_z");
|
||||
label_accel_z = lv_label_create(list_item);
|
||||
lv_label_set_text(label_accel_z, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Gyro_x");
|
||||
label_gyro_x = lv_label_create(list_item);
|
||||
lv_label_set_text(label_gyro_x, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Gyro_y");
|
||||
label_gyro_y = lv_label_create(list_item);
|
||||
lv_label_set_text(label_gyro_y, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Gyro_z");
|
||||
label_gyro_z = lv_label_create(list_item);
|
||||
lv_label_set_text(label_gyro_z, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Angle_x");
|
||||
label_angle_x = lv_label_create(list_item);
|
||||
lv_label_set_text(label_angle_x, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Angle_y");
|
||||
label_angle_y = lv_label_create(list_item);
|
||||
lv_label_set_text(label_angle_y, "----");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Angle_z");
|
||||
label_angle_z = lv_label_create(list_item);
|
||||
lv_label_set_text(label_angle_z, "----");
|
||||
|
||||
lv_timer_create(qmi8658_time_cb, 100, NULL);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __QMI8658_TILE_H__
|
||||
#define __QMI8658_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void qmi8658_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "rgb_tile.h"
|
||||
|
||||
lv_timer_t *rgb_tile_timer;
|
||||
|
||||
#define BG_COLOR_MAX 3
|
||||
uint32_t bg_color_arr[BG_COLOR_MAX] = {0xff0000, 0x00ff00, 0x0000ff};
|
||||
uint16_t bg_color_index = 1;
|
||||
|
||||
static lv_obj_t *obj_rgb_tile;
|
||||
void lv_timer_show_color_tile_cb(lv_timer_t *timer)
|
||||
{
|
||||
lv_obj_set_style_bg_color(obj_rgb_tile, lv_color_hex(bg_color_arr[bg_color_index]), LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(obj_rgb_tile, LV_OPA_COVER, LV_PART_MAIN);
|
||||
|
||||
if (++bg_color_index >= BG_COLOR_MAX)
|
||||
{
|
||||
bg_color_index = 0;
|
||||
}
|
||||
}
|
||||
void rgb_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
obj_rgb_tile = parent;
|
||||
lv_obj_set_style_bg_color(obj_rgb_tile, lv_color_hex(bg_color_arr[0]), LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(obj_rgb_tile, LV_OPA_COVER, LV_PART_MAIN);
|
||||
rgb_tile_timer = lv_timer_create(lv_timer_show_color_tile_cb, 1000, NULL);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __RGB_TILE_H__
|
||||
#define __RGB_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void rgb_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,127 @@
|
||||
#include "system_tile.h"
|
||||
|
||||
#include "bsp_sdcard.h"
|
||||
#include "bsp_display.h"
|
||||
#include "bsp_battery.h"
|
||||
|
||||
#include "esp_flash.h"
|
||||
// #include "esp_psram.h"
|
||||
#include "driver/temperature_sensor.h"
|
||||
#include "esp_private/esp_clk.h"
|
||||
|
||||
static lv_obj_t *label_brightness;
|
||||
static lv_obj_t *label_chip_temp;
|
||||
static lv_obj_t *label_battery;
|
||||
|
||||
temperature_sensor_handle_t temp_sensor = NULL;
|
||||
|
||||
static void slider_event_cb(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
if (code == LV_EVENT_VALUE_CHANGED)
|
||||
{
|
||||
lv_obj_t *slider = lv_event_get_target(e);
|
||||
int value = lv_slider_get_value(slider);
|
||||
// printf("Slider value: %d\n", value);
|
||||
|
||||
lv_label_set_text_fmt(label_brightness, "%d%%", value);
|
||||
bsp_display_set_brightness(value);
|
||||
// bsp_display_handle_t display = bsp_display_get_handle();
|
||||
// display->set_brightness(display, value);
|
||||
lv_event_stop_bubbling(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void system_time_cb(lv_timer_t *timer)
|
||||
{
|
||||
char str[20];
|
||||
float tsens_out;
|
||||
float bat_voltage;
|
||||
bsp_battery_get_voltage(&bat_voltage, NULL);
|
||||
sprintf(str, "%.2f V", bat_voltage);
|
||||
lv_label_set_text(label_battery, str);
|
||||
|
||||
temperature_sensor_get_celsius(temp_sensor, &tsens_out);
|
||||
sprintf(str, "%d C", (int)tsens_out);
|
||||
lv_label_set_text(label_chip_temp, str);
|
||||
}
|
||||
|
||||
|
||||
void system_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
uint32_t flash_size;
|
||||
uint64_t sdcard_size;
|
||||
uint32_t cpu_freq;
|
||||
uint8_t brightness;
|
||||
|
||||
brightness = bsp_display_get_brightness();
|
||||
/*Create a list*/
|
||||
lv_obj_t *list = lv_list_create(parent);
|
||||
lv_obj_t *lable = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(lable, &lv_font_montserrat_20, LV_PART_MAIN);
|
||||
lv_label_set_text(lable, "System");
|
||||
lv_obj_align(lable, LV_ALIGN_TOP_MID, 0, 3);
|
||||
|
||||
|
||||
lv_obj_set_size(list, lv_pct(100), lv_pct(75));
|
||||
// lv_obj_center(list);
|
||||
lv_obj_align(list, LV_ALIGN_TOP_MID, 0, 30);
|
||||
|
||||
// lv_obj_t *button = lv_btn_create(parent);
|
||||
// lable = lv_label_create(parent);
|
||||
// lv_label_set_text(lable, "ES8311\nTest");
|
||||
// lv_obj_align(lable, LV_ALIGN_BOTTOM_MID, -125, -15);
|
||||
|
||||
// lv_obj_t *sw = lv_switch_create(parent);
|
||||
// lv_obj_align(sw, LV_ALIGN_BOTTOM_MID, -75, -15);
|
||||
|
||||
lv_obj_t *slider = lv_slider_create(parent);
|
||||
lv_slider_set_range(slider, 1, 100);
|
||||
lv_slider_set_value(slider, brightness, LV_ANIM_OFF);
|
||||
|
||||
lv_obj_set_size(slider, lv_pct(70), lv_pct(5));
|
||||
lv_obj_align(slider, LV_ALIGN_BOTTOM_MID, 0, -18);
|
||||
lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
|
||||
lv_obj_t *list_item;
|
||||
list_item = lv_list_add_btn(list, NULL, "Chip");
|
||||
lv_obj_t *label_chip = lv_label_create(list_item);
|
||||
lv_label_set_text(label_chip, "ESP32-C6");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Temp");
|
||||
label_chip_temp = lv_label_create(list_item);
|
||||
lv_label_set_text(label_chip_temp, "--- C");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Freq");
|
||||
lv_obj_t *label_chip_freq = lv_label_create(list_item);
|
||||
cpu_freq = esp_clk_cpu_freq();
|
||||
lv_label_set_text_fmt(label_chip_freq, "%d MHz", (int)(cpu_freq / 1000 / 1000));
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Brightness");
|
||||
label_brightness = lv_label_create(list_item);
|
||||
lv_label_set_text_fmt(label_brightness, "%d%%", brightness);
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "RAM");
|
||||
lv_obj_t *label_ram = lv_label_create(list_item);
|
||||
lv_label_set_text(label_ram, "512 KB");
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Flash");
|
||||
lv_obj_t *label_flash = lv_label_create(list_item);
|
||||
esp_flash_get_size(NULL, &flash_size);
|
||||
lv_label_set_text_fmt(label_flash, "%d MB", (int)(flash_size / 1024 / 1024));
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "SDCard");
|
||||
lv_obj_t *label_sd = lv_label_create(list_item);
|
||||
sdcard_size = bsp_sdcard_get_size();
|
||||
lv_label_set_text_fmt(label_sd, "%d MB", (int)(sdcard_size / 1024 / 1024));
|
||||
|
||||
list_item = lv_list_add_btn(list, NULL, "Battery");
|
||||
label_battery = lv_label_create(list_item);
|
||||
lv_label_set_text(label_battery, "--- V");
|
||||
|
||||
temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 80);
|
||||
temperature_sensor_install(&temp_sensor_config, &temp_sensor);
|
||||
temperature_sensor_enable(temp_sensor);
|
||||
|
||||
lv_timer_create(system_time_cb, 1000, NULL);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __SYSTEM_TILE_H__
|
||||
#define __SYSTEM_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void system_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
#include "wifi_tile.h"
|
||||
|
||||
#include "bsp_wifi.h"
|
||||
#include "esp_lvgl_port.h"
|
||||
|
||||
#define LIST_BTN_LEN_MAX 20
|
||||
|
||||
static lv_obj_t *list;
|
||||
lv_obj_t *lable_wifi_ip;
|
||||
|
||||
lv_obj_t *list_btns[LIST_BTN_LEN_MAX];
|
||||
uint16_t list_item_count = 0;
|
||||
SemaphoreHandle_t wifi_scanf_semaphore;
|
||||
|
||||
// typedef struct
|
||||
// {
|
||||
// char *name;
|
||||
// char *rssi;
|
||||
// } wifi_info_t;
|
||||
|
||||
// wifi_info_t wifi_infos[4] = {{.name = "wifi1", .rssi = "40db"}, {.name = "wifi2", .rssi = "76db"}, {.name = "wifi3", .rssi = "70db"}, {.name = "wifi4", .rssi = "70db"}};
|
||||
|
||||
static void btn_wifi_scan_event_handler(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
// lv_obj_t *obj = lv_event_get_target(e);
|
||||
if (code == LV_EVENT_CLICKED)
|
||||
{
|
||||
for (int i = 0; i < list_item_count; i++)
|
||||
{
|
||||
if (list_btns[i])
|
||||
{
|
||||
lv_obj_del(list_btns[i]);
|
||||
}
|
||||
}
|
||||
list_item_count = 0;
|
||||
list_btns[list_item_count++] = lv_list_add_btn(list, NULL, "WiFi scanning underway!");
|
||||
|
||||
xSemaphoreGive(wifi_scanf_semaphore);
|
||||
}
|
||||
}
|
||||
|
||||
static void wifi_time_cb(lv_timer_t *timer)
|
||||
{
|
||||
char str[50] = {0};
|
||||
char str_wifi_ip[32] = {0};
|
||||
bsp_wifi_get_ip(str_wifi_ip);
|
||||
sprintf(str, "IP: %s", str_wifi_ip);
|
||||
lv_label_set_text(lable_wifi_ip, str);
|
||||
}
|
||||
|
||||
static void lvgl_wifi_task(void *arg)
|
||||
{
|
||||
lv_obj_t *label;
|
||||
wifi_ap_record_t ap_info[LIST_BTN_LEN_MAX];
|
||||
while (1)
|
||||
{
|
||||
xSemaphoreTake(wifi_scanf_semaphore, portMAX_DELAY);
|
||||
printf("wifi_scanf!!\r\n");
|
||||
memset(ap_info, 0, sizeof(ap_info));
|
||||
if (bsp_wifi_scan(ap_info, &list_item_count, LIST_BTN_LEN_MAX))
|
||||
{
|
||||
lv_obj_del(list_btns[0]);
|
||||
if (lvgl_port_lock(0))
|
||||
{
|
||||
for (int i = 0; i < list_item_count && i < LIST_BTN_LEN_MAX; i++)
|
||||
{
|
||||
list_btns[i] = lv_list_add_btn(list, NULL, (char *)ap_info[i].ssid);
|
||||
label = lv_label_create(list_btns[i]);
|
||||
lv_label_set_text_fmt(label, "%d db", ap_info[i].rssi);
|
||||
}
|
||||
lvgl_port_unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wifi_tile_init(lv_obj_t *parent)
|
||||
{
|
||||
/*Create a list*/
|
||||
list = lv_list_create(parent);
|
||||
|
||||
lv_obj_t *lable = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(lable, &lv_font_montserrat_20, LV_PART_MAIN);
|
||||
lv_label_set_text(lable, "WiFi");
|
||||
lv_obj_align(lable, LV_ALIGN_TOP_MID, 0, 3);
|
||||
|
||||
lable_wifi_ip = lv_label_create(parent);
|
||||
lv_label_set_text(lable_wifi_ip, "IP: 0.0.0.0");
|
||||
lv_obj_align(lable_wifi_ip, LV_ALIGN_TOP_MID, 0, 30);
|
||||
|
||||
lv_obj_set_size(list, lv_pct(100), lv_pct(65));
|
||||
lv_obj_align(list, LV_ALIGN_TOP_MID, 0, 50);
|
||||
|
||||
lv_obj_t *btn = lv_btn_create(parent);
|
||||
lv_obj_set_size(btn, lv_pct(80), 40);
|
||||
lable = lv_label_create(btn);
|
||||
lv_label_set_text(lable, "scan");
|
||||
lv_obj_align(lable, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -10);
|
||||
lv_obj_add_event_cb(btn, btn_wifi_scan_event_handler, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
wifi_scanf_semaphore = xSemaphoreCreateBinary();
|
||||
xTaskCreate(lvgl_wifi_task, "lvgl_wifi_task", 1024 * 10, NULL, 0, NULL);
|
||||
|
||||
lv_timer_create(wifi_time_cb, 1000, NULL);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
#ifndef __WIFI_TILE_H__
|
||||
#define __WIFI_TILE_H__
|
||||
|
||||
#include "../lvgl_ui.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void wifi_tile_init(lv_obj_t *parent);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user