Compare commits
2 Commits
23116b7e3d
...
040b9be6b9
Author | SHA1 | Date |
---|---|---|
|
040b9be6b9 | |
|
fd68396b30 |
|
@ -3,3 +3,4 @@
|
||||||
/.idea/
|
/.idea/
|
||||||
/.venv/
|
/.venv/
|
||||||
/lvgl/
|
/lvgl/
|
||||||
|
/SDL3/
|
||||||
|
|
|
@ -39,7 +39,7 @@ add_executable(HW_Lib main.c ${SOURCES})
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
|
|
||||||
target_link_libraries(HW_Lib HW_LIB_List HW_LIB_Task HW_LIB_Printf HW_LIB_Utils HW_LIB_Iic
|
target_link_libraries(HW_Lib HW_LIB_List HW_LIB_Task HW_LIB_Printf HW_LIB_Utils HW_LIB_Iic
|
||||||
HW_LIB_Spi HW_LIB_Key HW_LIB_Oled HW_LIB_Font HW_LIB_Tft lvgl::lvgl lvgl::examples lvgl::demos
|
HW_LIB_Spi HW_LIB_Key HW_LIB_Oled HW_LIB_Font HW_LIB_Tft lvgl::lvgl HW_LIB_Lui
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command(TARGET HW_Lib POST_BUILD
|
add_custom_command(TARGET HW_Lib POST_BUILD
|
||||||
|
|
|
@ -41,7 +41,7 @@ int Test_lvgl(void *pVoid) {
|
||||||
// lv_port_indev_init();
|
// lv_port_indev_init();
|
||||||
|
|
||||||
// lv_example_get_started_1();
|
// lv_example_get_started_1();
|
||||||
lv_demo_widgets();
|
// lv_demo_widgets();
|
||||||
// printf("\nTEST Widgets\n");
|
// printf("\nTEST Widgets\n");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -105,7 +105,7 @@ OLED_T oled = {
|
||||||
.height = 64,
|
.height = 64,
|
||||||
.width = 128,
|
.width = 128,
|
||||||
.state = IDLE,
|
.state = IDLE,
|
||||||
.buf = oledbuf,
|
.buf = oledbuf[0],
|
||||||
.cmd = Cmd,
|
.cmd = Cmd,
|
||||||
.data = Data,
|
.data = Data,
|
||||||
.call = Refresh_Call,
|
.call = Refresh_Call,
|
||||||
|
|
|
@ -11,6 +11,7 @@ set(LIBRARIES
|
||||||
HW_LIB_Oled oled oled/inc
|
HW_LIB_Oled oled oled/inc
|
||||||
HW_LIB_Tft tft tft/inc
|
HW_LIB_Tft tft tft/inc
|
||||||
HW_LIB_Flash flash flash/inc
|
HW_LIB_Flash flash flash/inc
|
||||||
|
HW_LIB_Lui lui lui/inc
|
||||||
)
|
)
|
||||||
|
|
||||||
# 循环浏览库列表以创建它们
|
# 循环浏览库列表以创建它们
|
||||||
|
|
|
@ -6,7 +6,7 @@ extern "C" {
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#define KEY_TICKS_INTERVAL 5 // 定时器间隔时间,单位为毫秒
|
#define KEY_TICKS_INTERVAL 5 // 定时器间隔时间,单位为毫秒
|
||||||
#define DEBOUNCE_TICKS 0 // 按键去抖动计数阈值,最大为7(0 ~ 7)
|
#define DEBOUNCE_TICKS 0 // 按键去抖动计数阈值,最大为7(0 ~ 7)
|
||||||
#define SHORT_TICKS (300 / KEY_TICKS_INTERVAL) // 短按阈值,单位为定时器间隔的倍数
|
#define SHORT_TICKS (300 / KEY_TICKS_INTERVAL) // 短按阈值,单位为定时器间隔的倍数
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,7 @@
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#include "stdbool.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#include "stdbool.h"
|
||||||
typedef char OptId;
|
typedef char OptId;
|
||||||
|
|
||||||
typedef struct Option {
|
typedef struct Option {
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <syncstream>
|
|
||||||
#include "tool.h"
|
#include "tool.h"
|
||||||
|
|
||||||
float Mapping(float val, float I_Min, float I_Max, float O_Min, float O_Max) {
|
float Mapping(float val, float I_Min, float I_Max, float O_Min, float O_Max) {
|
||||||
|
|
5
main.c
5
main.c
|
@ -12,7 +12,7 @@
|
||||||
#include "t_tft.h"
|
#include "t_tft.h"
|
||||||
#include "tool.h"
|
#include "tool.h"
|
||||||
#include "sim_test.h"
|
#include "sim_test.h"
|
||||||
|
#include "t_lui.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
|
@ -160,10 +160,11 @@ int main(int argc, char *argv[]) {
|
||||||
// Test_Run("List", Test_List,NULL);
|
// Test_Run("List", Test_List,NULL);
|
||||||
// Test_RunTime("Key", Test_Key);
|
// Test_RunTime("Key", Test_Key);
|
||||||
// Test_RunTime("Queue", Test_Queue);
|
// Test_RunTime("Queue", Test_Queue);
|
||||||
Test_RunTime("Hash", Test_Hash);
|
// Test_RunTime("Hash", Test_Hash);
|
||||||
// Test_RunTime("Task", Test_task);
|
// Test_RunTime("Task", Test_task);
|
||||||
// Test_RunTime("OLED", Test_OLED);
|
// Test_RunTime("OLED", Test_OLED);
|
||||||
// Test_RunTime("LVGL", Test_lvgl);
|
// Test_RunTime("LVGL", Test_lvgl);
|
||||||
// Test_RunTime("TFT", Test_tft);
|
// Test_RunTime("TFT", Test_tft);
|
||||||
|
Test_RunTime("LUI", Test_lui);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <syncstream>
|
|
||||||
#include "sim_test.h"
|
#include "sim_test.h"
|
||||||
|
|
||||||
void Test_RunTime(char *name, int (*pFunction)(void *)) {
|
void Test_RunTime(char *name, int (*pFunction)(void *)) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "sim_display.h"
|
#include "sim_display.h"
|
||||||
#include "graphics.h"
|
|
||||||
#include <conio.h>
|
|
||||||
|
|
||||||
#define GET_BIT(x, bit) ((x & (1 << bit)) >> bit)
|
#define GET_BIT(x, bit) ((x & (1 << bit)) >> bit)
|
||||||
|
|
||||||
|
@ -20,6 +19,10 @@ uint32_t RGB565_to_ARGB8888(uint16_t rgb565, bool isBGR) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef USER_SDL3
|
#ifndef USER_SDL3
|
||||||
|
|
||||||
|
#include "graphics.h"
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
static uint32_t pixelColor, backgroundColor;
|
static uint32_t pixelColor, backgroundColor;
|
||||||
static int scaleFactor, w, h;
|
static int scaleFactor, w, h;
|
||||||
uint8_t border;
|
uint8_t border;
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_port_indev.h"
|
#include "lv_port_indev.h"
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "graphics.h"
|
|
||||||
#include <easyx.h>
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
@ -253,8 +251,8 @@ static void mouse_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
|
||||||
static bool mouse_is_pressed(void)
|
static bool mouse_is_pressed(void)
|
||||||
{
|
{
|
||||||
/*Your code comes here*/
|
/*Your code comes here*/
|
||||||
ExMessage msg;peekmessage(&msg, EM_MOUSE);
|
// ExMessage msg;peekmessage(&msg, EM_MOUSE);
|
||||||
if(msg.message==WM_LBUTTONDOWN) return true;
|
// if(msg.message==WM_LBUTTONDOWN) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,13 +260,13 @@ static bool mouse_is_pressed(void)
|
||||||
static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y)
|
static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y)
|
||||||
{
|
{
|
||||||
/*Your code comes here*/
|
/*Your code comes here*/
|
||||||
ExMessage msg;
|
// ExMessage msg;
|
||||||
if(peekmessage(&msg, EM_MOUSE))
|
// if(peekmessage(&msg, EM_MOUSE))
|
||||||
{
|
// {
|
||||||
(*x) = msg.x;
|
// (*x) = msg.x;
|
||||||
(*y) = msg.y;
|
// (*y) = msg.y;
|
||||||
printf("\nX:%d,Y:%d",*x,*y);
|
// printf("\nX:%d,Y:%d",*x,*y);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------
|
/*------------------
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#include "sim_oled.h"
|
#include "sim_oled.h"
|
||||||
#include "graphics.h"
|
|
||||||
#include <conio.h>
|
|
||||||
|
|
||||||
static SIM_Display_t oled_display;
|
static SIM_Display_t oled_display;
|
||||||
void SIM_OLED_INIT(int width, int height, uint32_t pixcolor, uint32_t backcolor, int scale, uint8_t b) {
|
void SIM_OLED_INIT(int width, int height, uint32_t pixcolor, uint32_t backcolor, int scale, uint8_t b) {
|
||||||
|
|
Loading…
Reference in New Issue