BigW Consortium Gitlab

Commit 7b3c0009 by Gabor Kiss-Vamosi

delete application (moved as examples to a new repo)

parent a5c85244
/**
* @file lv_app.h
*
*/
#ifndef LV_APP_H
#define LV_APP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"
#if LV_APP_ENABLE != 0
/*********************
* DEFINES
*********************/
/*Check dependencies*/
#if LV_OBJ_FREE_P == 0
#error "lv_app: Free pointer is required for application. Enable it lv_conf.h: LV_OBJ_FREE_P 1"
#endif
#if LV_OBJ_FREE_NUM == 0
#error "lv_app: Free number is required for application. Enable it lv_conf.h: LV_OBJ_FREE_NUM 1"
#endif
#if DM_CUSTOM == 0 && DM_MEM_SIZE < (2 * 1024)
#error "lv_app: not enough dynamic memory. Increase it in misc_conf.h: DM_MEM_SIZE"
#endif
/**********************
* TYPEDEFS
**********************/
typedef enum
{
LV_APP_MODE_NONE = 0x0000,
LV_APP_MODE_NOT_LIST = 0x0001, /*Do not list the application*/
LV_APP_MODE_NO_SC_TITLE = 0x0002, /*No short cut title*/
}lv_app_mode_t;
typedef enum
{
LV_APP_COM_TYPE_CHAR, /*Stream of characters. Not '\0' terminated*/
LV_APP_COM_TYPE_INT, /*Stream of 'int32_t' numbers*/
LV_APP_COM_TYPE_LOG, /*String about an event to log*/
LV_APP_COM_TYPE_TRIG, /*A trigger to do some specific action (data is ignored)*/
LV_APP_COM_TYPE_INV, /*Invalid type*/
LV_APP_COM_TYPE_NUM, /*Indicates the number of com. types*/
}lv_app_com_type_t;
struct __LV_APP_DSC_T;
typedef struct
{
const struct __LV_APP_DSC_T * dsc;
char * name;
lv_obj_t * sc;
lv_obj_t * sc_title;
lv_obj_t * win;
lv_obj_t * conf_win;
void * app_data;
void * sc_data;
void * win_data;
}lv_app_inst_t;
typedef struct __LV_APP_DSC_T
{
const char * name;
lv_app_mode_t mode;
void (*app_run)(lv_app_inst_t *, void *);
void (*app_close) (lv_app_inst_t *);
void (*com_rec) (lv_app_inst_t *, lv_app_inst_t *, lv_app_com_type_t, const void *, uint32_t);
void (*sc_open) (lv_app_inst_t *, lv_obj_t *);
void (*sc_close) (lv_app_inst_t *);
void (*win_open) (lv_app_inst_t *, lv_obj_t *);
void (*win_close) (lv_app_inst_t *);
void (*conf_open) (lv_app_inst_t *, lv_obj_t * );
uint16_t app_data_size;
uint16_t sc_data_size;
uint16_t win_data_size;
}lv_app_dsc_t;
typedef struct {
lv_style_t menu;
lv_style_t menu_btn_rel;
lv_style_t menu_btn_pr;
lv_style_t sc_rel;
lv_style_t sc_pr;
lv_style_t sc_send_rel;
lv_style_t sc_send_pr;
lv_style_t sc_rec_rel;
lv_style_t sc_rec_pr;
lv_style_t sc_title;
lv_style_t win_header;
lv_style_t win_scrl;
lv_style_t win_cbtn_rel;
lv_style_t win_cbtn_pr;
}lv_app_style_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the application system
*/
void lv_app_init(void);
/**
* Get screen of the applications
*/
lv_obj_t * lv_scr_app(void);
/**
* Allocate a new application descriptor
* @return pointer to an lv_app_dsc_t pointer. Save here a pointer to an app. dsc.
* E.g. *dsc = &my_app_dsc;
*/
lv_app_dsc_t ** lv_app_add_dsc(void);
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to an application specific configuration structure or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
lv_app_inst_t * lv_app_run(const lv_app_dsc_t * app_dsc, void * conf);
/**
* Close a running application. Close the Window and the Shortcut too if opened.
* @param app pointer to an application
*/
void lv_app_close(lv_app_inst_t * app);
/**
* Open a shortcut for an application
* @param app pointer to an application
* @return pointer to the shortcut
*/
lv_obj_t * lv_app_sc_open(lv_app_inst_t * app);
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
void lv_app_sc_close(lv_app_inst_t * app);
/**
* Open the application in a window
* @param app pointer to an application
* @return pointer to the shortcut
*/
lv_obj_t * lv_app_win_open(lv_app_inst_t * app);
/**
* Close the window of an application
* @param app pointer to an application
*/
void lv_app_win_close(lv_app_inst_t * app);
/**
* Send data to other applications
* @param app_send pointer to the application which is sending the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
* @return number application which were received the message
*/
uint16_t lv_app_com_send(lv_app_inst_t * app_send, lv_app_com_type_t type , const void * data, uint32_t size);
/**
* Test an application communication connection
* @param sender pointer to an application which sends data
* @param receiver pointer to an application which receives data
* @return false: no connection, true: there is connection
*/
bool lv_app_con_check(lv_app_inst_t * sender, lv_app_inst_t * receiver);
/**
* Create a new connection between two applications
* @param sender pointer to a data sender application
* @param receiver pointer to a data receiver application
*/
void lv_app_con_set(lv_app_inst_t * sender, lv_app_inst_t * receiver);
/**
* Delete a communication connection
* @param sender pointer to a data sender application or NULL to be true for all sender
* @param receiver pointer to a data receiver application or NULL to be true for all receiver
*/
void lv_app_con_del(lv_app_inst_t * sender, lv_app_inst_t * receiver);
/**
* Get the application descriptor from its name
* @param name name of the app. dsc.
* @return pointer to the app. dsc.
*/
const lv_app_dsc_t * lv_app_dsc_get(const char * name);
/**
* Rename an application
* @param app pointer to an application
* @param name a string with the new name
*/
void lv_app_rename(lv_app_inst_t * app, const char * name);
/**
* Get the window object from an object located on the window
* @param obj pointer to an object on the window
* @return pointer to the window of 'obj'
*/
lv_obj_t * lv_app_win_get_from_obj(lv_obj_t * obj);
/**
* Read the list of the running applications. (Get he next element)
* @param prev the previous application (at the first call give NULL to get the first application)
* @param dsc pointer to an application descriptor to filer the applications (NULL to do not filter)
* @return pointer to the next running application or NULL if no more
*/
lv_app_inst_t * lv_app_get_next(lv_app_inst_t * prev, lv_app_dsc_t * dsc);
/**
* Read the list of applications descriptors. (Get he next element)
* @param prev the previous application descriptors(at the first call give NULL to get the first)
* @return pointer to the next application descriptors or NULL if no more
*/
lv_app_dsc_t ** lv_app_dsc_get_next(lv_app_dsc_t ** prev);
/**
* Get a pointer to the application style structure. If modified then 'lv_app_refr_style' should be called
* @return pointer to the application style structure
*/
lv_app_style_t * lv_app_style_get(void);
/**********************
* MACROS
**********************/
/**********************
* POST-INCLUDES
*********************/
#include "lvgl/lv_app/lv_app_util/lv_app_kb.h"
#include "lvgl/lv_app/lv_app_util/lv_app_fsel.h"
#include "lvgl/lv_app/lv_app_util/lv_app_notice.h"
#include "lvgl/lv_appx/lv_app_example.h"
#include "lvgl/lv_appx/lv_app_phantom.h"
#include "lvgl/lv_appx/lv_app_sysmon.h"
#include "lvgl/lv_appx/lv_app_terminal.h"
#include "lvgl/lv_appx/lv_app_files.h"
#include "lvgl/lv_appx/lv_app_wifi.h"
#include "lvgl/lv_appx/lv_app_gsm.h"
#include "lvgl/lv_appx/lv_app_ethernet.h"
#include "lvgl/lv_appx/lv_app_benchmark.h"
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_H*/
/**
* @file lv_app_fsel.h
*
*/
#ifndef LV_APP_FSEL_H
#define LV_APP_FSEL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#if USE_LV_APP_FSEL != 0
/*********************
* DEFINES
*********************/
/*Add the required configurations*/
#ifndef LV_APP_FSEL_FN_MAX_LEN
#define LV_APP_FSEL_FN_MAX_LEN 128
#endif
#ifndef LV_APP_FSEL_PATH_MAX_LEN
#define LV_APP_FSEL_PATH_MAX_LEN 256
#endif
#ifndef LV_APP_FSEL_PAGE_SIZE
#define LV_APP_FSEL_PAGE_SIZE 8
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the File selector utility
*/
void lv_app_fsel_init(void);
/**
* Open the File selector
* @param path start path
* @param filter show only files with a specific extension, e.g. "wav".
* "/" means filter to folders.
* @param param a free parameter which will be added to 'ok_action'
* @param ok_action an action to call when a file or folder is chosen (give 'param' and the path as parameters)
*/
void lv_app_fsel_open(const char * path, const char * filter, void * param,
void (*ok_action)(void *, const char *));
/**
* Close the File selector
*/
void lv_app_fsel_close(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_FSEL_H*/
/**
* @file lv_app_kb.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_kb.h"
#if USE_LV_APP_KB != 0
#include "lvgl/lv_objx/lv_btnm.h"
#include "lvgl/lv_objx/lv_ta.h"
/*********************
* DEFINES
*********************/
#ifndef LV_APP_KB_ANIM_TIME
#define LV_APP_KB_ANIM_TIME 300 /*ms*/
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static lv_action_res_t lv_app_kb_action(lv_obj_t * btnm, uint16_t i);
/**********************
* STATIC VARIABLES
**********************/
static lv_obj_t * kb_btnm;
static lv_obj_t * kb_win;
static lv_obj_t * kb_ta;
static const char * kb_map_lc[] = {
"\0051#", "\004q", "\004w", "\004e", "\004r", "\004t", "\004y", "\004u", "\004i", "\004o", "\004p", "\007Del", "\n",
"\006ABC", "\003a", "\003s", "\003d", "\003f", "\003g", "\003h", "\003j", "\003k", "\003l", "\010Enter", "\n",
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_uc[] = {
"\0051#", "\004Q", "\004W", "\004E", "\004R", "\004T", "\004Y", "\004U", "\004I", "\004O", "\004P", "\007Del", "\n",
"\006abc", "\003A", "\003S", "\003D", "\003F", "\003G", "\003H", "\003J", "\003K", "\003L", "\010Enter", "\n",
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_spec[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\002Del", "\n",
"\002abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n",
"\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n",
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_num[] = {
"1", "2", "3", "\002Hide","\n",
"4", "5", "6", "\002Ok", "\n",
"7", "8", "9", "\002Del", "\n",
"+/-", "0", ".", "Left", "Right", ""
};
static cord_t kb_ta_ori_size;
static uint8_t kb_mode;
static void (*kb_close_action)(lv_obj_t *);
static void (*kb_ok_action)(lv_obj_t *);
static lv_style_t style_bg;
static lv_style_t style_btn_rel;
static lv_style_t style_btn_pr;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application keyboard
*/
void lv_app_kb_init(void)
{
lv_app_style_t * app_style = lv_app_style_get();
memcpy(&style_bg, &app_style->menu, sizeof(lv_style_t));
style_bg.opa = OPA_COVER;
style_bg.hpad = 0;
style_bg.vpad = 0;
style_bg.opad = 0;
memcpy(&style_btn_rel, &app_style->menu_btn_rel, sizeof(lv_style_t));
style_btn_rel.radius = 0;
style_btn_rel.bwidth = 1;
memcpy(&style_btn_pr, &app_style->menu_btn_pr, sizeof(lv_style_t));
style_btn_pr.radius = 0;
style_btn_pr.bwidth = 1;
}
/**
* Open a keyboard for a text area object
* @param ta pointer to a text area object
* @param mode 'OR'd values of 'lv_app_kb_mode_t' enum
* @param close a function to call when the keyboard is closed
* @param ok a function to called when the "Ok" button is pressed
* @return the created button matrix objects
*/
lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *))
{
/*Close the previous keyboard*/
if(kb_btnm != NULL) {
lv_app_kb_close(false);
}
/*Save some parameters*/
kb_ta = ta;
kb_mode = mode;
kb_close_action = close;
kb_ok_action = ok;
/*Create a button matrix for the keyboard */
kb_btnm = lv_btnm_create(lv_scr_act(), NULL);
lv_obj_set_style(kb_btnm, &style_bg);
lv_obj_set_size(kb_btnm, LV_HOR_RES, LV_VER_RES / 2);
lv_obj_align(kb_btnm, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
lv_btnm_set_action(kb_btnm, lv_app_kb_action);
if(mode & LV_APP_KB_MODE_TXT) {
style_btn_rel.font = font_get(LV_APP_FONT_MEDIUM);
style_btn_pr.font = font_get(LV_APP_FONT_MEDIUM);
lv_btnm_set_map(kb_btnm, kb_map_lc);
}
else if(mode & LV_APP_KB_MODE_NUM) {
style_btn_rel.font = font_get(LV_APP_FONT_LARGE);
style_btn_pr.font = font_get(LV_APP_FONT_LARGE);
lv_btnm_set_map(kb_btnm, kb_map_num);
}
lv_btnm_set_styles_btn(kb_btnm, &style_btn_rel, &style_btn_pr);
kb_win = NULL;
kb_ta_ori_size = 0;
if(mode & LV_APP_KB_MODE_WIN_RESIZE) {
/*Reduce the size of the window and align it to the top*/
kb_win = lv_app_win_get_from_obj(kb_ta);
lv_obj_set_height(kb_win, LV_VER_RES / 2);
lv_obj_set_y(kb_win, 0);
/*If the text area is higher then the new size of the window reduce its size too*/
cord_t cont_h = lv_obj_get_height(kb_win) - lv_obj_get_height(lv_win_get_header(kb_win));
kb_ta_ori_size = lv_obj_get_height(kb_ta);
if(lv_obj_get_height(kb_ta) > cont_h - LV_DPI / 10) {
lv_obj_set_height(kb_ta, cont_h - LV_DPI / 10);
}
lv_page_focus(lv_win_get_page(kb_win), kb_ta, 0);
}
lv_ta_set_cursor_pos(kb_ta, LV_TA_CUR_LAST);
if(kb_mode & LV_APP_KB_MODE_CUR_MANAGE) {
lv_ta_set_cursor_show(kb_ta, true);
}
if(kb_mode & LV_APP_KB_MODE_ANIM_IN) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_IN, LV_APP_KB_ANIM_TIME, 0, NULL);
}
return kb_btnm;
}
/**
* Close the keyboard
* @param ok true: call the ok function, false: call the close function
*/
void lv_app_kb_close(bool ok)
{
if(kb_btnm == NULL) return;
if(ok == false) {
if(kb_close_action != NULL) kb_close_action(kb_ta);
} else {
if(kb_ok_action != NULL) kb_ok_action(kb_ta);
}
/*Reset the modified sizes*/
if((kb_mode & LV_APP_KB_MODE_WIN_RESIZE) && kb_win != NULL) {
lv_obj_set_height(kb_ta, kb_ta_ori_size);
lv_obj_set_size(kb_win, LV_HOR_RES, LV_VER_RES);
kb_win = NULL;
}
if(kb_mode & LV_APP_KB_MODE_CUR_MANAGE) {
lv_ta_set_cursor_show(kb_ta, false);
}
if(kb_mode & LV_APP_KB_MODE_ANIM_OUT) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_OUT, LV_APP_KB_ANIM_TIME, 0, lv_obj_del);
} else {
lv_obj_del(kb_btnm);
}
kb_btnm = NULL;
kb_ta = NULL;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Called when a button of 'kb_btnm' is released
* @param btnm pointer to 'kb_btnm'
* @param i the index of the released button from the current btnm map
* @return LV_ACTION_RES_INV if the btnm is deleted else LV_ACTION_RES_OK
*/
static lv_action_res_t lv_app_kb_action(lv_obj_t * btnm, uint16_t i)
{
const char ** map = lv_btnm_get_map(btnm);
const char * txt = map[i];
/*Ignore the unit size number of the text*/
if(txt[0] <= '\011') txt++;
/*Do the corresponding action according to the text of the button*/
if(strcmp(txt, "abc") == 0) {
lv_btnm_set_map(btnm, kb_map_lc);
} else if(strcmp(txt, "ABC") == 0) {
lv_btnm_set_map(btnm, kb_map_uc);
} else if(strcmp(txt, "1#") == 0) {
lv_btnm_set_map(btnm, kb_map_spec);
} else if(strcmp(txt, "Enter") == 0) {
lv_ta_add_char(kb_ta, '\n');
} else if(strcmp(txt, "Left") == 0) {
lv_ta_cursor_left(kb_ta);
} else if(strcmp(txt, "Right") == 0) {
lv_ta_cursor_right(kb_ta);
} else if(strcmp(txt, "Del") == 0) {
lv_ta_del(kb_ta);
} else if(strcmp(txt, "+/-") == 0) {
uint16_t cur = lv_ta_get_cursor_pos(kb_ta);
const char * ta_txt = lv_ta_get_txt(kb_ta);
if(ta_txt[0] == '-') {
lv_ta_set_cursor_pos(kb_ta, 1);
lv_ta_del(kb_ta);
lv_ta_add_char(kb_ta, '+');
lv_ta_set_cursor_pos(kb_ta, cur);
} else if(ta_txt[0] == '+') {
lv_ta_set_cursor_pos(kb_ta, 1);
lv_ta_del(kb_ta);
lv_ta_add_char(kb_ta, '-');
lv_ta_set_cursor_pos(kb_ta, cur);
} else {
lv_ta_set_cursor_pos(kb_ta, 0);
lv_ta_add_char(kb_ta, '-');
lv_ta_set_cursor_pos(kb_ta, cur + 1);
}
} else if(strcmp(txt, "Hide") == 0) {
lv_app_kb_close(false);
return LV_ACTION_RES_INV;
} else if(strcmp(txt, "Ok") == 0) {
lv_app_kb_close(true);
return LV_ACTION_RES_INV;
} else {
lv_ta_add_text(kb_ta, txt);
}
if(kb_mode & LV_APP_KB_MODE_WIN_RESIZE) {
#if LV_APP_ANIM_LEVEL != 0
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
#else
lv_page_focus(lv_win_get_page(kb_win), kb_ta, 0);
#endif
}
return LV_ACTION_RES_OK;
}
#endif /*LV_APP_ENABLE != 0*/
/**
* @file lv_app_kb.h
*
*/
#ifndef LV_APP_KB_H
#define LV_APP_KB_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#if USE_LV_APP_KB != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef enum
{
LV_APP_KB_MODE_TXT = 0x0001,
LV_APP_KB_MODE_NUM = 0x0002,
LV_APP_KB_MODE_WIN_RESIZE = 0x0004,
LV_APP_KB_MODE_CUR_MANAGE = 0x0008,
LV_APP_KB_MODE_ANIM_IN = 0x0010,
LV_APP_KB_MODE_ANIM_OUT = 0x0020,
}lv_app_kb_mode_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the application keyboard
*/
void lv_app_kb_init(void);
/**
* Open a keyboard for a text area object
* @param ta pointer to a text area object
* @param mode 'OR'd values of 'lv_app_kb_mode_t' enum
* @param close a function to call when the keyboard is closed
* @param ok a function to called when the "Ok" button is pressed
* @return the created button matrix objects
*/
lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *));
/**
* Close the keyboard
* @param ok true: call the ok function, false: call the close function
*/
void lv_app_kb_close(bool ok);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_KB_H*/
/**
* @file lv_app_notice.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_notice.h"
#if USE_LV_APP_NOTICE != 0
#include "../../lv_objx/lv_cont.h"
#include "../../lv_objx/lv_label.h"
#include "misc/gfx/anim.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
static lv_obj_t * notice_h;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the Notifications
*/
void lv_app_notice_init(void)
{
notice_h = lv_cont_create(lv_scr_act(), NULL);
lv_obj_set_size(notice_h, LV_HOR_RES, LV_VER_RES - LV_DPI / 8);
lv_obj_set_y(notice_h, LV_DPI / 8);
lv_obj_set_click(notice_h, false);
lv_obj_set_style(notice_h, lv_style_get(LV_STYLE_TRANSP, NULL));
lv_cont_set_layout(notice_h, LV_CONT_LAYOUT_COL_R);
}
/**
* Add a notification with a given text
* @param format pritntf-like format string
* @return pointer the notice which is a message box (lv_mbox) object
*/
lv_obj_t * lv_app_notice_add(const char * format, ...)
{
char txt[LV_APP_NOTICE_MAX_LEN];
va_list va;
va_start(va, format);
vsprintf(txt,format, va);
va_end(va);
lv_obj_t * mbox;
mbox = lv_mbox_create(notice_h, NULL);
lv_mbox_set_text(mbox, txt);
lv_mbox_set_anim_close_time(mbox, LV_APP_NOTICE_CLOSE_ANIM_TIME);
#if LV_APP_NOTICE_SHOW_TIME != 0
lv_mbox_start_auto_close(mbox, LV_APP_NOTICE_SHOW_TIME);
#endif
/*Delete the last children if there are too many*/
uint32_t child_num = lv_obj_get_child_num(notice_h);
if(child_num > LV_APP_NOTICE_MAX_NUM) {
lv_obj_t * last_child = ll_get_tail(&notice_h->child_ll);
lv_obj_del(last_child);
}
/*make sure the notices are on the top*/
lv_obj_set_parent(notice_h, lv_scr_act());
return mbox;
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif
/**
* @file lv_app_notice.h
*
*/
#ifndef LV_APP_NOTICE_H
#define LV_APP_NOTICE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#include <stdarg.h>
#if USE_LV_APP_NOTICE != 0
/*********************
* DEFINES
*********************/
/*Add the required configurations*/
#ifndef LV_APP_NOTICE_SHOW_TIME
#define LV_APP_NOTICE_SHOW_TIME 4000
#endif
#ifndef LV_APP_NOTICE_CLOSE_ANIM_TIME
#define LV_APP_NOTICE_CLOSE_ANIM_TIME 300
#endif
#ifndef LV_APP_NOTICE_MAX_NUM
#define LV_APP_NOTICE_MAX_NUM 6
#endif
#ifndef LV_APP_NOTICE_MAX_LEN
#define LV_APP_NOTICE_MAX_LEN 256
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the Notifications
*/
void lv_app_notice_init(void);
/**
* Add a notification with a given text
* @param format pritntf-like format string
* @return pointer the notice which is a message box (lv_mbox) object
*/
lv_obj_t * lv_app_notice_add(const char * format, ...);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_NOTICE_H*/
/**
* @file lv_app_benchmark.h
*
*/
#ifndef LV_APP_BENCHMARK_H
#define LV_APP_BENCHMARK_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_benchmark_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_benchmark_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_BENCHMARK_H */
/**
* @file lv_app_ethernet.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_ethernet.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include "hal/eth/eth.h"
#include "misc/os/ptask.h"
#include "hal/systick/systick.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
#define ETH_MONITOR_PERIOD 1000 /*ms*/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
uint8_t * last_msg_dp;
uint16_t last_msg_size;
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void eth_state_monitor_task(void * param);
static void tcp_transf_cb(eth_state_t state, const char * txt);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Ethernet",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = my_win_open,
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
static lv_app_inst_t * app_act_com = NULL;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_ethernet_init(void)
{
ptask_create(eth_state_monitor_task, ETH_MONITOR_PERIOD, PTASK_PRIO_LOW, NULL);
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_ethernet_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
eth_tcp_transf(data, size, tcp_transf_cb);
app_act_com = app_rec;
my_app_data_t * adata = app_act_com->app_data;
if(adata->last_msg_dp != NULL) dm_free(adata->last_msg_dp);
adata->last_msg_dp = dm_alloc(size);
memcpy(adata->last_msg_dp, data, size);
adata->last_msg_size = size;
}
}
/**
* Open a shortcut for an application
* @param app pointer to an application
* @param sc pointer to an object where the application
* can create content of the shortcut
*/
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "Empty");
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
static void my_sc_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_sc_data'*/
}
/**
* Open the application in a window
* @param app pointer to an application
* @param win pointer to a window object where
* the application can create content
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
}
/**
* Close the window of an application
* @param app pointer to an application
*/
static void my_win_close(lv_app_inst_t * app)
{
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
static void eth_state_monitor_task(void * param)
{
/* The eth. should be busy if there is sg. to send.
* It means fail during last send. Try again*/
if(app_act_com != NULL && eth_busy() == false) {
/*Try to send the message again*/
lv_app_notice_add("Resend Ethernet message");
my_app_data_t * adata = app_act_com->app_data;
eth_tcp_transf(adata->last_msg_dp, adata->last_msg_size, tcp_transf_cb);
}
}
static void tcp_transf_cb(eth_state_t state, const char * txt)
{
if(state == ETH_STATE_OK) {
uint16_t size = txt[0] + ((txt[1] << 8) & 0xFF00);
char buf[256];
memcpy(buf, &txt[2], size);
buf[size] = '\0';
lv_app_com_send(app_act_com, LV_APP_COM_TYPE_CHAR, &txt[2], size);
my_app_data_t * adata = app_act_com->app_data;
dm_free(adata->last_msg_dp);
adata->last_msg_dp = NULL;
adata->last_msg_size = 0;
app_act_com = NULL;
}else if(state == ETH_STATE_ERROR) {
lv_app_notice_add("Ethernet TCP transfer error\n%s", txt);
}
}
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0*/
/**
* @file lv_app_ethernet.h
*
*/
#ifndef LV_APP_ETHERNET_H
#define LV_APP_ETHERNET_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_ethernet_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_ethernet_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_ETHERNET_H */
/**
* @file lv_app_example.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_example.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_indev_proc_t * indev_proc);
static void kb_ok_action(lv_obj_t * ta);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Example",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = my_win_open,
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_example_init(void)
{
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
my_sc_data_t * sc_data = app_rec->sc_data;
if (sc_data->label != NULL) {
lv_label_set_text_array(sc_data->label, data, size);
lv_obj_align(sc_data->label , NULL,LV_ALIGN_CENTER, 0, 0);
}
}
}
/**
* Open a shortcut for an application
* @param app pointer to an application
* @param sc pointer to an object where the application
* can create content of the shortcut
*/
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "Empty");
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
static void my_sc_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_sc_data'*/
}
/**
* Open the application in a window
* @param app pointer to an application
* @param win pointer to a window object where
* the application can create content
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
lv_obj_t * ta;
ta = lv_ta_create(win, NULL);
lv_obj_set_size_us(ta, 200, 100);
lv_obj_set_pos_us(ta, 0, 0);
lv_obj_set_free_p(ta, app);
lv_page_set_rel_action(ta, ta_rel_action);
lv_ta_set_text(ta, "Write a text to send to the other applications");
}
/**
* Close the window of an application
* @param app pointer to an application
*/
static void my_win_close(lv_app_inst_t * app)
{
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
/**
* Called when the text area on the window is released to open the app. keyboard
* @param ta pointer to the text area on the window
* @param indev_proc pointer to the caller display input
* @return LV_ACTION_RES_OK because the text area is not deleted
*/
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_indev_proc_t * indev_proc)
{
lv_ta_set_text(ta, ""); /*Clear the ta*/
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE, NULL, kb_ok_action);
return LV_ACTION_RES_OK;
}
/**
* Called when the "Ok" button is pressed on the app. keyboard
* @param ta pointer to the text area assigned to the app. kexboard
*/
static void kb_ok_action(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
const char * txt = lv_ta_get_txt(ta);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, txt, strlen(txt));
}
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
/**
* @file lv_app_example.h
*
*/
#ifndef LV_APP_EXAMPLE_H
#define LV_APP_EXAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_example_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_example_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */
/**
* @file lv_app_files.h
*
*/
#ifndef LV_APP_FILES_H
#define LV_APP_FILES_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_files_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_files_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */
/**
* @file lv_app_gsm.h
*
*/
#ifndef LV_APP_GSM_H
#define LV_APP_GSM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_GSM != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_gsm_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_gsm_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */
/**
* @file lv_app_example.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_phantom.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
void (*com_listen)(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size);
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Phantom",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = NULL,
.win_close = NULL,
.sc_open = NULL,
.sc_close = NULL,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_phantom_init(void)
{
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_phantom_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
my_app_data_t * app_data = app->app_data;
app_data->com_listen = NULL;
if(conf != NULL) {
lv_app_phantom_conf_t * my_conf = conf;
app_data->com_listen = my_conf->com_listen;
}
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
my_app_data_t * app_data = app_rec->app_data;
if(app_data->com_listen != NULL) {
app_data->com_listen(app_send, app_rec, type, data, size);
}
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
/**
* @file lv_app_phantom.h
*
*/
#ifndef LV_APP_PHANTOM_H
#define LV_APP_PHANTOM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
void (*com_listen)(lv_app_inst_t * app_send,
lv_app_inst_t * app_rec,
lv_app_com_type_t type ,
const void * data, uint32_t size);
}lv_app_phantom_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_phantom_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_PHANTOM_H */
/**
* @file lv_app_example.h
*
*/
#ifndef LV_APP_SYSMON_H
#define LV_APP_SYSMON_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_sysmon_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_sysmon_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_SYSMON_H */
/**
* @file lv_app_terminal.h
*
*/
#ifndef LV_APP_TERMINAL_H
#define LV_APP_TERMINAL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef enum
{
LV_APP_TERMINAL_FORMAT_ASCII,
LV_APP_TERMINAL_FORMAT_HEX,
}lv_app_terminal_format_t;
typedef struct
{
lv_app_terminal_format_t format; /*Data display format*/
lv_app_com_type_t com_type; /*The listened communication type (channel) */
}lv_app_terminal_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_terminal_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_TERMINAL_H */
/**
* @file lv_app_example.h
*
*/
#ifndef LV_APP_WIFI_H
#define LV_APP_WIFI_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_WIFI != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_wifi_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_wifi_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment