diff --git a/.gitmodules b/.gitmodules index 389e23ce1..4db194dfe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,10 @@ [submodule "Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/kendryte-sdk/kendryte-sdk-source"] path = Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/kendryte-sdk/kendryte-sdk-source url = https://code.gitlink.org.cn/chunyexixiaoyu/kendryte-sdk-source.git +[submodule "APP_Framework/lib/lorawan/lora_radio_driver"] + path = APP_Framework/lib/lorawan/lora_radio_driver + url = https://gitlink.org.cn/IACU/lora_radio_driver.git +[submodule "APP_Framework/lib/lorawan/lorawan_devicenode"] + path = APP_Framework/lib/lorawan/lorawan_devicenode + url = https://gitlink.org.cn/IACU/lorawan_devicenode.git + branch = master diff --git a/APP_Framework/Applications/app_test/Kconfig b/APP_Framework/Applications/app_test/Kconfig index 271d4cde6..45df5f5d5 100644 --- a/APP_Framework/Applications/app_test/Kconfig +++ b/APP_Framework/Applications/app_test/Kconfig @@ -235,6 +235,10 @@ menu "test app" default "/dev/qspi_W25Q128" endif endif - + + menuconfig USER_TEST_TIMER + bool "Config test soft timer" + default n + endif endmenu diff --git a/APP_Framework/Applications/app_test/Makefile b/APP_Framework/Applications/app_test/Makefile index 080fbe113..1cf919846 100644 --- a/APP_Framework/Applications/app_test/Makefile +++ b/APP_Framework/Applications/app_test/Makefile @@ -97,5 +97,9 @@ ifeq ($(CONFIG_ADD_XIZI_FETURES),y) SRC_FILES += test_can.c endif + ifeq ($(CONFIG_USER_TEST_TIMER),y) + SRC_FILES += test_timer.c + endif + include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Applications/app_test/test_timer.c b/APP_Framework/Applications/app_test/test_timer.c new file mode 100644 index 000000000..35ec844e3 --- /dev/null +++ b/APP_Framework/Applications/app_test/test_timer.c @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + +/** +* @file: test_timer.c +* @brief: a application of soft timer function +* @version: 3.0 +* @author: AIIT XUOS Lab +* @date: 2023/03/09 +*/ + +#include + +void TimerFunction(union sigval sig_val) +{ + static int cnt = 0; + printf("%s cnt %d\n", __func__, cnt++); +} + +void TestTimer(void) +{ + int ret = 0; + int timer_flags; + timer_t timer_id; + struct sigevent evp; + memset(&evp, 0, sizeof(struct sigevent)); + + timer_flags = TIMER_TRIGGER_PERIODIC; + + evp.sigev_notify = SIGEV_THREAD; + evp.sigev_notify_function = TimerFunction; + evp.sigev_notify_attributes = &timer_flags; + + ret = timer_create(CLOCK_REALTIME, &evp, &timer_id); + if (ret < 0) { + printf("%s create timer failed ret %d\n", __func__, ret); + return; + } + + struct itimerspec value; + //active time interval + value.it_interval.tv_sec = 2; + value.it_interval.tv_nsec = 0; + + //first timer set time + value.it_value.tv_sec = 2; + value.it_value.tv_nsec = 0; + + ret = timer_settime(timer_id, 1, &value, NULL); + if (ret < 0) { + printf("%s set timer time failed ret %d\n", __func__, ret); + return; + } + + printf("%s success\n", __func__); +} +PRIV_SHELL_CMD_FUNCTION(TestTimer, soft timer test, PRIV_SHELL_CMD_MAIN_ATTR); + diff --git a/APP_Framework/Framework/control/shared/control.c b/APP_Framework/Framework/control/shared/control.c index 871e31eb6..c0a4dc9ea 100755 --- a/APP_Framework/Framework/control/shared/control.c +++ b/APP_Framework/Framework/control/shared/control.c @@ -126,6 +126,7 @@ static int ControlAnalyzeRecipe(ControlProtocolType control_protocol, const char return -1; } + strncpy(control_protocol->device->dev_name, control_protocol->recipe->device_name, 20); control_protocol->protocol_type = control_protocol->recipe->protocol_type; /*Get the variable need to read from recipe file*/ @@ -254,6 +255,15 @@ int ControlFrameworkInit(void) ret = -1; goto _out; } + + control_protocol->device = (struct ControlDevice *)PrivMalloc(sizeof(struct ControlDevice)); + if (NULL == control_protocol->device) { + printf("%s malloc control device failed!\n", __func__); + PrivFree(control_protocol->device); + PrivFree(control_protocol); + ret = -1; + goto _out; + } //Control Protocol Struct Init ret = ControlProtocolInit(control_protocol); @@ -274,6 +284,7 @@ int ControlFrameworkInit(void) } control_protocol->protocol_status = CONTROL_REGISTERED; + control_protocol->device->status = CONTROL_REGISTERED; ret = ControlPeripheralInit(control_protocol->recipe); if (ret < 0) { @@ -287,3 +298,57 @@ int ControlFrameworkInit(void) _out: return ret; } + +static char *const protocol_type_str[] = +{ + "TYPE_START", + "S7", + "MODBUS_TCP", + "MODBUS_UART", + "OPC_UA", + "FINS", + "MELSEC_1E", + "MELSEC_3E_Q_L", + "MELSEC_3E_IQ_R", + "MELSEC_1C", + "MELSEC_3C", + "TYPE_END" +}; + +/** + * @description: Control Framework Shell Cmd Information + * @param void + * @return success : 0 error : -1 + */ +void ShowControl(void) +{ + int i = 0; + int maxlen; + const char *item_type = "control_protocol_type"; + const char *item_name_0 = "control_protocol_name"; + const char *item_name_1 = "control_device_name"; + const char *item_status = "status"; + + ControlProtocolType control_protocol = ControlProtocolFind(); + + printf(" %-28s%-28s%-26s%-20s\n", item_type, item_name_0, item_name_1, item_status); + maxlen = 90; + while (i < maxlen) { + i++; + if (maxlen == i) { + printf("-\n"); + } else { + printf("-"); + } + } + + if (control_protocol) { + printf("%s", " "); + KPrintf("%-28s%-28s%-26s%-8d\n", + protocol_type_str[1], + protocol_type_str[1], + control_protocol->device->dev_name, + control_protocol->device->status); + } +} +PRIV_SHELL_CMD_FUNCTION(ShowControl, show control framework information, PRIV_SHELL_CMD_FUNC_ATTR); diff --git a/APP_Framework/Framework/control/shared/control.h b/APP_Framework/Framework/control/shared/control.h index c64467a3e..f73cc0625 100644 --- a/APP_Framework/Framework/control/shared/control.h +++ b/APP_Framework/Framework/control/shared/control.h @@ -62,6 +62,15 @@ typedef enum CONTROL_UNREGISTERED, }ProtocolStatus; +struct ControlDevice +{ + char *dev_name; + int status; + + //to do + void *dev_done; +}; + struct ControlProtocol { char *name; @@ -70,6 +79,7 @@ struct ControlProtocol struct ControlRecipe *recipe; struct ControlDone *done; + struct ControlDevice *device; void *args; diff --git a/APP_Framework/Framework/transform_layer/xizi/transform.c b/APP_Framework/Framework/transform_layer/xizi/transform.c index 8ac037c0b..002c8f1be 100644 --- a/APP_Framework/Framework/transform_layer/xizi/transform.c +++ b/APP_Framework/Framework/transform_layer/xizi/transform.c @@ -68,6 +68,30 @@ int PrivSemaphoreAbandon(sem_t *sem) return sem_post(sem); } +/**********************event****************************/ +#ifndef SEPARATE_COMPILE +int PrivEventCreate(uint8_t flag) +{ + return UserEventCreate(flag); +} + +int PrivEvenDelete(int event) +{ + UserEventDelete(event); + return 1; +} + +int PrivEvenTrigger(int event, uint32_t set) +{ + return UserEventTrigger(event, set); +} + +int PrivEventProcess(int event, uint32_t set, uint8_t option, int32_t wait_time, unsigned int *Recved) +{ + return UserEventProcess(event, set, option, wait_time, Recved); +} +#endif + /**************************task*************************/ int PrivTaskCreate(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) @@ -107,6 +131,36 @@ uint32_t PrivGetTickTime() return CalculateTimeMsFromTick(CurrentTicksGain()); } #endif + +/******************Soft Timer*********************/ +int PrivTimerCreate(clockid_t clockid, struct sigevent * evp, timer_t * timerid) +{ + return timer_create(clockid, evp, timerid); +} + +int PrivTimerDelete(timer_t timerid) +{ + return timer_delete(timerid); +} + +int PrivTimerStartRun(timer_t timerid) +{ + return UserTimerStartRun(timerid); +} + +int PrivTimerQuitRun(timer_t timerid) +{ + return UserTimerQuitRun(timerid); +} + +int PrivTimerModify(timer_t timerid, int flags, const struct itimerspec *restrict value, + struct itimerspec *restrict ovalue) +{ + return timer_settime(timerid, flags, value, ovalue); +} + +/*************************************************/ + /*********************fs**************************/ #ifdef FS_VFS /************************Driver Posix Transform***********************/ @@ -165,6 +219,7 @@ int PrivIoctl(int fd, int cmd, void *args) case LCD_TYPE: ret = PrivLcdIoctl(fd, cmd, ioctl_cfg->args); break; + case SPI_TYPE: case I2C_TYPE: case RTC_TYPE: case ADC_TYPE: diff --git a/APP_Framework/Framework/transform_layer/xizi/transform.h b/APP_Framework/Framework/transform_layer/xizi/transform.h index dd39d1c61..fe817f18a 100644 --- a/APP_Framework/Framework/transform_layer/xizi/transform.h +++ b/APP_Framework/Framework/transform_layer/xizi/transform.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,16 @@ extern "C" { #define NAME_NUM_MAX 32 +#ifndef EVENT_AND +#define EVENT_AND (1 << 0) +#endif +#ifndef EVENT_OR +#define EVENT_OR (1 << 1) +#endif +#ifndef EVENT_AUTOCLEAN +#define EVENT_AUTOCLEAN (1 << 2) +#endif + /*********************GPIO define*********************/ #define GPIO_LOW 0x00 #define GPIO_HIGH 0x01 @@ -93,6 +104,30 @@ extern "C" { #define SERIAL_RB_BUFSZ 128 #endif +/********************SPI define*******************/ +#define SPI_MAX_CLOCK 40000000 +#define spi_device_max_num 4 + +#define SPI_LINE_CPHA (1 << 0) +#define SPI_LINE_CPOL (1 << 1) + +#define SPI_LSB (0 << 2) +#define SPI_MSB (1 << 2) + +#define SPI_DEV_MASTER (0 << 3) +#define SPI_DEV_SLAVE (1 << 3) + +#define SPI_MODE_0 (0 | 0) +#define SPI_MODE_1 (0 | SPI_LINE_CPHA) +#define SPI_MODE_2 (SPI_LINE_CPOL | 0) +#define SPI_MODE_3 (SPI_LINE_CPOL | SPI_LINE_CPHA) +#define SPI_MODE_MASK (SPI_LINE_CPHA | SPI_LINE_CPOL | SPI_MSB) + +#define SPI_CS_HIGH (1 << 4) +#define SPI_NO_CS (1 << 5) +#define SPI_3WIRE (1 << 6) +#define SPI_READY (1 << 7) + struct PinDevIrq { int irq_mode;//< RISING/FALLING/HIGH/LOW @@ -139,6 +174,15 @@ struct SerialDataCfg enum ExtSerialPortConfigure port_configure; }; +struct SpiMasterParam +{ + uint8 spi_work_mode;//CPOL CPHA + uint8 spi_frame_format;//frame format + uint8 spi_data_bit_width;//bit width + uint8 spi_data_endian;//little endian:0,big endian:1 + uint32 spi_maxfrequency;//work frequency +}; + enum IoctlDriverType { SERIAL_TYPE = 0, @@ -362,6 +406,14 @@ int PrivSemaphoreObtainNoWait(sem_t *sem); int PrivSemaphoreAbandon(sem_t *sem); int32_t PrivSemaphoreSetValue(int32_t sem, uint16_t val); +/*********************event**********************/ +#ifndef SEPARATE_COMPILE +int PrivEventCreate(uint8_t flag); +int PrivEvenDelete(int event); +int PrivEvenTrigger(int event, uint32_t set); +int PrivEventProcess(int event, uint32_t set, uint8_t option, int32_t wait_time, unsigned int *Recved); +#endif + /*********************task**************************/ int PrivTaskCreate(pthread_t *thread, const pthread_attr_t *attr, @@ -388,6 +440,13 @@ void *PrivRealloc(void *pointer, size_t size); void *PrivCalloc(size_t count, size_t size); void PrivFree(void *pointer); +/******************soft timer*********************/ +int PrivTimerCreate(clockid_t clockid, struct sigevent * evp, timer_t * timerid); +int PrivTimerDelete(timer_t timerid); +int PrivTimerStartRun(timer_t timerid); +int PrivTimerQuitRun(timer_t timerid); +int PrivTimerModify(timer_t timerid, int flags, const struct itimerspec *restrict value, + struct itimerspec *restrict ovalue); #ifdef __cplusplus } diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/Makefile b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/Makefile index abdf776a8..c6f238b2b 100644 --- a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/Makefile +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/Makefile @@ -11,4 +11,8 @@ ifeq ($(CONFIG_KERNEL_MESSAGEQUEUE),y) SRC_FILES += mqueue.c endif +ifeq ($(CONFIG_KERNEL_SOFTTIMER),y) + SRC_FILES += timer.c +endif + include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/pthread arm.h b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/pthread arm.h index e179162c5..c5b23a0f1 100644 --- a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/pthread arm.h +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/pthread arm.h @@ -32,33 +32,33 @@ extern "C" { typedef int pid_t; typedef unsigned long int pthread_t; -// struct sched_param { -// int sched_priority; /* process execution scheduling priority */ -// size_t slice; /* time slice in SCHED_RR mode (ms) */ -// }; -// typedef struct pthread_attr { -// unsigned char is_initialized; /* if the attr is initialized set to 1, otherwise set to 0 */ -// void *stackaddr; /* the start addr of the stack of the pthead */ -// size_t stacksize; /* the size of the stack of the pthead */ -// unsigned char contentionscope; /* the scope of contention, only PTHREAD_SCOPE_SYSTEM is supported */ -// unsigned char inheritsched; /* when set to PTHREAD_INHERIT_SCHED, specifies that the thread scheduling attributes -// shall be inherited from the creating thread, and the scheduling attributes in this -// attr argument shall be ignored */ -// unsigned char schedpolicy; /* the sched policy of the thread */ -// struct sched_param schedparam; /* the parameter of the thread scheduling */ -// size_t guardsize; /* guardsize is set to protect the stack, not supported */ -// unsigned char detachstate; /* when set to PTHREAD_CREATE_JOINABLE, thread will not end untill the creating thread end */ -// } pthread_attr_t; +struct sched_param { + int sched_priority; /* process execution scheduling priority */ + size_t slice; /* time slice in SCHED_RR mode (ms) */ +}; +typedef struct pthread_attr { + unsigned char is_initialized; /* if the attr is initialized set to 1, otherwise set to 0 */ + void *stackaddr; /* the start addr of the stack of the pthead */ + size_t stacksize; /* the size of the stack of the pthead */ + unsigned char contentionscope; /* the scope of contention, only PTHREAD_SCOPE_SYSTEM is supported */ + unsigned char inheritsched; /* when set to PTHREAD_INHERIT_SCHED, specifies that the thread scheduling attributes + shall be inherited from the creating thread, and the scheduling attributes in this + attr argument shall be ignored */ + unsigned char schedpolicy; /* the sched policy of the thread */ + struct sched_param schedparam; /* the parameter of the thread scheduling */ + size_t guardsize; /* guardsize is set to protect the stack, not supported */ + unsigned char detachstate; /* when set to PTHREAD_CREATE_JOINABLE, thread will not end untill the creating thread end */ +} pthread_attr_t; -// typedef struct pthread_mutexattr { -// int is_initialized; -// int type; -// int protocol; -// int prioceiling; -// int pshared; -// } pthread_mutexattr_t; +typedef struct pthread_mutexattr { + int is_initialized; + int type; + int protocol; + int prioceiling; + int pshared; +} pthread_mutexattr_t; -// typedef int pthread_mutex_t ; +typedef int pthread_mutex_t ; #ifdef __cplusplus } diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/signal.h b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/signal.h new file mode 100644 index 000000000..fd77b03bd --- /dev/null +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/signal.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2020 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** +* @file: signal.h +* @brief: the function definition of posix signal +* @version: 3.0 +* @author: AIIT XUOS Lab +* @date: 2023/3/9 +* +*/ + +#ifndef SIGNAL_H +#define SIGNAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* sigev_notify values + NOTE: P1003.1c/D10, p. 34 adds SIGEV_THREAD. */ + +#define SIGEV_NONE 1 /* No asynchronous notification shall be delivered */ + /* when the event of interest occurs. */ +#define SIGEV_SIGNAL 2 /* A queued signal, with an application defined */ + /* value, shall be delivered when the event of */ + /* interest occurs. */ +#define SIGEV_THREAD 3 /* A notification function shall be called to */ + /* perform notification. */ + +/* Signal Generation and Delivery, P1003.1b-1993, p. 63 + NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and + sigev_notify_attributes to the sigevent structure. */ +union sigval +{ + int sival_int; /* Integer signal value */ + void *sival_ptr; /* Pointer signal value */ +}; + +struct sigevent +{ + int sigev_notify; /* Notification type */ + int sigev_signo; /* Signal number */ + union sigval sigev_value; /* Signal value */ + void (*sigev_notify_function)( union sigval ); + /* Notification function */ + void *sigev_notify_attributes; /* Notification Attributes, really pthread_attr_t */ +}; + +struct siginfo +{ + uint16_t si_signo; + uint16_t si_code; + + union sigval si_value; +}; +typedef struct siginfo siginfo_t; + +#define SI_USER 0x01 /* Signal sent by kill(). */ +#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */ +#define SI_TIMER 0x03 /* Signal generated by expiration of a timer set by timer_settime(). */ +#define SI_ASYNCIO 0x04 /* Signal generated by completion of an asynchronous I/O request. */ +#define SI_MESGQ 0x05 /* Signal generated by arrival of a message on an empty message queue. */ + +typedef void (*_sig_func_ptr)(int); +typedef unsigned long sigset_t; + +struct sigaction +{ + _sig_func_ptr sa_handler; + sigset_t sa_mask; + int sa_flags; +}; + +/* + * Structure used in sigaltstack call. + */ +typedef struct sigaltstack +{ + void *ss_sp; /* Stack base or pointer. */ + int ss_flags; /* Flags. */ + size_t ss_size; /* Stack size. */ +} stack_t; + +#define SIG_SETMASK 0 /* set mask with sigprocmask() */ +#define SIG_BLOCK 1 /* set of signals to block */ +#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ + +#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) +#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) +#define sigemptyset(what) (*(what) = 0, 0) +#define sigfillset(what) (*(what) = ~(0), 0) +#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) + +#if defined(__GNUC__) + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ +#define SIGURG 16 /* urgent condition on IO channel */ +#define SIGSTOP 17 /* sendable stop signal not from tty */ +#define SIGTSTP 18 /* stop signal from tty */ +#define SIGCONT 19 /* continue a stopped process */ +#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGCLD 20 /* System V name for SIGCHLD */ +#define SIGTTIN 21 /* to readers pgrp upon background tty read */ +#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ +#define SIGIO 23 /* input/output possible signal */ +#define SIGPOLL SIGIO /* System V name for SIGIO */ +#define SIGXCPU 24 /* exceeded CPU time limit */ +#define SIGXFSZ 25 /* exceeded file size limit */ +#define SIGVTALRM 26 /* virtual time alarm */ +#define SIGPROF 27 /* profiling time alarm */ +#define SIGWINCH 28 /* window changed */ +#define SIGLOST 29 /* resource lost (eg, record-lock lost) */ +#define SIGUSR1 30 /* user defined signal 1 */ +#define SIGUSR2 31 /* user defined signal 2 */ +#define NSIG 32 /* signal 0 implied */ + +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/timer.h b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/timer.h new file mode 100644 index 000000000..91bc76101 --- /dev/null +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include/timer.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** +* @file: timer.h +* @brief: the function definition of posix soft timer +* @version: 3.0 +* @author: AIIT XUOS Lab +* @date: 2023/3/8 +* +*/ + +#ifndef TIMER_H +#define TIMER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../../switch_api/user_api.h" + +#if !defined(LIB_MUSLLIB) +#include "signal.h" +#endif + +#include + +#ifndef TIMER_TRIGGER_ONCE +#define TIMER_TRIGGER_ONCE (1 << 0) +#endif +#ifndef TIMER_TRIGGER_PERIODIC +#define TIMER_TRIGGER_PERIODIC (1 << 1) +#endif + +int timer_create(clockid_t clockid, struct sigevent * evp, timer_t * timerid); +int timer_delete(timer_t timerid); +int timer_settime(timer_t timerid, int flags, const struct itimerspec *restrict value, + struct itimerspec *restrict ovalue); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/timer.c b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/timer.c new file mode 100644 index 000000000..a13523237 --- /dev/null +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/timer.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2020 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** +* @file: timer.c +* @brief: posix api of soft timer +* @version: 3.0 +* @author: AIIT XUOS Lab +* @date: 2023/3/8 +* +*/ + +#include +#include +#include "include/timer.h" +#include "include/semaphore.h" +#include "include/pthread.h" + +static sem_t timer_sem; +static pthread_t timer_task; + +struct timer_func { + union sigval value; + int timer_flags; + void (* user_timer_function)(union sigval val); +}; + +struct timer_func g_timer_func; + +static void *timer_callback(void *args) +{ + struct sigevent *evp = (struct sigevent *)args; + + while (1) { + if (g_timer_func.user_timer_function != NULL) { + if (0 == sem_timedwait(&timer_sem, NULL)) { + g_timer_func.user_timer_function(g_timer_func.value); + } + } + } +} + +int timer_create(clockid_t clockid, struct sigevent * evp, timer_t * timerid) +{ + int timer_id; + char timer_name[16]; + + if ((NULL == evp) || (NULL == timerid)) { + errno = EINVAL; + return -1; + } + + /* Only support SIGEV_THREAD. */ + if (evp->sigev_notify != SIGEV_THREAD) { + errno = ENOTSUP; + return -1; + } + + memset(timer_name, 0, sizeof(timer_name)); + snprintf(timer_name, sizeof(timer_name), "timer_%d", clockid); + + sem_init(&timer_sem, 0, 0); + + g_timer_func.value = evp->sigev_value; + g_timer_func.user_timer_function = evp->sigev_notify_function; + g_timer_func.timer_flags = *(int *)(evp->sigev_notify_attributes); + + pthread_attr_t attr; + attr.schedparam.sched_priority = 22; + attr.stacksize = 2048; + + pthread_create(&timer_task, &attr, &timer_callback, (void *)evp); + + timer_id = UserTimerCreate(timer_name, NULL, (void *)&timer_sem, 1000, g_timer_func.timer_flags); + *timerid = timer_id; + return timer_id; +} + +int timer_delete(timer_t timerid) +{ + pthread_kill(timer_task, 0); + + UserTimerQuitRun(timerid); + + sem_destroy(&timer_sem); + + return 0; +} + +int timer_settime(timer_t timerid, int flags, const struct itimerspec *restrict value, + struct itimerspec *restrict ovalue) +{ + if (NULL == value) { + errno = EFAULT; + return -1; + } + + //reference from RTT + /* calculate timer period(tick); To avoid lost of accuracy, because "TICK_PER_SECOND" maybe 100, 1000, 1024 and so on. + * + * tick millisecond millisecond * TICK_PER_SECOND + * ------------------------- = -------------------------- ---> tick = ------------------------------------- + * TICK_PER_SECOND MILLISECOND_PER_SECOND MILLISECOND_PER_SECOND + * + */ + uint32_t ms_value = value->it_interval.tv_nsec / 1000000; + uint32_t ticks = (value->it_interval.tv_sec * TICK_PER_SECOND) + (ms_value * TICK_PER_SECOND) / 1000; + + UserTimerModify(timerid, ticks); + + if (flags) { + UserTimerStartRun(timerid); + } +} diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/Makefile b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/Makefile index 02b6b0c75..68a10858a 100644 --- a/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/Makefile +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/Makefile @@ -17,6 +17,10 @@ ifeq ($(CONFIG_SEPARATE_COMPILE),y) SRC_FILES += user_msg.c endif + ifeq ($(CONFIG_KERNEL_SOFTTIMER),y) + SRC_FILES += user_timer.c + endif + ifeq ($(CONFIG_FS_VFS),y) SRC_FILES += user_fs.c endif diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_api.h b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_api.h index c2b3c7c8c..66b77bc97 100644 --- a/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_api.h +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_api.h @@ -123,6 +123,14 @@ long UserMsgQueueRecv(int32_t mq, void *buffer, size_t size,int32_t wait_time); long UserMsgQueueReinit(int32_t mq); #endif +#ifdef KERNEL_SOFTTIMER +int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode); +long UserTimerDelete(int32_t timer_id); +long UserTimerStartRun(int32_t timer_id); +long UserTimerQuitRun(int32_t timer_id); +long UserTimerModify(int32_t timer_id, uint32_t ticks); +#endif + int open(const char *path, int flags, ...); int read(int fd, void *buf, size_t len); int write(int fd, const void *buf, size_t len); @@ -240,6 +248,14 @@ uint8_t UserGetTaskPriority(int32_t id); #define UserMsgQueueReinit KMsgQueueReinit #endif +#ifdef KERNEL_SOFTTIMER +int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode); +long UserTimerDelete(int32_t timer_id); +long UserTimerStartRun(int32_t timer_id); +long UserTimerQuitRun(int32_t timer_id); +long UserTimerModify(int32_t timer_id, uint32_t ticks); +#endif + #define UserPrintf KPrintf #endif diff --git a/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_timer.c b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_timer.c new file mode 100644 index 000000000..3057bde8e --- /dev/null +++ b/APP_Framework/Framework/transform_layer/xizi/user_api/switch_api/user_timer.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** +* @file: user_timer.c +* @brief: the priviate user api of soft timer for application +* @version: 3.0 +* @author: AIIT XUOS Lab +* @date: 2023/3/8 +* +*/ + +#include "user_api.h" + +/** + * This function will create a soft timer. + * + * @param name the name of the timer. + * @param timeout the callback of the timer. + * @param parameter the parameter of the callback function + * @param time the timeout time + * @param trigger_mode the trigger way of the timer + * + * @return id on success;ENOMEMORY/ERROR on failure + */ +int32_t UserTimerCreate(const char *name, + void (*timeout)(void *parameter), + void *parameter, + uint32_t time, + uint8_t trigger_mode) { + return (int32_t)KSwitch5(KS_USER_TIMER_CREATE, (uintptr_t)name, (uintptr_t)timeout, (uintptr_t)parameter, (uintptr_t)time, (uintptr_t)trigger_mode); +} + +/** + * This function will delete a timer. + * + * @param timer_id the id number of timer. + * + * @return EOK on success;EINVALED on failure + * + */ +x_err_t UserTimerDelete(int32_t timer_id) { + return (x_err_t)KSwitch1(KS_USER_TIMER_DELETE, (uintptr_t)timer_id); +} + +/** + * This function will startup a timer. + * + * @param timer_id the id number of timer. + * + * @return EOK on success;EINVALED on failure + * + */ +x_err_t UserTimerStartRun(int32_t timer_id) { + return (x_err_t)KSwitch1(KS_USER_TIMER_STARTRUN, (uintptr_t)timer_id); +} + +/** + * This function will stop a timer. + * + * @param timer_id the id number of timer. + * + * @return EOK on success;EINVALED on failure + * + */ +x_err_t UserTimerQuitRun(int32_t timer_id) { + return (x_err_t)KSwitch1(KS_USER_TIMER_QUITRUN, (uintptr_t)timer_id); +} + +/** + * This function will modify the timeout of a timer. + * + * @param timer_id the id number of timer. + * @param ticks timeout ticks + * + * @return EOK on success;EINVALED on failure + * + */ +x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks) { + return (x_err_t)KSwitch2(KS_USER_TIMER_MODIFY, (uintptr_t)timer_id, (uintptr_t)ticks); +} diff --git a/APP_Framework/lib/Kconfig b/APP_Framework/lib/Kconfig index 1e209d73b..c13ad7a4c 100755 --- a/APP_Framework/lib/Kconfig +++ b/APP_Framework/lib/Kconfig @@ -9,8 +9,9 @@ menu "app lib" config APP_SELECT_OTHER_LIB bool "app select other lib" endchoice - source "$APP_DIR/lib/cJSON/Kconfig" - source "$APP_DIR/lib/queue/Kconfig" - source "$APP_DIR/lib/lvgl/Kconfig" - source "$APP_DIR/lib/embedded_database/Kconfig" + source "$APP_DIR/lib/cJSON/Kconfig" + source "$APP_DIR/lib/queue/Kconfig" + source "$APP_DIR/lib/lvgl/Kconfig" + source "$APP_DIR/lib/embedded_database/Kconfig" + source "$APP_DIR/lib/lorawan/Kconfig" endmenu diff --git a/APP_Framework/lib/Makefile b/APP_Framework/lib/Makefile index 12f2ae7d5..327c69ef2 100644 --- a/APP_Framework/lib/Makefile +++ b/APP_Framework/lib/Makefile @@ -14,4 +14,8 @@ ifeq ($(CONFIG_LIB_USING_CJSON),y) SRC_DIR += cJSON endif +ifeq ($(CONFIG_LIB_USING_LORAWAN),y) + SRC_DIR += lorawan +endif + include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/lib/cJSON/Kconfig b/APP_Framework/lib/cJSON/Kconfig index 79a2d5892..4246e364e 100644 --- a/APP_Framework/lib/cJSON/Kconfig +++ b/APP_Framework/lib/cJSON/Kconfig @@ -1,3 +1,5 @@ -menuconfig LIB_USING_CJSON - bool "USING cJSON" - default n +menu "lib using cJSON" + menuconfig LIB_USING_CJSON + bool "USING cJSON" + default n +endmenu diff --git a/APP_Framework/lib/embedded_database/Kconfig b/APP_Framework/lib/embedded_database/Kconfig index 83f2c675e..c652d2599 100644 --- a/APP_Framework/lib/embedded_database/Kconfig +++ b/APP_Framework/lib/embedded_database/Kconfig @@ -1,6 +1,10 @@ -menuconfig USING_EMBEDDED_DATABASE - bool "embedded database" - default n -if USING_EMBEDDED_DATABASE - source "$APP_DIR/lib/embedded_database/flashdb/Kconfig" -endif +menu "lib using embedded_database" + + menuconfig USING_EMBEDDED_DATABASE + bool "embedded database" + default n + if USING_EMBEDDED_DATABASE + source "$APP_DIR/lib/embedded_database/flashdb/Kconfig" + endif + +endmenu diff --git a/APP_Framework/lib/lorawan/Kconfig b/APP_Framework/lib/lorawan/Kconfig new file mode 100644 index 000000000..ec6f54332 --- /dev/null +++ b/APP_Framework/lib/lorawan/Kconfig @@ -0,0 +1,30 @@ +menu "lib using LoRaWan" + +menuconfig LIB_USING_LORAWAN + bool "Using LoRaWan lib" + default n + + if LIB_USING_LORAWAN + menuconfig LIB_USING_LORAWAN_ED_STACK + help + Please add "source "$APP_DIR/lib/lorawan/lorawan_devicenode/Kconfig"" when using lorawan_devicenode + bool "LoRaWan using lorawan_ed_stack lib" + default n + select LIB_USING_LORA_RADIO + + if LIB_USING_LORAWAN_ED_STACK + + endif + + menuconfig LIB_USING_LORA_RADIO + help + Please add "source "$APP_DIR/lib/lorawan/lora_radio_driver/Kconfig"" when using lora_radio_driver + bool "LoRaWan using lora-radio-driver lib" + default n + + if LIB_USING_LORA_RADIO + + endif + endif + +endmenu diff --git a/APP_Framework/lib/lorawan/Makefile b/APP_Framework/lib/lorawan/Makefile new file mode 100644 index 000000000..dd6c0721f --- /dev/null +++ b/APP_Framework/lib/lorawan/Makefile @@ -0,0 +1,11 @@ +SRC_DIR := + +ifeq ($(CONFIG_LIB_USING_LORA_RADIO),y) + SRC_DIR += lora_radio_driver +endif + +ifeq ($(CONFIG_LIB_USING_LORAWAN_ED_STACK),y) + SRC_DIR += lorawan_devicenode +endif + +include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/lib/lorawan/README.md b/APP_Framework/lib/lorawan/README.md new file mode 100644 index 000000000..7fb6c76e2 --- /dev/null +++ b/APP_Framework/lib/lorawan/README.md @@ -0,0 +1,47 @@ +# lorawan子模块调试说明 + +矽璓工业物联操作系统XiUOS目前支持lorawan相关开源库,通过子模块形式管理,该目录主要内容是包含**lora_radio_driver**、**lorawan_devicenode**等。 + +## 目录内容 + +``` +xiuos/APP_Framework/lib/lorawan + ├── README.md + ├── lora_radio_driver lora_radio驱动库 + ├── lorawan_devicenode lorawan节点协议栈 + ├── Kconfig lorawan Kconfig配置 + └── Makefile lorawan Makefile +``` + +## 使用 + +使用前执行以下操作: + +``` +# 下载代码 +# 进入APP_Framework/lib/lorawan目录下载更新子模块 +git submodule init +git submodule update APP_Framework/lib/lorawan/lora_radio_driver +git submodule update APP_Framework/lib/lorawan/lorawan_devicenode + +# 进入 APP_Framework/lib/lorawan/Kconfig 配置,增加子模块source路径 +menuconfig LIB_USING_LORAWAN_ED_STACK + bool "LoRaWan using lorawan_ed_stack lib" + default n + select LIB_USING_LORA_RADIO + +if LIB_USING_LORAWAN_ED_STACK + source "$APP_DIR/lib/lorawan/lorawan_devicenode/Kconfig" +endif + +menuconfig LIB_USING_LORA_RADIO + bool "LoRaWan using lora-radio-driver lib" + default n + +if LIB_USING_LORA_RADIO + source "$APP_DIR/lib/lorawan/lora_radio_driver/Kconfig" +endif + +#编译对应OS即可 +``` + diff --git a/APP_Framework/lib/lorawan/lora_radio_driver b/APP_Framework/lib/lorawan/lora_radio_driver new file mode 160000 index 000000000..bc03d64f4 --- /dev/null +++ b/APP_Framework/lib/lorawan/lora_radio_driver @@ -0,0 +1 @@ +Subproject commit bc03d64f4b7408f85512735064dc5569431d6c8d diff --git a/APP_Framework/lib/lorawan/lorawan_devicenode b/APP_Framework/lib/lorawan/lorawan_devicenode new file mode 160000 index 000000000..2896d7234 --- /dev/null +++ b/APP_Framework/lib/lorawan/lorawan_devicenode @@ -0,0 +1 @@ +Subproject commit 2896d7234688de77992e7e1872a7e67a9456b420 diff --git a/APP_Framework/lib/lvgl/Kconfig b/APP_Framework/lib/lvgl/Kconfig index 856f00324..de80e1c88 100644 --- a/APP_Framework/lib/lvgl/Kconfig +++ b/APP_Framework/lib/lvgl/Kconfig @@ -1,866 +1,870 @@ # Kconfig file for LVGL v8.0 -menuconfig LIB_LV - bool "Enable LittleVGL " - default n +menu "lib using LVGL" - menu "LVGL configuration" - config LV_CONF_MINIMAL - bool "LVGL minimal configuration." - default n - endmenu + menuconfig LIB_LV + bool "Enable LittleVGL " + default n -if 0 - menu "LVGL configuration" - - # Define CONFIG_LV_CONF_SKIP so we can use LVGL - # without lv_conf.h file, the lv_conf_internal.h and - # lv_conf_kconfig.h files are used instead. - config LV_CONF_SKIP - bool - default n - - config LV_CONF_MINIMAL - bool "LVGL minimal configuration." - - menu "Color settings" - choice - prompt "Color depth." - default LV_COLOR_DEPTH_16 - help - Color depth to be used. - - config LV_COLOR_DEPTH_32 - bool "32: ARGB8888" - config LV_COLOR_DEPTH_16 - bool "16: RGB565" - config LV_COLOR_DEPTH_8 - bool "8: RGB232" - config LV_COLOR_DEPTH_1 - bool "1: 1 byte per pixel" - endchoice - - config LV_COLOR_DEPTH - int - default 1 if LV_COLOR_DEPTH_1 - default 8 if LV_COLOR_DEPTH_8 - default 16 if LV_COLOR_DEPTH_16 - default 32 if LV_COLOR_DEPTH_32 - - config LV_COLOR_16_SWAP - bool "Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)." - depends on LV_COLOR_DEPTH_16 - - config LV_COLOR_SCREEN_TRANSP - bool "Enable more complex drawing routines to manage screens transparency." - depends on LV_COLOR_DEPTH_32 - help - Can be used if the UI is above another layer, e.g. an OSD menu or video player. - Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to - non LV_OPA_COVER value - - config LV_COLOR_MIX_ROUND_OFS - int "Adjust color mix functions rounding" - default 128 if !LV_COLOR_DEPTH_32 - default 0 if LV_COLOR_DEPTH_32 - range 0 254 - help - 0: no adjustment, get the integer part of the result (round down) - 64: round up from x.75 - 128: round up from half - 192: round up from x.25 - 254: round up - - config LV_COLOR_CHROMA_KEY_HEX - hex "Images pixels with this color will not be drawn (if they are chroma keyed)." - range 0x000000 0xFFFFFF - default 0x00FF00 - help - See misc/lv_color.h for some color values examples. - endmenu - - menu "Memory settings" - config LV_MEM_CUSTOM - bool "If true use custom malloc/free, otherwise use the built-in `lv_mem_alloc()` and `lv_mem_free()`" - - config LV_MEM_SIZE_KILOBYTES - int "Size of the memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" - range 2 128 - default 32 - depends on !LV_MEM_CUSTOM - - config LV_MEM_ADDR - hex "Address for the memory pool instead of allocating it as a normal array" - default 0x0 - depends on !LV_MEM_CUSTOM - - config LV_MEM_CUSTOM_INCLUDE - string "Header to include for the custom memory function" - default "stdlib.h" - depends on LV_MEM_CUSTOM - - config LV_MEM_BUF_MAX_NUM - int "Number of the memory buffer" - default 16 - help - Number of the intermediate memory buffer used during rendering and other - internal processing mechanisms. You will see an error log message if - there wasn't enough buffers. - - config LV_MEMCPY_MEMSET_STD - bool "Use the standard memcpy and memset instead of LVGL's own functions" - endmenu - - menu "HAL Settings" - config LV_DISP_DEF_REFR_PERIOD - int "Default display refresh period (ms)." - default 30 - help - Can be changed in the display driver (`lv_disp_drv_t`). - - config LV_INDEV_DEF_READ_PERIOD - int "Input device read period [ms]." - default 30 - - config LV_TICK_CUSTOM - bool "Use a custom tick source" - - config LV_TICK_CUSTOM_INCLUDE - string "Header for the system time function" - default "Arduino.h" - depends on LV_TICK_CUSTOM - - config LV_DPI_DEF - int "Default Dots Per Inch (in px)." - default 130 - help - Used to initialize default sizes such as widgets sized, style paddings. - (Not so important, you can adjust it to modify default sizes and spaces) - endmenu - - menu "Feature configuration" - - menu "Drawing" - config LV_DRAW_COMPLEX - bool "Enable complex draw engine" - default y - help - Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, - image transformations or any masks. - - config LV_SHADOW_CACHE_SIZE - int "Allow buffering some shadow calculation" - depends on LV_DRAW_COMPLEX - default 0 - help - LV_SHADOW_CACHE_SIZE is the max shadow size to buffer, where - shadow size is `shadow_width + radius`. - Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost. - - config LV_CIRCLE_CACHE_SIZE - int "Set number of maximally cached circle data" - depends on LV_DRAW_COMPLEX - default 4 - help - The circumference of 1/4 circle are saved for anti-aliasing - radius * 4 bytes are used per circle (the most often used - radiuses are saved). - Set to 0 to disable caching. - - config LV_IMG_CACHE_DEF_SIZE - int "Default image cache size. 0 to disable caching." - default 0 - help - If only the built-in image formats are used there is no real advantage of caching. - (I.e. no new image decoder is added). - - With complex image decoders (e.g. PNG or JPG) caching can - save the continuous open/decode of images. - However the opened images might consume additional RAM. - - config LV_DISP_ROT_MAX_BUF - int "Maximum buffer size to allocate for rotation" - default 10240 - help - Only used if software rotation is enabled in the display driver. - endmenu - - menu "GPU" - config LV_USE_EXTERNAL_RENDERER - bool - - config LV_USE_GPU_STM32_DMA2D - bool "Enable STM32 DMA2D (aka Chrom Art) GPU." - config LV_GPU_DMA2D_CMSIS_INCLUDE - string "include path of CMSIS header of target processor" - depends on LV_USE_GPU_STM32_DMA2D - default "" - help - Must be defined to include path of CMSIS header of target processor - e.g. "stm32f769xx.h" or "stm32f429xx.h" - - config LV_USE_GPU_NXP_PXP - bool "Use NXP's PXP GPU iMX RTxxx platforms." - config LV_USE_GPU_NXP_PXP_AUTO_INIT - bool "Call lv_gpu_nxp_pxp_init() automatically or manually." - depends on LV_USE_GPU_NXP_PXP - help - 1: Add default bare metal and FreeRTOS interrupt handling - routines for PXP (lv_gpu_nxp_pxp_osa.c) and call - lv_gpu_nxp_pxp_init() automatically during lv_init(). - Note that symbol SDK_OS_FREE_RTOS has to be defined in order - to use FreeRTOS OSA, otherwise bare-metal implementation is - selected. - 0: lv_gpu_nxp_pxp_init() has to be called manually before - lv_init(). - - config LV_USE_GPU_NXP_VG_LITE - bool "Use NXP's VG-Lite GPU iMX RTxxx platforms." - - config LV_USE_GPU_SDL - bool "Use SDL renderer API" - select LV_USE_EXTERNAL_RENDERER + if LIB_LV + config LV_CONF_MINIMAL + bool "LVGL minimal configuration." default n - config LV_GPU_SDL_INCLUDE_PATH - string "include path of SDL header" - depends on LV_USE_GPU_SDL - default "SDL2/SDL.h" - endmenu + endif - menu "Logging" - config LV_USE_LOG - bool "Enable the log module" + if 0 + menu "LVGL configuration" + # Define CONFIG_LV_CONF_SKIP so we can use LVGL + # without lv_conf.h file, the lv_conf_internal.h and + # lv_conf_kconfig.h files are used instead. + config LV_CONF_SKIP + bool + default n + + config LV_CONF_MINIMAL + bool "LVGL minimal configuration." + + menu "Color settings" choice - bool "Default log verbosity" if LV_USE_LOG - default LV_LOG_LEVEL_WARN + prompt "Color depth." + default LV_COLOR_DEPTH_16 help - Specify how important log should be added. + Color depth to be used. - config LV_LOG_LEVEL_TRACE - bool "A lot of logs to give detailed information" - config LV_LOG_LEVEL_INFO - bool "Log important events" - config LV_LOG_LEVEL_WARN - bool "Log if something unwanted happened but didn't cause a problem" - config LV_LOG_LEVEL_ERROR - bool "Only critical issues, when the system may fail" - config LV_LOG_LEVEL_USER - bool "Only logs added by the user" - config LV_LOG_LEVEL_NONE - bool "Do not log anything" + config LV_COLOR_DEPTH_32 + bool "32: ARGB8888" + config LV_COLOR_DEPTH_16 + bool "16: RGB565" + config LV_COLOR_DEPTH_8 + bool "8: RGB232" + config LV_COLOR_DEPTH_1 + bool "1: 1 byte per pixel" endchoice - config LV_LOG_LEVEL + config LV_COLOR_DEPTH int - default 0 if LV_LOG_LEVEL_TRACE - default 1 if LV_LOG_LEVEL_INFO - default 2 if LV_LOG_LEVEL_WARN - default 3 if LV_LOG_LEVEL_ERROR - default 4 if LV_LOG_LEVEL_USER - default 5 if LV_LOG_LEVEL_NONE + default 1 if LV_COLOR_DEPTH_1 + default 8 if LV_COLOR_DEPTH_8 + default 16 if LV_COLOR_DEPTH_16 + default 32 if LV_COLOR_DEPTH_32 - config LV_LOG_PRINTF - bool "Print the log with 'printf'" if LV_USE_LOG + config LV_COLOR_16_SWAP + bool "Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)." + depends on LV_COLOR_DEPTH_16 + + config LV_COLOR_SCREEN_TRANSP + bool "Enable more complex drawing routines to manage screens transparency." + depends on LV_COLOR_DEPTH_32 help - Use printf for log output. - If not set the user needs to register a callback with `lv_log_register_print_cb`. + Can be used if the UI is above another layer, e.g. an OSD menu or video player. + Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to + non LV_OPA_COVER value - config LV_LOG_TRACE_MEM - bool "Enable/Disable LV_LOG_TRACE in mem module" - default y - depends on LV_USE_LOG + config LV_COLOR_MIX_ROUND_OFS + int "Adjust color mix functions rounding" + default 128 if !LV_COLOR_DEPTH_32 + default 0 if LV_COLOR_DEPTH_32 + range 0 254 + help + 0: no adjustment, get the integer part of the result (round down) + 64: round up from x.75 + 128: round up from half + 192: round up from x.25 + 254: round up - config LV_LOG_TRACE_TIMER - bool "Enable/Disable LV_LOG_TRACE in timer module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_INDEV - bool "Enable/Disable LV_LOG_TRACE in indev module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_DISP_REFR - bool "Enable/Disable LV_LOG_TRACE in disp refr module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_EVENT - bool "Enable/Disable LV_LOG_TRACE in event module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_OBJ_CREATE - bool "Enable/Disable LV_LOG_TRACE in obj create module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_LAYOUT - bool "Enable/Disable LV_LOG_TRACE in layout module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_ANIM - bool "Enable/Disable LV_LOG_TRACE in anim module" - default y - depends on LV_USE_LOG + config LV_COLOR_CHROMA_KEY_HEX + hex "Images pixels with this color will not be drawn (if they are chroma keyed)." + range 0x000000 0xFFFFFF + default 0x00FF00 + help + See misc/lv_color.h for some color values examples. endmenu - menu "Asserts" - config LV_USE_ASSERT_NULL - bool "Check if the parameter is NULL. (Very fast, recommended)" + menu "Memory settings" + config LV_MEM_CUSTOM + bool "If true use custom malloc/free, otherwise use the built-in `lv_mem_alloc()` and `lv_mem_free()`" + + config LV_MEM_SIZE_KILOBYTES + int "Size of the memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" + range 2 128 + default 32 + depends on !LV_MEM_CUSTOM + + config LV_MEM_ADDR + hex "Address for the memory pool instead of allocating it as a normal array" + default 0x0 + depends on !LV_MEM_CUSTOM + + config LV_MEM_CUSTOM_INCLUDE + string "Header to include for the custom memory function" + default "stdlib.h" + depends on LV_MEM_CUSTOM + + config LV_MEM_BUF_MAX_NUM + int "Number of the memory buffer" + default 16 + help + Number of the intermediate memory buffer used during rendering and other + internal processing mechanisms. You will see an error log message if + there wasn't enough buffers. + + config LV_MEMCPY_MEMSET_STD + bool "Use the standard memcpy and memset instead of LVGL's own functions" + endmenu + + menu "HAL Settings" + config LV_DISP_DEF_REFR_PERIOD + int "Default display refresh period (ms)." + default 30 + help + Can be changed in the display driver (`lv_disp_drv_t`). + + config LV_INDEV_DEF_READ_PERIOD + int "Input device read period [ms]." + default 30 + + config LV_TICK_CUSTOM + bool "Use a custom tick source" + + config LV_TICK_CUSTOM_INCLUDE + string "Header for the system time function" + default "Arduino.h" + depends on LV_TICK_CUSTOM + + config LV_DPI_DEF + int "Default Dots Per Inch (in px)." + default 130 + help + Used to initialize default sizes such as widgets sized, style paddings. + (Not so important, you can adjust it to modify default sizes and spaces) + endmenu + + menu "Feature configuration" + + menu "Drawing" + config LV_DRAW_COMPLEX + bool "Enable complex draw engine" + default y + help + Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, + image transformations or any masks. + + config LV_SHADOW_CACHE_SIZE + int "Allow buffering some shadow calculation" + depends on LV_DRAW_COMPLEX + default 0 + help + LV_SHADOW_CACHE_SIZE is the max shadow size to buffer, where + shadow size is `shadow_width + radius`. + Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost. + + config LV_CIRCLE_CACHE_SIZE + int "Set number of maximally cached circle data" + depends on LV_DRAW_COMPLEX + default 4 + help + The circumference of 1/4 circle are saved for anti-aliasing + radius * 4 bytes are used per circle (the most often used + radiuses are saved). + Set to 0 to disable caching. + + config LV_IMG_CACHE_DEF_SIZE + int "Default image cache size. 0 to disable caching." + default 0 + help + If only the built-in image formats are used there is no real advantage of caching. + (I.e. no new image decoder is added). + + With complex image decoders (e.g. PNG or JPG) caching can + save the continuous open/decode of images. + However the opened images might consume additional RAM. + + config LV_DISP_ROT_MAX_BUF + int "Maximum buffer size to allocate for rotation" + default 10240 + help + Only used if software rotation is enabled in the display driver. + endmenu + + menu "GPU" + config LV_USE_EXTERNAL_RENDERER + bool + + config LV_USE_GPU_STM32_DMA2D + bool "Enable STM32 DMA2D (aka Chrom Art) GPU." + config LV_GPU_DMA2D_CMSIS_INCLUDE + string "include path of CMSIS header of target processor" + depends on LV_USE_GPU_STM32_DMA2D + default "" + help + Must be defined to include path of CMSIS header of target processor + e.g. "stm32f769xx.h" or "stm32f429xx.h" + + config LV_USE_GPU_NXP_PXP + bool "Use NXP's PXP GPU iMX RTxxx platforms." + config LV_USE_GPU_NXP_PXP_AUTO_INIT + bool "Call lv_gpu_nxp_pxp_init() automatically or manually." + depends on LV_USE_GPU_NXP_PXP + help + 1: Add default bare metal and FreeRTOS interrupt handling + routines for PXP (lv_gpu_nxp_pxp_osa.c) and call + lv_gpu_nxp_pxp_init() automatically during lv_init(). + Note that symbol SDK_OS_FREE_RTOS has to be defined in order + to use FreeRTOS OSA, otherwise bare-metal implementation is + selected. + 0: lv_gpu_nxp_pxp_init() has to be called manually before + lv_init(). + + config LV_USE_GPU_NXP_VG_LITE + bool "Use NXP's VG-Lite GPU iMX RTxxx platforms." + + config LV_USE_GPU_SDL + bool "Use SDL renderer API" + select LV_USE_EXTERNAL_RENDERER + default n + config LV_GPU_SDL_INCLUDE_PATH + string "include path of SDL header" + depends on LV_USE_GPU_SDL + default "SDL2/SDL.h" + endmenu + + menu "Logging" + config LV_USE_LOG + bool "Enable the log module" + + choice + bool "Default log verbosity" if LV_USE_LOG + default LV_LOG_LEVEL_WARN + help + Specify how important log should be added. + + config LV_LOG_LEVEL_TRACE + bool "A lot of logs to give detailed information" + config LV_LOG_LEVEL_INFO + bool "Log important events" + config LV_LOG_LEVEL_WARN + bool "Log if something unwanted happened but didn't cause a problem" + config LV_LOG_LEVEL_ERROR + bool "Only critical issues, when the system may fail" + config LV_LOG_LEVEL_USER + bool "Only logs added by the user" + config LV_LOG_LEVEL_NONE + bool "Do not log anything" + endchoice + + config LV_LOG_LEVEL + int + default 0 if LV_LOG_LEVEL_TRACE + default 1 if LV_LOG_LEVEL_INFO + default 2 if LV_LOG_LEVEL_WARN + default 3 if LV_LOG_LEVEL_ERROR + default 4 if LV_LOG_LEVEL_USER + default 5 if LV_LOG_LEVEL_NONE + + config LV_LOG_PRINTF + bool "Print the log with 'printf'" if LV_USE_LOG + help + Use printf for log output. + If not set the user needs to register a callback with `lv_log_register_print_cb`. + + config LV_LOG_TRACE_MEM + bool "Enable/Disable LV_LOG_TRACE in mem module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_TIMER + bool "Enable/Disable LV_LOG_TRACE in timer module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_INDEV + bool "Enable/Disable LV_LOG_TRACE in indev module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_DISP_REFR + bool "Enable/Disable LV_LOG_TRACE in disp refr module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_EVENT + bool "Enable/Disable LV_LOG_TRACE in event module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_OBJ_CREATE + bool "Enable/Disable LV_LOG_TRACE in obj create module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_LAYOUT + bool "Enable/Disable LV_LOG_TRACE in layout module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_ANIM + bool "Enable/Disable LV_LOG_TRACE in anim module" + default y + depends on LV_USE_LOG + endmenu + + menu "Asserts" + config LV_USE_ASSERT_NULL + bool "Check if the parameter is NULL. (Very fast, recommended)" + default y if !LV_CONF_MINIMAL + + config LV_USE_ASSERT_MALLOC + bool "Checks if the memory is successfully allocated or no. (Very fast, recommended)" + default y if !LV_CONF_MINIMAL + + config LV_USE_ASSERT_STYLE + bool "Check if the styles are properly initialized. (Very fast, recommended)" + + config LV_USE_ASSERT_MEM_INTEGRITY + bool "Check the integrity of `lv_mem` after critical operations. (Slow)" + + config LV_USE_ASSERT_OBJ + bool "Check NULL, the object's type and existence (e.g. not deleted). (Slow)." + + config LV_ASSERT_HANDLER_INCLUDE + string "Header to include for the custom assert function" + default "assert.h" + endmenu + + menu "Others" + config LV_USE_PERF_MONITOR + bool "Show CPU usage and FPS count in the right bottom corner." + + config LV_USE_MEM_MONITOR + bool "Show the used memory and the memory fragmentation in the left bottom corner." + depends on !LV_MEM_CUSTOM + + config LV_USE_REFR_DEBUG + bool "Draw random colored rectangles over the redrawn areas." + + config LV_SPRINTF_CUSTOM + bool "Change the built-in (v)snprintf functions" + + config LV_SPRINTF_INCLUDE + string "Header to include for the custom sprintf function" + depends on LV_SPRINTF_CUSTOM + default "stdio.h" + + config LV_SPRINTF_USE_FLOAT + bool "Enable float in built-in (v)snprintf functions" + depends on !LV_SPRINTF_CUSTOM + + config LV_USE_USER_DATA + bool "Add a 'user_data' to drivers and objects." + default y + + config LV_ENABLE_GC + bool "Enable garbage collector" + + config LV_GC_INCLUDE + string "Header to include for the garbage collector related things" + depends on LV_ENABLE_GC + default "gc.h" + endmenu + + menu "Compiler settings" + config LV_BIG_ENDIAN_SYSTEM + bool "For big endian systems set to 1" + + config LV_ATTRIBUTE_MEM_ALIGN_SIZE + int "Required alignment size for buffers" + default 1 + + config LV_ATTRIBUTE_FAST_MEM_USE_IRAM + bool "Set IRAM as LV_ATTRIBUTE_FAST_MEM" + help + Set this option to configure IRAM as LV_ATTRIBUTE_FAST_MEM + + config LV_USE_LARGE_COORD + bool "Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t" + endmenu + endmenu + + menu "Font usage" + menu "Enable built-in fonts" + config LV_FONT_MONTSERRAT_8 + bool "Enable Montserrat 8" + config LV_FONT_MONTSERRAT_10 + bool "Enable Montserrat 10" + config LV_FONT_MONTSERRAT_12 + bool "Enable Montserrat 12" + config LV_FONT_MONTSERRAT_14 + bool "Enable Montserrat 14" + default y if !LV_CONF_MINIMAL + config LV_FONT_MONTSERRAT_16 + bool "Enable Montserrat 16" + config LV_FONT_MONTSERRAT_18 + bool "Enable Montserrat 18" + config LV_FONT_MONTSERRAT_20 + bool "Enable Montserrat 20" + config LV_FONT_MONTSERRAT_22 + bool "Enable Montserrat 22" + config LV_FONT_MONTSERRAT_24 + bool "Enable Montserrat 24" + config LV_FONT_MONTSERRAT_26 + bool "Enable Montserrat 26" + config LV_FONT_MONTSERRAT_28 + bool "Enable Montserrat 28" + config LV_FONT_MONTSERRAT_30 + bool "Enable Montserrat 30" + config LV_FONT_MONTSERRAT_32 + bool "Enable Montserrat 32" + config LV_FONT_MONTSERRAT_34 + bool "Enable Montserrat 34" + config LV_FONT_MONTSERRAT_36 + bool "Enable Montserrat 36" + config LV_FONT_MONTSERRAT_38 + bool "Enable Montserrat 38" + config LV_FONT_MONTSERRAT_40 + bool "Enable Montserrat 40" + config LV_FONT_MONTSERRAT_42 + bool "Enable Montserrat 42" + config LV_FONT_MONTSERRAT_44 + bool "Enable Montserrat 44" + config LV_FONT_MONTSERRAT_46 + bool "Enable Montserrat 46" + config LV_FONT_MONTSERRAT_48 + bool "Enable Montserrat 48" + + config LV_FONT_MONTSERRAT_12_SUBPX + bool "Enable Montserrat 12 sub-pixel" + config LV_FONT_MONTSERRAT_28_COMPRESSED + bool "Enable Montserrat 28 compressed" + config LV_FONT_DEJAVU_16_PERSIAN_HEBREW + bool "Enable Dejavu 16 Persian, Hebrew, Arabic letters" + config LV_FONT_SIMSUN_16_CJK + bool "Enable Simsun 16 CJK" + + config LV_FONT_UNSCII_8 + bool "Enable UNSCII 8 (Perfect monospace font)" + default y if LV_CONF_MINIMAL + config LV_FONT_UNSCII_16 + bool "Enable UNSCII 16 (Perfect monospace font)" + + config LV_FONT_CUSTOM + bool "Enable the custom font" + config LV_FONT_CUSTOM_DECLARE + string "Header to include for the custom font" + depends on LV_FONT_CUSTOM + endmenu + + choice LV_FONT_DEFAULT + prompt "Select theme default title font" + default LV_FONT_DEFAULT_MONTSERRAT_14 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_UNSCII_8 if LV_CONF_MINIMAL + help + Select theme default title font + + config LV_FONT_DEFAULT_MONTSERRAT_8 + bool "Montserrat 8" + select LV_FONT_MONTSERRAT_8 + config LV_FONT_DEFAULT_MONTSERRAT_12 + bool "Montserrat 12" + select LV_FONT_MONTSERRAT_12 + config LV_FONT_DEFAULT_MONTSERRAT_14 + bool "Montserrat 14" + select LV_FONT_MONTSERRAT_14 + config LV_FONT_DEFAULT_MONTSERRAT_16 + bool "Montserrat 16" + select LV_FONT_MONTSERRAT_16 + config LV_FONT_DEFAULT_MONTSERRAT_18 + bool "Montserrat 18" + select LV_FONT_MONTSERRAT_18 + config LV_FONT_DEFAULT_MONTSERRAT_20 + bool "Montserrat 20" + select LV_FONT_MONTSERRAT_20 + config LV_FONT_DEFAULT_MONTSERRAT_22 + bool "Montserrat 22" + select LV_FONT_MONTSERRAT_22 + config LV_FONT_DEFAULT_MONTSERRAT_24 + bool "Montserrat 24" + select LV_FONT_MONTSERRAT_24 + config LV_FONT_DEFAULT_MONTSERRAT_26 + bool "Montserrat 26" + select LV_FONT_MONTSERRAT_26 + config LV_FONT_DEFAULT_MONTSERRAT_28 + bool "Montserrat 28" + select LV_FONT_MONTSERRAT_28 + config LV_FONT_DEFAULT_MONTSERRAT_30 + bool "Montserrat 30" + select LV_FONT_MONTSERRAT_30 + config LV_FONT_DEFAULT_MONTSERRAT_32 + bool "Montserrat 32" + select LV_FONT_MONTSERRAT_32 + config LV_FONT_DEFAULT_MONTSERRAT_34 + bool "Montserrat 34" + select LV_FONT_MONTSERRAT_34 + config LV_FONT_DEFAULT_MONTSERRAT_36 + bool "Montserrat 36" + select LV_FONT_MONTSERRAT_36 + config LV_FONT_DEFAULT_MONTSERRAT_38 + bool "Montserrat 38" + select LV_FONT_MONTSERRAT_38 + config LV_FONT_DEFAULT_MONTSERRAT_40 + bool "Montserrat 40" + select LV_FONT_MONTSERRAT_40 + config LV_FONT_DEFAULT_MONTSERRAT_42 + bool "Montserrat 42" + select LV_FONT_MONTSERRAT_42 + config LV_FONT_DEFAULT_MONTSERRAT_44 + bool "Montserrat 44" + select LV_FONT_MONTSERRAT_44 + config LV_FONT_DEFAULT_MONTSERRAT_46 + bool "Montserrat 46" + select LV_FONT_MONTSERRAT_46 + config LV_FONT_DEFAULT_MONTSERRAT_48 + bool "Montserrat 48" + select LV_FONT_MONTSERRAT_48 + config LV_FONT_DEFAULT_MONTSERRAT_12_SUBPX + bool "Montserrat 12 sub-pixel" + select LV_FONT_MONTSERRAT_12_SUBPX + config LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED + bool "Montserrat 28 compressed" + select LV_FONT_MONTSERRAT_28_COMPRESSED + config LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW + bool "Dejavu 16 Persian, Hebrew, Arabic letters" + select LV_FONT_DEJAVU_16_PERSIAN_HEBREW + config LV_FONT_DEFAULT_SIMSUN_16_CJK + bool "Simsun 16 CJK" + select LV_FONT_SIMSUN_16_CJK + config LV_FONT_DEFAULT_UNSCII_8 + bool "UNSCII 8 (Perfect monospace font)" + select LV_FONT_UNSCII_8 + config LV_FONT_DEFAULT_UNSCII_16 + bool "UNSCII 16 (Perfect monospace font)" + select LV_FONT_UNSCII_16 + endchoice + + config LV_FONT_FMT_TXT_LARGE + bool "Enable it if you have fonts with a lot of characters." + help + The limit depends on the font size, font face and bpp + but with > 10,000 characters if you see issues probably you + need to enable it. + + config LV_USE_FONT_COMPRESSED + bool "Sets support for compressed fonts." + + config LV_USE_FONT_SUBPX + bool "Enable subpixel rendering." + + config LV_FONT_SUBPX_BGR + bool "Use BGR instead RGB for sub-pixel rendering." + depends on LV_USE_FONT_SUBPX + help + Set the pixel order of the display. + Important only if "subpx fonts" are used. + With "normal" font it doesn't matter. + endmenu + + menu "Text Settings" + choice LV_TXT_ENC + prompt "Select a character encoding for strings" + help + Select a character encoding for strings. Your IDE or editor should have the same character encoding. + default LV_TXT_ENC_UTF8 if !LV_CONF_MINIMAL + default LV_TXT_ENC_ASCII if LV_CONF_MINIMAL + + config LV_TXT_ENC_UTF8 + bool "UTF8" + config LV_TXT_ENC_ASCII + bool "ASCII" + endchoice + + config LV_TXT_BREAK_CHARS + string "Can break (wrap) texts on these chars" + default " ,.;:-_" + + config LV_TXT_LINE_BREAK_LONG_LEN + int "Line break long length" + default 0 + help + If a word is at least this long, will break wherever 'prettiest'. + To disable, set to a value <= 0. + + config LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN + int "Min num chars before break" + default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 + help + Minimum number of characters in a long word to put on a line before a break. + + config LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN + int "Min num chars after break" + default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 + help + Minimum number of characters in a long word to put on a line after a break. + + config LV_TXT_COLOR_CMD + string "The control character to use for signalling text recoloring" + default "#" + + config LV_USE_BIDI + bool "Support bidirectional texts" + help + Allows mixing Left-to-Right and Right-to-Left texts. + The direction will be processed according to the Unicode Bidirectional Algorithm: + https://www.w3.org/International/articles/inline-bidi-markup/uba-basics + + choice + prompt "Set the default BIDI direction" + default LV_BIDI_DIR_AUTO + depends on LV_USE_BIDI + + config LV_BIDI_DIR_LTR + bool "Left-to-Right" + config LV_BIDI_DIR_RTL + bool "Right-to-Left" + config LV_BIDI_DIR_AUTO + bool "Detect texts base direction" + endchoice + + config LV_USE_ARABIC_PERSIAN_CHARS + bool "Enable Arabic/Persian processing" + help + In these languages characters should be replaced with + an other form based on their position in the text. + endmenu + + menu "Widget usage" + config LV_USE_ARC + bool "Arc." default y if !LV_CONF_MINIMAL - - config LV_USE_ASSERT_MALLOC - bool "Checks if the memory is successfully allocated or no. (Very fast, recommended)" + config LV_USE_BAR + bool "Bar." default y if !LV_CONF_MINIMAL + config LV_USE_BTN + bool "Button." + default y if !LV_CONF_MINIMAL + config LV_USE_BTNMATRIX + bool "Button matrix." + default y if !LV_CONF_MINIMAL + config LV_USE_CANVAS + bool "Canvas. Dependencies: lv_img." + default y if !LV_CONF_MINIMAL + config LV_USE_CHECKBOX + bool "Check Box" + default y if !LV_CONF_MINIMAL + config LV_USE_DROPDOWN + bool "Drop down list. Requires: lv_label." + select LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_USE_IMG + bool "Image. Requires: lv_label." + select LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_USE_LABEL + bool "Label." + default y if !LV_CONF_MINIMAL + config LV_LABEL_TEXT_SELECTION + bool "Enable selecting text of the label." + depends on LV_USE_LABEL + default y + config LV_LABEL_LONG_TXT_HINT + bool "Store extra some info in labels (12 bytes) to speed up drawing of very long texts." + depends on LV_USE_LABEL + default y + config LV_USE_LINE + bool "Line." + default y if !LV_CONF_MINIMAL + config LV_USE_ROLLER + bool "Roller. Requires: lv_label." + select LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_ROLLER_INF_PAGES + int "Number of extra 'pages' when the controller is infinite." + default 7 + depends on LV_USE_ROLLER + config LV_USE_SLIDER + bool "Slider. Requires: lv_bar." + select LV_USE_BAR + default y if !LV_CONF_MINIMAL + config LV_USE_SWITCH + bool "Switch." + default y if !LV_CONF_MINIMAL + config LV_USE_TEXTAREA + bool "Text area. Requires: lv_label." + select LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_TEXTAREA_DEF_PWD_SHOW_TIME + int "Text area def. pwd show time [ms]." + default 1500 + depends on LV_USE_TEXTAREA + config LV_USE_TABLE + bool "Table." + default y if !LV_CONF_MINIMAL + endmenu - config LV_USE_ASSERT_STYLE - bool "Check if the styles are properly initialized. (Very fast, recommended)" + menu "Extra Widgets" + config LV_USE_ANIMIMG + bool "Anim image." + default y if !LV_CONF_MINIMAL + config LV_USE_CALENDAR + bool "Calendar." + default y if !LV_CONF_MINIMAL + config LV_CALENDAR_WEEK_STARTS_MONDAY + bool "Calendar week starts monday." + depends on LV_USE_CALENDAR + config LV_USE_CALENDAR_HEADER_ARROW + bool "Use calendar header arrow" + depends on LV_USE_CALENDAR + default y + config LV_USE_CALENDAR_HEADER_DROPDOWN + bool "Use calendar header dropdown" + depends on LV_USE_CALENDAR + default y + config LV_USE_CHART + bool "Chart." + default y if !LV_CONF_MINIMAL + config LV_USE_COLORWHEEL + bool "Colorwheel." + default y if !LV_CONF_MINIMAL + config LV_USE_IMGBTN + bool "Imgbtn." + default y if !LV_CONF_MINIMAL + config LV_USE_KEYBOARD + bool "Keyboard." + default y if !LV_CONF_MINIMAL + config LV_USE_LED + bool "LED." + default y if !LV_CONF_MINIMAL + config LV_USE_LIST + bool "List." + default y if !LV_CONF_MINIMAL + config LV_USE_METER + bool "Meter." + default y if !LV_CONF_MINIMAL + config LV_USE_MSGBOX + bool "Msgbox." + default y if !LV_CONF_MINIMAL + config LV_USE_SPINBOX + bool "Spinbox." + default y if !LV_CONF_MINIMAL + config LV_USE_SPINNER + bool "Spinner." + default y if !LV_CONF_MINIMAL + config LV_USE_TABVIEW + bool "Tabview." + default y if !LV_CONF_MINIMAL + config LV_USE_TILEVIEW + bool "Tileview" + default y if !LV_CONF_MINIMAL + config LV_USE_WIN + bool "Win" + default y if !LV_CONF_MINIMAL + config LV_USE_SPAN + bool "span" + default y if !LV_CONF_MINIMAL + config LV_SPAN_SNIPPET_STACK_SIZE + int "Maximum number of span descriptor" + default 64 + depends on LV_USE_SPAN + endmenu - config LV_USE_ASSERT_MEM_INTEGRITY - bool "Check the integrity of `lv_mem` after critical operations. (Slow)" + menu "Themes" + config LV_USE_THEME_DEFAULT + bool "A simple, impressive and very complete theme" + default y if !LV_CONF_MINIMAL + config LV_THEME_DEFAULT_DARK + bool "Yes to set dark mode, No to set light mode" + depends on LV_USE_THEME_DEFAULT + config LV_THEME_DEFAULT_GROW + bool "Enable grow on press" + default y + depends on LV_USE_THEME_DEFAULT + config LV_THEME_DEFAULT_TRANSITION_TIME + int "Default transition time in [ms]" + default 80 + depends on LV_USE_THEME_DEFAULT + config LV_USE_THEME_BASIC + bool "A very simple theme that is a good starting point for a custom theme" + default y if !LV_CONF_MINIMAL + endmenu - config LV_USE_ASSERT_OBJ - bool "Check NULL, the object's type and existence (e.g. not deleted). (Slow)." + menu "Layouts" + config LV_USE_FLEX + bool "A layout similar to Flexbox in CSS." + default y if !LV_CONF_MINIMAL + config LV_USE_GRID + bool "A layout similar to Grid in CSS." + default y if !LV_CONF_MINIMAL + endmenu - config LV_ASSERT_HANDLER_INCLUDE - string "Header to include for the custom assert function" - default "assert.h" + menu "3rd Party Libraries" + config LV_USE_FS_STDIO + int "File system on top of stdio API" + default 0 + config LV_FS_STDIO_PATH + string "Set the working directory" + depends on LV_USE_FS_STDIO + + config LV_USE_FS_POSIX + int "File system on top of posix API" + default 0 + config LV_FS_POSIX_PATH + string "Set the working directory" + depends on LV_USE_FS_POSIX + + config LV_USE_FS_WIN32 + int "File system on top of Win32 API" + default 0 + config LV_FS_WIN32_PATH + string "Set the working directory" + depends on LV_USE_FS_WIN32 + + config LV_USE_FS_FATFS + int "File system on top of FatFS" + default 0 + + config LV_USE_PNG + bool "PNG decoder library" + + config LV_USE_BMP + bool "BMP decoder library" + + config LV_USE_SJPG + bool "JPG + split JPG decoder library" + + config LV_USE_GIF + bool "GIF decoder library" + + config LV_USE_QRCODE + bool "QR code library" + + config LV_USE_FREETYPE + bool "FreeType library" + config LV_FREETYPE_CACHE_SIZE + int "Memory used by FreeType to cache characters [bytes] (-1: no caching)" + depends on LV_USE_FREETYPE + default 16384 + + config LV_USE_RLOTTIE + bool "Lottie library" endmenu menu "Others" - config LV_USE_PERF_MONITOR - bool "Show CPU usage and FPS count in the right bottom corner." - - config LV_USE_MEM_MONITOR - bool "Show the used memory and the memory fragmentation in the left bottom corner." - depends on !LV_MEM_CUSTOM - - config LV_USE_REFR_DEBUG - bool "Draw random colored rectangles over the redrawn areas." - - config LV_SPRINTF_CUSTOM - bool "Change the built-in (v)snprintf functions" - - config LV_SPRINTF_INCLUDE - string "Header to include for the custom sprintf function" - depends on LV_SPRINTF_CUSTOM - default "stdio.h" - - config LV_SPRINTF_USE_FLOAT - bool "Enable float in built-in (v)snprintf functions" - depends on !LV_SPRINTF_CUSTOM - - config LV_USE_USER_DATA - bool "Add a 'user_data' to drivers and objects." - default y - - config LV_ENABLE_GC - bool "Enable garbage collector" - - config LV_GC_INCLUDE - string "Header to include for the garbage collector related things" - depends on LV_ENABLE_GC - default "gc.h" - endmenu - - menu "Compiler settings" - config LV_BIG_ENDIAN_SYSTEM - bool "For big endian systems set to 1" - - config LV_ATTRIBUTE_MEM_ALIGN_SIZE - int "Required alignment size for buffers" - default 1 - - config LV_ATTRIBUTE_FAST_MEM_USE_IRAM - bool "Set IRAM as LV_ATTRIBUTE_FAST_MEM" - help - Set this option to configure IRAM as LV_ATTRIBUTE_FAST_MEM - - config LV_USE_LARGE_COORD - bool "Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t" - endmenu - endmenu - - menu "Font usage" - menu "Enable built-in fonts" - config LV_FONT_MONTSERRAT_8 - bool "Enable Montserrat 8" - config LV_FONT_MONTSERRAT_10 - bool "Enable Montserrat 10" - config LV_FONT_MONTSERRAT_12 - bool "Enable Montserrat 12" - config LV_FONT_MONTSERRAT_14 - bool "Enable Montserrat 14" + config LV_USE_SNAPSHOT + bool "Enable API to take snapshot" default y if !LV_CONF_MINIMAL - config LV_FONT_MONTSERRAT_16 - bool "Enable Montserrat 16" - config LV_FONT_MONTSERRAT_18 - bool "Enable Montserrat 18" - config LV_FONT_MONTSERRAT_20 - bool "Enable Montserrat 20" - config LV_FONT_MONTSERRAT_22 - bool "Enable Montserrat 22" - config LV_FONT_MONTSERRAT_24 - bool "Enable Montserrat 24" - config LV_FONT_MONTSERRAT_26 - bool "Enable Montserrat 26" - config LV_FONT_MONTSERRAT_28 - bool "Enable Montserrat 28" - config LV_FONT_MONTSERRAT_30 - bool "Enable Montserrat 30" - config LV_FONT_MONTSERRAT_32 - bool "Enable Montserrat 32" - config LV_FONT_MONTSERRAT_34 - bool "Enable Montserrat 34" - config LV_FONT_MONTSERRAT_36 - bool "Enable Montserrat 36" - config LV_FONT_MONTSERRAT_38 - bool "Enable Montserrat 38" - config LV_FONT_MONTSERRAT_40 - bool "Enable Montserrat 40" - config LV_FONT_MONTSERRAT_42 - bool "Enable Montserrat 42" - config LV_FONT_MONTSERRAT_44 - bool "Enable Montserrat 44" - config LV_FONT_MONTSERRAT_46 - bool "Enable Montserrat 46" - config LV_FONT_MONTSERRAT_48 - bool "Enable Montserrat 48" - - config LV_FONT_MONTSERRAT_12_SUBPX - bool "Enable Montserrat 12 sub-pixel" - config LV_FONT_MONTSERRAT_28_COMPRESSED - bool "Enable Montserrat 28 compressed" - config LV_FONT_DEJAVU_16_PERSIAN_HEBREW - bool "Enable Dejavu 16 Persian, Hebrew, Arabic letters" - config LV_FONT_SIMSUN_16_CJK - bool "Enable Simsun 16 CJK" - - config LV_FONT_UNSCII_8 - bool "Enable UNSCII 8 (Perfect monospace font)" - default y if LV_CONF_MINIMAL - config LV_FONT_UNSCII_16 - bool "Enable UNSCII 16 (Perfect monospace font)" - - config LV_FONT_CUSTOM - bool "Enable the custom font" - config LV_FONT_CUSTOM_DECLARE - string "Header to include for the custom font" - depends on LV_FONT_CUSTOM endmenu - choice LV_FONT_DEFAULT - prompt "Select theme default title font" - default LV_FONT_DEFAULT_MONTSERRAT_14 if !LV_CONF_MINIMAL - default LV_FONT_DEFAULT_UNSCII_8 if LV_CONF_MINIMAL - help - Select theme default title font + menu "Examples" + config LV_BUILD_EXAMPLES + bool "Enable the examples to be built" + default y if !LV_CONF_MINIMAL + endmenu - config LV_FONT_DEFAULT_MONTSERRAT_8 - bool "Montserrat 8" - select LV_FONT_MONTSERRAT_8 - config LV_FONT_DEFAULT_MONTSERRAT_12 - bool "Montserrat 12" - select LV_FONT_MONTSERRAT_12 - config LV_FONT_DEFAULT_MONTSERRAT_14 - bool "Montserrat 14" - select LV_FONT_MONTSERRAT_14 - config LV_FONT_DEFAULT_MONTSERRAT_16 - bool "Montserrat 16" - select LV_FONT_MONTSERRAT_16 - config LV_FONT_DEFAULT_MONTSERRAT_18 - bool "Montserrat 18" - select LV_FONT_MONTSERRAT_18 - config LV_FONT_DEFAULT_MONTSERRAT_20 - bool "Montserrat 20" - select LV_FONT_MONTSERRAT_20 - config LV_FONT_DEFAULT_MONTSERRAT_22 - bool "Montserrat 22" - select LV_FONT_MONTSERRAT_22 - config LV_FONT_DEFAULT_MONTSERRAT_24 - bool "Montserrat 24" - select LV_FONT_MONTSERRAT_24 - config LV_FONT_DEFAULT_MONTSERRAT_26 - bool "Montserrat 26" - select LV_FONT_MONTSERRAT_26 - config LV_FONT_DEFAULT_MONTSERRAT_28 - bool "Montserrat 28" - select LV_FONT_MONTSERRAT_28 - config LV_FONT_DEFAULT_MONTSERRAT_30 - bool "Montserrat 30" - select LV_FONT_MONTSERRAT_30 - config LV_FONT_DEFAULT_MONTSERRAT_32 - bool "Montserrat 32" - select LV_FONT_MONTSERRAT_32 - config LV_FONT_DEFAULT_MONTSERRAT_34 - bool "Montserrat 34" - select LV_FONT_MONTSERRAT_34 - config LV_FONT_DEFAULT_MONTSERRAT_36 - bool "Montserrat 36" - select LV_FONT_MONTSERRAT_36 - config LV_FONT_DEFAULT_MONTSERRAT_38 - bool "Montserrat 38" - select LV_FONT_MONTSERRAT_38 - config LV_FONT_DEFAULT_MONTSERRAT_40 - bool "Montserrat 40" - select LV_FONT_MONTSERRAT_40 - config LV_FONT_DEFAULT_MONTSERRAT_42 - bool "Montserrat 42" - select LV_FONT_MONTSERRAT_42 - config LV_FONT_DEFAULT_MONTSERRAT_44 - bool "Montserrat 44" - select LV_FONT_MONTSERRAT_44 - config LV_FONT_DEFAULT_MONTSERRAT_46 - bool "Montserrat 46" - select LV_FONT_MONTSERRAT_46 - config LV_FONT_DEFAULT_MONTSERRAT_48 - bool "Montserrat 48" - select LV_FONT_MONTSERRAT_48 - config LV_FONT_DEFAULT_MONTSERRAT_12_SUBPX - bool "Montserrat 12 sub-pixel" - select LV_FONT_MONTSERRAT_12_SUBPX - config LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED - bool "Montserrat 28 compressed" - select LV_FONT_MONTSERRAT_28_COMPRESSED - config LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW - bool "Dejavu 16 Persian, Hebrew, Arabic letters" - select LV_FONT_DEJAVU_16_PERSIAN_HEBREW - config LV_FONT_DEFAULT_SIMSUN_16_CJK - bool "Simsun 16 CJK" - select LV_FONT_SIMSUN_16_CJK - config LV_FONT_DEFAULT_UNSCII_8 - bool "UNSCII 8 (Perfect monospace font)" - select LV_FONT_UNSCII_8 - config LV_FONT_DEFAULT_UNSCII_16 - bool "UNSCII 16 (Perfect monospace font)" - select LV_FONT_UNSCII_16 - endchoice - - config LV_FONT_FMT_TXT_LARGE - bool "Enable it if you have fonts with a lot of characters." - help - The limit depends on the font size, font face and bpp - but with > 10,000 characters if you see issues probably you - need to enable it. - - config LV_USE_FONT_COMPRESSED - bool "Sets support for compressed fonts." - - config LV_USE_FONT_SUBPX - bool "Enable subpixel rendering." - - config LV_FONT_SUBPX_BGR - bool "Use BGR instead RGB for sub-pixel rendering." - depends on LV_USE_FONT_SUBPX - help - Set the pixel order of the display. - Important only if "subpx fonts" are used. - With "normal" font it doesn't matter. - endmenu - - menu "Text Settings" - choice LV_TXT_ENC - prompt "Select a character encoding for strings" - help - Select a character encoding for strings. Your IDE or editor should have the same character encoding. - default LV_TXT_ENC_UTF8 if !LV_CONF_MINIMAL - default LV_TXT_ENC_ASCII if LV_CONF_MINIMAL - - config LV_TXT_ENC_UTF8 - bool "UTF8" - config LV_TXT_ENC_ASCII - bool "ASCII" - endchoice - - config LV_TXT_BREAK_CHARS - string "Can break (wrap) texts on these chars" - default " ,.;:-_" - - config LV_TXT_LINE_BREAK_LONG_LEN - int "Line break long length" - default 0 - help - If a word is at least this long, will break wherever 'prettiest'. - To disable, set to a value <= 0. - - config LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN - int "Min num chars before break" - default 3 - depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 - help - Minimum number of characters in a long word to put on a line before a break. - - config LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - int "Min num chars after break" - default 3 - depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 - help - Minimum number of characters in a long word to put on a line after a break. - - config LV_TXT_COLOR_CMD - string "The control character to use for signalling text recoloring" - default "#" - - config LV_USE_BIDI - bool "Support bidirectional texts" - help - Allows mixing Left-to-Right and Right-to-Left texts. - The direction will be processed according to the Unicode Bidirectional Algorithm: - https://www.w3.org/International/articles/inline-bidi-markup/uba-basics - - choice - prompt "Set the default BIDI direction" - default LV_BIDI_DIR_AUTO - depends on LV_USE_BIDI - - config LV_BIDI_DIR_LTR - bool "Left-to-Right" - config LV_BIDI_DIR_RTL - bool "Right-to-Left" - config LV_BIDI_DIR_AUTO - bool "Detect texts base direction" - endchoice - - config LV_USE_ARABIC_PERSIAN_CHARS - bool "Enable Arabic/Persian processing" - help - In these languages characters should be replaced with - an other form based on their position in the text. - endmenu - - menu "Widget usage" - config LV_USE_ARC - bool "Arc." - default y if !LV_CONF_MINIMAL - config LV_USE_BAR - bool "Bar." - default y if !LV_CONF_MINIMAL - config LV_USE_BTN - bool "Button." - default y if !LV_CONF_MINIMAL - config LV_USE_BTNMATRIX - bool "Button matrix." - default y if !LV_CONF_MINIMAL - config LV_USE_CANVAS - bool "Canvas. Dependencies: lv_img." - default y if !LV_CONF_MINIMAL - config LV_USE_CHECKBOX - bool "Check Box" - default y if !LV_CONF_MINIMAL - config LV_USE_DROPDOWN - bool "Drop down list. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_USE_IMG - bool "Image. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_USE_LABEL - bool "Label." - default y if !LV_CONF_MINIMAL - config LV_LABEL_TEXT_SELECTION - bool "Enable selecting text of the label." - depends on LV_USE_LABEL - default y - config LV_LABEL_LONG_TXT_HINT - bool "Store extra some info in labels (12 bytes) to speed up drawing of very long texts." - depends on LV_USE_LABEL - default y - config LV_USE_LINE - bool "Line." - default y if !LV_CONF_MINIMAL - config LV_USE_ROLLER - bool "Roller. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_ROLLER_INF_PAGES - int "Number of extra 'pages' when the controller is infinite." - default 7 - depends on LV_USE_ROLLER - config LV_USE_SLIDER - bool "Slider. Requires: lv_bar." - select LV_USE_BAR - default y if !LV_CONF_MINIMAL - config LV_USE_SWITCH - bool "Switch." - default y if !LV_CONF_MINIMAL - config LV_USE_TEXTAREA - bool "Text area. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_TEXTAREA_DEF_PWD_SHOW_TIME - int "Text area def. pwd show time [ms]." - default 1500 - depends on LV_USE_TEXTAREA - config LV_USE_TABLE - bool "Table." - default y if !LV_CONF_MINIMAL - endmenu - - menu "Extra Widgets" - config LV_USE_ANIMIMG - bool "Anim image." - default y if !LV_CONF_MINIMAL - config LV_USE_CALENDAR - bool "Calendar." - default y if !LV_CONF_MINIMAL - config LV_CALENDAR_WEEK_STARTS_MONDAY - bool "Calendar week starts monday." - depends on LV_USE_CALENDAR - config LV_USE_CALENDAR_HEADER_ARROW - bool "Use calendar header arrow" - depends on LV_USE_CALENDAR - default y - config LV_USE_CALENDAR_HEADER_DROPDOWN - bool "Use calendar header dropdown" - depends on LV_USE_CALENDAR - default y - config LV_USE_CHART - bool "Chart." - default y if !LV_CONF_MINIMAL - config LV_USE_COLORWHEEL - bool "Colorwheel." - default y if !LV_CONF_MINIMAL - config LV_USE_IMGBTN - bool "Imgbtn." - default y if !LV_CONF_MINIMAL - config LV_USE_KEYBOARD - bool "Keyboard." - default y if !LV_CONF_MINIMAL - config LV_USE_LED - bool "LED." - default y if !LV_CONF_MINIMAL - config LV_USE_LIST - bool "List." - default y if !LV_CONF_MINIMAL - config LV_USE_METER - bool "Meter." - default y if !LV_CONF_MINIMAL - config LV_USE_MSGBOX - bool "Msgbox." - default y if !LV_CONF_MINIMAL - config LV_USE_SPINBOX - bool "Spinbox." - default y if !LV_CONF_MINIMAL - config LV_USE_SPINNER - bool "Spinner." - default y if !LV_CONF_MINIMAL - config LV_USE_TABVIEW - bool "Tabview." - default y if !LV_CONF_MINIMAL - config LV_USE_TILEVIEW - bool "Tileview" - default y if !LV_CONF_MINIMAL - config LV_USE_WIN - bool "Win" - default y if !LV_CONF_MINIMAL - config LV_USE_SPAN - bool "span" - default y if !LV_CONF_MINIMAL - config LV_SPAN_SNIPPET_STACK_SIZE - int "Maximum number of span descriptor" - default 64 - depends on LV_USE_SPAN - endmenu - - menu "Themes" - config LV_USE_THEME_DEFAULT - bool "A simple, impressive and very complete theme" - default y if !LV_CONF_MINIMAL - config LV_THEME_DEFAULT_DARK - bool "Yes to set dark mode, No to set light mode" - depends on LV_USE_THEME_DEFAULT - config LV_THEME_DEFAULT_GROW - bool "Enable grow on press" - default y - depends on LV_USE_THEME_DEFAULT - config LV_THEME_DEFAULT_TRANSITION_TIME - int "Default transition time in [ms]" - default 80 - depends on LV_USE_THEME_DEFAULT - config LV_USE_THEME_BASIC - bool "A very simple theme that is a good starting point for a custom theme" - default y if !LV_CONF_MINIMAL - endmenu - - menu "Layouts" - config LV_USE_FLEX - bool "A layout similar to Flexbox in CSS." - default y if !LV_CONF_MINIMAL - config LV_USE_GRID - bool "A layout similar to Grid in CSS." - default y if !LV_CONF_MINIMAL - endmenu - - menu "3rd Party Libraries" - config LV_USE_FS_STDIO - int "File system on top of stdio API" - default 0 - config LV_FS_STDIO_PATH - string "Set the working directory" - depends on LV_USE_FS_STDIO - - config LV_USE_FS_POSIX - int "File system on top of posix API" - default 0 - config LV_FS_POSIX_PATH - string "Set the working directory" - depends on LV_USE_FS_POSIX - - config LV_USE_FS_WIN32 - int "File system on top of Win32 API" - default 0 - config LV_FS_WIN32_PATH - string "Set the working directory" - depends on LV_USE_FS_WIN32 - - config LV_USE_FS_FATFS - int "File system on top of FatFS" - default 0 - - config LV_USE_PNG - bool "PNG decoder library" - - config LV_USE_BMP - bool "BMP decoder library" - - config LV_USE_SJPG - bool "JPG + split JPG decoder library" - - config LV_USE_GIF - bool "GIF decoder library" - - config LV_USE_QRCODE - bool "QR code library" - - config LV_USE_FREETYPE - bool "FreeType library" - config LV_FREETYPE_CACHE_SIZE - int "Memory used by FreeType to cache characters [bytes] (-1: no caching)" - depends on LV_USE_FREETYPE - default 16384 - - config LV_USE_RLOTTIE - bool "Lottie library" - endmenu - - menu "Others" - config LV_USE_SNAPSHOT - bool "Enable API to take snapshot" - default y if !LV_CONF_MINIMAL - endmenu - - menu "Examples" config LV_BUILD_EXAMPLES - bool "Enable the examples to be built" - default y if !LV_CONF_MINIMAL + bool "Enable the examples to be built with the library." + default y + endmenu + endif - config LV_BUILD_EXAMPLES - bool "Enable the examples to be built with the library." - default y - - endmenu -endif +endmenu diff --git a/APP_Framework/lib/queue/Kconfig b/APP_Framework/lib/queue/Kconfig index 6e5e210bd..1f7882513 100644 --- a/APP_Framework/lib/queue/Kconfig +++ b/APP_Framework/lib/queue/Kconfig @@ -1,3 +1,7 @@ -menuconfig LIB_USING_QUEUE - bool "USING QUEUE" - default n +menu "lib using queue" + + menuconfig LIB_USING_QUEUE + bool "USING QUEUE" + default n + +endmenu diff --git a/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/third_party_driver/spi/connect_lora_spi.c b/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/third_party_driver/spi/connect_lora_spi.c index 76cdb61db..c8255cf7a 100644 --- a/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/third_party_driver/spi/connect_lora_spi.c +++ b/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/third_party_driver/spi/connect_lora_spi.c @@ -22,7 +22,7 @@ static struct HardwareDev *g_spi_lora_dev; static BusType buspin; -tRadioDriver *Radio = NONE; +static tRadioDriver *Radio = NONE; void SX1276InitIo(void) { struct PinParam PinCfg; diff --git a/Ubiquitous/XiZi_IIoT/board/aiit-riscv64-board/third_party_driver/spi/connect_lora_spi.c b/Ubiquitous/XiZi_IIoT/board/aiit-riscv64-board/third_party_driver/spi/connect_lora_spi.c index 5d3e7c7a2..37c969cff 100644 --- a/Ubiquitous/XiZi_IIoT/board/aiit-riscv64-board/third_party_driver/spi/connect_lora_spi.c +++ b/Ubiquitous/XiZi_IIoT/board/aiit-riscv64-board/third_party_driver/spi/connect_lora_spi.c @@ -22,7 +22,7 @@ static struct HardwareDev *g_spi_lora_dev; static BusType buspin; -tRadioDriver *Radio = NONE; +static tRadioDriver *Radio = NONE; void SX1276InitIo(void) { struct PinParam PinCfg; diff --git a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/touch/connect_touch.c b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/touch/connect_touch.c index 54efb4a73..d0ed1ef4f 100644 --- a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/touch/connect_touch.c +++ b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/touch/connect_touch.c @@ -77,7 +77,7 @@ static x_err_t ReadRegs(struct HardwareDev* dev, uint8 len, uint8* buf) // not used in polling mode static void touch_pin_irqhandler(void* arg) { - KPrintf("int hdr working.\n"); + //KPrintf("int hdr working.\n"); if (!SemReleaseFlag) { KSemaphoreAbandon(touch_sem); diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/spi/connect_lora_spi.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/spi/connect_lora_spi.c index baa130571..c949d38e7 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/spi/connect_lora_spi.c +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/spi/connect_lora_spi.c @@ -25,7 +25,7 @@ #define LORA_RST_PIN (GPIO_PIN_02) static struct HardwareDev *g_spi_lora_dev; -tRadioDriver *Radio = NONE; +static tRadioDriver *Radio = NONE; void SX1276InitIo(void) { diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/touch/connect_touch.c b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/touch/connect_touch.c index 50000748b..091e9e341 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/touch/connect_touch.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/touch/connect_touch.c @@ -205,7 +205,7 @@ static int32_t GtpGetInfo(void) // not used in polling mode static void GT9xx_PEN_IRQHandler(void* arg) { - KPrintf("int hdr working.\n"); + //KPrintf("int hdr working.\n"); if (!SemReleaseFlag) { KSemaphoreAbandon(touch_sem); diff --git a/Ubiquitous/XiZi_IIoT/kernel/include/user_api.h b/Ubiquitous/XiZi_IIoT/kernel/include/user_api.h index b804f06ac..29410198f 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/include/user_api.h +++ b/Ubiquitous/XiZi_IIoT/kernel/include/user_api.h @@ -126,6 +126,14 @@ x_err_t UserMsgQueueRecv(int32_t mq, void *buffer, size_t size,int32_t wait_tim x_err_t UserMsgQueueReinit(int32_t mq); #endif +#ifdef KERNEL_SOFTTIMER +int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode); +x_err_t UserTimerDelete(int32_t timer_id); +x_err_t UserTimerStartRun(int32_t timer_id); +x_err_t UserTimerQuitRun(int32_t timer_id); +x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks); +#endif + int open(const char *path, int flags, ...); int read(int fd, void *buf, size_t len); int write(int fd, const void *buf, size_t len); @@ -239,6 +247,14 @@ uint8_t UserGetTaskPriority(int32_t id); #define UserMsgQueueReinit KMsgQueueReinit #endif +#ifdef KERNEL_SOFTTIMER +int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode); +x_err_t UserTimerDelete(int32_t timer_id); +x_err_t UserTimerStartRun(int32_t timer_id); +x_err_t UserTimerQuitRun(int32_t timer_id); +x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks); +#endif + #define UserPrintf KPrintf diff --git a/Ubiquitous/XiZi_IIoT/kernel/include/xs_service.h b/Ubiquitous/XiZi_IIoT/kernel/include/xs_service.h index d213f9f9f..493fb28f7 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/include/xs_service.h +++ b/Ubiquitous/XiZi_IIoT/kernel/include/xs_service.h @@ -74,6 +74,12 @@ enum KernelServiceEnum KS_USER_MSGQUEUE_RECV, KS_USER_MSGQUEUE_REINIT, + KS_USER_TIMER_CREATE, + KS_USER_TIMER_DELETE, + KS_USER_TIMER_STARTRUN, + KS_USER_TIMER_QUITRUN, + KS_USER_TIMER_MODIFY, + KS_USER_OPEN, KS_USER_READ, KS_USER_WRITE, diff --git a/Ubiquitous/XiZi_IIoT/kernel/kernel_service/xs_service.c b/Ubiquitous/XiZi_IIoT/kernel/kernel_service/xs_service.c index d24a1ee34..d857f2cd5 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/kernel_service/xs_service.c +++ b/Ubiquitous/XiZi_IIoT/kernel/kernel_service/xs_service.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef FS_VFS #include @@ -401,6 +402,53 @@ uintptr_t KsMsgQueueReinit(uint32_t knum,uintptr_t *param, uint8_t num ) return (uintptr_t)ret; } #endif + +#ifdef KERNEL_SOFTTIMER +static int32 timer_sem; +static void KsTimerCallback(void *parameter) +{ + KSemaphoreAbandon(timer_sem); +} + +uintptr_t KsTimerCreate(uint32_t knum, uintptr_t *param, uint8_t num) +{ + int32 ret; + + timer_sem = *((int *)param[2]); + + ret = KCreateTimer((const char *)(param[0]), KsTimerCallback, (void *)(param[2]), (x_ticks_t)(param[3]), (uint8)(param[4])); + return (uintptr_t)ret; +} + +uintptr_t KsTimerDelete(uint32_t knum, uintptr_t *param, uint8_t num) +{ + x_err_t ret; + ret = KDeleteTimer((int32)(param[0])); + return (uintptr_t)ret; +} + +uintptr_t KsTimerStartRun(uint32_t knum, uintptr_t *param, uint8_t num) +{ + x_err_t ret; + ret = KTimerStartRun((int32)(param[0])); + return (uintptr_t)ret; +} + +uintptr_t KsTimerQuitRun(uint32_t knum, uintptr_t *param, uint8_t num) +{ + x_err_t ret; + ret = KTimerQuitRun((int32)(param[0])); + return (uintptr_t)ret; +} + +uintptr_t KsTimerModify(uint32_t knum, uintptr_t *param, uint8_t num) +{ + x_err_t ret; + ret = KTimerModify((int32)(param[0]), (x_ticks_t)(param[1])); + return (uintptr_t)ret; +} +#endif + /* fs posix*/ #ifdef FS_VFS @@ -566,87 +614,95 @@ uintptr_t KsStatfs(uint32_t knum,uintptr_t *param, uint8_t num ) struct KernelService g_service_table[256] __attribute__ ((section (".g_service_table"))) = { - [KS_USER_PRINT_INFO] = { KsPrintInfo, 1 }, + [KS_USER_PRINT_INFO] = { KsPrintInfo, 1 }, - /*************** Task ************/ - [KS_USER_TASK_CREATE] = { KsTaskCreate, 5 }, - [KS_USER_TASK_STARTUP] = { KsStartupTask, 1 }, - [KS_USER_TASK_DELETE] = { KsTaskDelete, 1 }, - [KS_USER_TASK_SEARCH] = { KsUserTaskSerach, 0 }, - [KS_USER_TASK_EXECEXIT] = { KsTaskQuit, 0 }, - [KS_USER_TASK_CORE_COMBINE] = { KsTaskCoreCombine, 2 }, - [KS_USER_TASK_CORE_UNCOMBINE] = { KsTaskCoreUnCombine, 1 }, - [KS_USER_TASK_DELAY] = { KsMdelayTask, 1 }, - [KS_USER_GET_TASK_NAME] = { KsGetTaskName, 2 }, - [KS_USER_GET_TASK_ID] = { KsGetTaskID, 0 }, - [KS_USER_GET_TASK_STAT] = { KsGetTaskStat, 1 }, - [KS_USER_GET_TASK_COMBINEED_CORE] = { KsGetTaskCombinedCore, 1 }, - [KS_USER_GET_TASK_RUNNING_CORE] = { KsGetTaskRunningCore, 1 }, - [KS_USER_GET_TASK_ERROR_STATUS] = { KsGetTaskErrorstatus, 1 }, - [KS_USER_GET_TASK_PRIORITY] = { KsGetTaskPriority, 1 }, + /*************** Task ************/ + [KS_USER_TASK_CREATE] = { KsTaskCreate, 5 }, + [KS_USER_TASK_STARTUP] = { KsStartupTask, 1 }, + [KS_USER_TASK_DELETE] = { KsTaskDelete, 1 }, + [KS_USER_TASK_SEARCH] = { KsUserTaskSerach, 0 }, + [KS_USER_TASK_EXECEXIT] = { KsTaskQuit, 0 }, + [KS_USER_TASK_CORE_COMBINE] = { KsTaskCoreCombine, 2 }, + [KS_USER_TASK_CORE_UNCOMBINE] = { KsTaskCoreUnCombine, 1 }, + [KS_USER_TASK_DELAY] = { KsMdelayTask, 1 }, + [KS_USER_GET_TASK_NAME] = { KsGetTaskName, 2 }, + [KS_USER_GET_TASK_ID] = { KsGetTaskID, 0 }, + [KS_USER_GET_TASK_STAT] = { KsGetTaskStat, 1 }, + [KS_USER_GET_TASK_COMBINEED_CORE] = { KsGetTaskCombinedCore, 1 }, + [KS_USER_GET_TASK_RUNNING_CORE] = { KsGetTaskRunningCore, 1 }, + [KS_USER_GET_TASK_ERROR_STATUS] = { KsGetTaskErrorstatus, 1 }, + [KS_USER_GET_TASK_PRIORITY] = { KsGetTaskPriority, 1 }, - /*************** Memory ************/ - [KS_USER_MALLOC] = { KsMalloc, 1 }, - [KS_USER_FREE] = { KsFree, 1 }, + /*************** Memory ************/ + [KS_USER_MALLOC] = { KsMalloc, 1 }, + [KS_USER_FREE] = { KsFree, 1 }, #ifdef KERNEL_MUTEX - /*************** Mutex ************/ - [KS_USER_MUTEX_CREATE] = { KsCreateMutex, 0 }, - [KS_USER_MUTEX_DELETE] = { KsDeleteMutex, 1 }, - [KS_USER_MUTEX_OBTAIN] = { KsMutexObtain, 2 }, - [KS_USER_MUTEX_ABANDON] = { KsMutexAbandon, 1 }, + /*************** Mutex ************/ + [KS_USER_MUTEX_CREATE] = { KsCreateMutex, 0 }, + [KS_USER_MUTEX_DELETE] = { KsDeleteMutex, 1 }, + [KS_USER_MUTEX_OBTAIN] = { KsMutexObtain, 2 }, + [KS_USER_MUTEX_ABANDON] = { KsMutexAbandon, 1 }, #endif #ifdef KERNEL_SEMAPHORE - /*************** Semaphore ************/ - [KS_USER_SEMAPHORE_CREATE] = { KsCreateSemaphore, 1 }, - [KS_USER_SEMAPHORE_DELETE] = { KsDeleteSemaphore, 1 }, - [KS_USER_SEMAPHORE_OBTAIN] = { KsSemaphoreObtain, 2 }, - [KS_USER_SEMAPHORE_ABANDON] = { KsSemaphoreAbandon, 1 }, - [KS_USER_SEMAPHORE_SETVALUE] = { KsSemaphoreSetValue, 2 }, + /*************** Semaphore ************/ + [KS_USER_SEMAPHORE_CREATE] = { KsCreateSemaphore, 1 }, + [KS_USER_SEMAPHORE_DELETE] = { KsDeleteSemaphore, 1 }, + [KS_USER_SEMAPHORE_OBTAIN] = { KsSemaphoreObtain, 2 }, + [KS_USER_SEMAPHORE_ABANDON] = { KsSemaphoreAbandon, 1 }, + [KS_USER_SEMAPHORE_SETVALUE] = { KsSemaphoreSetValue, 2 }, #endif - /*************** Event ************/ + /*************** Event ************/ #ifdef KERNEL_EVENT - [KS_USER_EVENT_CREATE] = { KsCreateEvent, 1 }, - [KS_USER_EVENT_DELETE] = { KsDeleteEvent, 1 }, - [KS_USER_EVENT_TRIGGER] = { KsEventTrigger, 2 }, - [KS_USER_EVENT_PROCESS] = { KsEventProcess, 5 }, + [KS_USER_EVENT_CREATE] = { KsCreateEvent, 1 }, + [KS_USER_EVENT_DELETE] = { KsDeleteEvent, 1 }, + [KS_USER_EVENT_TRIGGER] = { KsEventTrigger, 2 }, + [KS_USER_EVENT_PROCESS] = { KsEventProcess, 5 }, #endif #ifdef KERNEL_MESSAGEQUEUE - /*************** Msg queue ************/ - [KS_USER_MSGQUEUE_CREATE] = { KsCreateMsgQueue, 2 }, - [KS_USER_MSGQUEUE_DELETE] = { KsDeleteMsgQueue, 1 }, - [KS_USER_MSGQUEUE_SENDWAIT] = { KsMsgQueueSendwait, 4 }, - [KS_USER_MSGQUEUE_SEND] = { KsMsgQueueSend, 3 }, - [KS_USER_MSGQUEUE_URGENTSEND] = { KsMsgQueueUrgentSend, 3 }, - [KS_USER_MSGQUEUE_RECV] = { KsMsgQueueRecv, 4 }, - [KS_USER_MSGQUEUE_REINIT] = { KsMsgQueueReinit, 1 }, + /*************** Msg queue ************/ + [KS_USER_MSGQUEUE_CREATE] = { KsCreateMsgQueue, 2 }, + [KS_USER_MSGQUEUE_DELETE] = { KsDeleteMsgQueue, 1 }, + [KS_USER_MSGQUEUE_SENDWAIT] = { KsMsgQueueSendwait, 4 }, + [KS_USER_MSGQUEUE_SEND] = { KsMsgQueueSend, 3 }, + [KS_USER_MSGQUEUE_URGENTSEND] = { KsMsgQueueUrgentSend, 3 }, + [KS_USER_MSGQUEUE_RECV] = { KsMsgQueueRecv, 4 }, + [KS_USER_MSGQUEUE_REINIT] = { KsMsgQueueReinit, 1 }, +#endif +#ifdef KERNEL_SOFTTIMER + /*************** Soft Timer ************/ + [KS_USER_TIMER_CREATE] = { KsTimerCreate, 5 }, + [KS_USER_TIMER_DELETE] = { KsTimerDelete, 1 }, + [KS_USER_TIMER_STARTRUN] = { KsTimerStartRun, 1 }, + [KS_USER_TIMER_QUITRUN] = { KsTimerQuitRun, 1 }, + [KS_USER_TIMER_MODIFY] = { KsTimerModify, 2 }, #endif #ifdef FS_VFS - /*************** fs poxix ************/ - [KS_USER_OPEN] = { KsOpen , 3 }, - [KS_USER_READ] = { KsRead , 3 }, - [KS_USER_WRITE] = { KsWrite , 3 }, - [KS_USER_CLOSE] = { KsClose , 1 }, - [KS_USER_IOCTL] = { KsIoctl , 3 }, - [KS_USER_LSEEK] = { KsLseek , 3 }, - [KS_USER_RENAME] = { KsRename , 2 }, - [KS_USER_UNLINK] = { KsUnlink , 1 }, - [KS_USER_STAT] = { KsStat , 2 }, - [KS_USER_FS_STAT] = { KsFstat , 2 }, - [KS_USER_FS_SYNC] = { KsFsync , 1 }, - [KS_USER_FTRUNCATE] = { KsFtruncate , 2 }, - [KS_USER_MKDIR] = { KsMkdir , 2 }, - [KS_USER_OPENDIR] = { KsOpendir , 1 }, - [KS_USER_CLOSEDIR] = { KsClosedir , 1 }, - [KS_USER_READDIR] = { KsReaddir , 1 }, - [KS_USER_RMDIR] = { KsRmdir , 1 }, - [KS_USER_CHDIR] = { KsChdir , 1 }, - [KS_USER_GETCWD] = { KsGetcwd, 2 }, - [KS_USER_TELLDIR] = { KsTelldir, 1 }, - [KS_USER_SEEKDIR] = { KsSeekdir, 2 }, - [KS_USER_REWIND_DIR] = { KsRewinddir, 1 }, - [KS_USER_STAT_FS] = { KsStatfs, 2 }, + /*************** fs poxix ************/ + [KS_USER_OPEN] = { KsOpen , 3 }, + [KS_USER_READ] = { KsRead , 3 }, + [KS_USER_WRITE] = { KsWrite , 3 }, + [KS_USER_CLOSE] = { KsClose , 1 }, + [KS_USER_IOCTL] = { KsIoctl , 3 }, + [KS_USER_LSEEK] = { KsLseek , 3 }, + [KS_USER_RENAME] = { KsRename , 2 }, + [KS_USER_UNLINK] = { KsUnlink , 1 }, + [KS_USER_STAT] = { KsStat , 2 }, + [KS_USER_FS_STAT] = { KsFstat , 2 }, + [KS_USER_FS_SYNC] = { KsFsync , 1 }, + [KS_USER_FTRUNCATE] = { KsFtruncate , 2 }, + [KS_USER_MKDIR] = { KsMkdir , 2 }, + [KS_USER_OPENDIR] = { KsOpendir , 1 }, + [KS_USER_CLOSEDIR] = { KsClosedir , 1 }, + [KS_USER_READDIR] = { KsReaddir , 1 }, + [KS_USER_RMDIR] = { KsRmdir , 1 }, + [KS_USER_CHDIR] = { KsChdir , 1 }, + [KS_USER_GETCWD] = { KsGetcwd, 2 }, + [KS_USER_TELLDIR] = { KsTelldir, 1 }, + [KS_USER_SEEKDIR] = { KsSeekdir, 2 }, + [KS_USER_REWIND_DIR] = { KsRewinddir, 1 }, + [KS_USER_STAT_FS] = { KsStatfs, 2 }, #endif - [KS_USER_END ... 255] = {NONE, 0} + [KS_USER_END ... 255] = {NONE, 0} }; #else @@ -718,6 +774,53 @@ uint8_t UserGetTaskPriority(int32_t id) return (uintptr_t)task->task_dync_sched_member.cur_prio; } +#ifdef KERNEL_SOFTTIMER +static int32 timer_sem; +static void UserTimerCallback(void *parameter) +{ + KSemaphoreAbandon(timer_sem); +} + +int32 UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode) +{ + int32 ret; + + timer_sem = *((int *)parameter); + + ret = KCreateTimer(name, UserTimerCallback, NONE, time, trigger_mode); + return ret; +} + +x_err_t UserTimerDelete(int32_t timer_id) +{ + x_err_t ret; + ret = KDeleteTimer(timer_id); + return ret; +} + +x_err_t UserTimerStartRun(int32_t timer_id) +{ + x_err_t ret; + ret = KTimerStartRun(timer_id); + return ret; +} + +x_err_t UserTimerQuitRun(int32_t timer_id) +{ + x_err_t ret; + ret = KTimerQuitRun(timer_id); + return ret; +} + +x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks) +{ + x_err_t ret; + + ret = KTimerModify(timer_id, ticks); + return ret; +} +#endif + long occupy_g_service_table __attribute__ ((section (".g_service_table"))) = 0; #endif \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/kernel/thread/event.c b/Ubiquitous/XiZi_IIoT/kernel/thread/event.c index 4217b9676..4546cd644 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/thread/event.c +++ b/Ubiquitous/XiZi_IIoT/kernel/thread/event.c @@ -288,7 +288,7 @@ int32 KEventTrigger(int32 id, uint32 events) * @param events events flag * @param options trigger way * @param msec timeout - * @processed event processed flag + * @param processed event processed flag * * @return EOK on success. */ diff --git a/Ubiquitous/XiZi_IIoT/kernel/thread/softtimer.c b/Ubiquitous/XiZi_IIoT/kernel/thread/softtimer.c index 244c49cf3..f08f3d1cb 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/thread/softtimer.c +++ b/Ubiquitous/XiZi_IIoT/kernel/thread/softtimer.c @@ -147,7 +147,7 @@ static struct TimerDone Done = /** * This function will create a softtimer. * - * @param name the length of the msg queue. + * @param name the name of the timer. * @param timeout the callback of the timer. * @param parameter the parameter of the callback function * @param time the timeout time diff --git a/Ubiquitous/XiZi_IIoT/path_kernel.mk b/Ubiquitous/XiZi_IIoT/path_kernel.mk index 4614df672..e7e3c5557 100755 --- a/Ubiquitous/XiZi_IIoT/path_kernel.mk +++ b/Ubiquitous/XiZi_IIoT/path_kernel.mk @@ -512,11 +512,29 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protoc KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protocol/s7 # endif - ifeq ($(CONFIG_LIB_USING_CJSON), y) KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/cJSON endif +ifeq ($(CONFIG_LIB_USING_LORAWAN), y) +ifeq ($(CONFIG_LIB_USING_LORA_RADIO), y) +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/common # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/include # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/sx126x # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/sx127x # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/ports/lora-module/inc # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/ports/samples/lora-radio-tester # +endif + +ifeq ($(CONFIG_LIB_USING_LORAWAN_ED_STACK), y) +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Aps/Basic # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Common # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac/Crypto # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Phy/region # +endif +endif + ifeq ($(CONFIG_CRYPTO), y) KERNELPATHS += -I$(KERNEL_ROOT)/framework/security/crypto/include # endif diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/Makefile new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Kconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Makefile new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Kconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Makefile new file mode 100644 index 000000000..e69de29bb